= COMPILE =

== PREPARATION ==

Elektra is using cmake.
Tested are cmake version 2.6-patch 0 and version 2.8.2.

To configure elektra run:

 mkdir build && cd build && ccmake ..

and press 'c':

if you want to create a package afterwards it is ok to use
pathes that you can write to (e.g. CMAKE_INSTALL_PREFIX /home/markus/bin)

working plugins are:
dump;resolver;hidden;iconv;syslog;error;validation;xmltool;tracer;timeofday;dbus;glob;hosts;network;type;struct;path;fstab;ccode;simpleini;tcl;hexcode;null;ni

CMAKE_BUILD_TYPE:
	e.g. Debug or Release
	See help bar at bottom of ccmake for that option or:
	http://www.cmake.org/Wiki/CMake_Useful_Variables

DEBUG_BUILD and ELEKTRA_VERBOSE_BUILD:
	Only needed by elektra developers.
	Make the library to output some or a lot of things.
	It is not recommended to use these options.

KDB_DB_SYSTEM:
	is the path where the system configuration is searched at runtime

BUILD_DOCUMENTATION: build documentation with doxygen
 the kdb tool does only have the integrated docu at the moment


CMAKE_INSTALL_PREFIX:
	By default all files will installed below /usr/local.
	Edit that cache entry to change that behaviour.
	Also called system prefix within the documentation.

LIB_SUFFIX:
	Lets you install libraries into architecture specific folder.
	E.g. for 32/64 bit systems you might install libraries under
	lib64. Set LIB_SUFFIX to 64 to achieve exactly that.
	So the system library folder will be CMAKE_INSTALL_PREFIX/lib64
	then.

TARGET_INCLUDE_FOLDER:
	By default include folders will be installed below
	CMAKE_INSTALL_PREFIX/include/elektra
	This entry let you change the elektra.
	If the entry is empty, the include files will be
	installed directly to CMAKE_INSTALL_PREFIX/include.

TARGET_PLUGIN_FOLDER:
	Similar to above, but with the plugins. Default is:
	CMAKE_INSTALL_PREFIX/lib${LIB_SUFFIX}/elektra
	It can be also left empty to install plugins next
	to other libraries.


It is recommended that you browse through all of the options.
Afterwards press c again (maybe multiple times until all variables are
resolved) and then g to generate.  Finally press e to exit.



== BUILDING ==

=== NO IDE ===

To build the source use:

 make

You can pass:
 -j for parallel builds (use nr of CPUs+1)
 VERBOSE=1 to see the invocations of the compiler


=== CodeBlocks ===

You can build Elektra using Code::Blocks under Gentoo:

Precondition:
Make sure you have a compiler, xml2 (for kdb tool) and xsl (see later)
installed. cmake configure will help you with that, it will make sure you don't forget something
essential.

For Most Linux system all you have to do is open up a console and 

 mkdir build 
 cd build 
 cmake .. -G 'CodeBlocks - Unix Makefiles' 
 make package


Note  1:
	You can use other editor if you like just type cmake at the
	console to get a list of option you can pass to cmake as long as well
	as a list of what code editor project cmake can create.

Note 2:
	For Unix if you have nCurses install you can run ccmake to set important option after
	running cmake like to enable debug symbol.

Note 3: 
	for Gentoo is recommend to emerge sys-apps/lsb-release to name the package 
	right even thou not required.

