Building Instructions - Trunk
Note that more up to date information can be found from:
It is recommended, that following build steps are not done as root or other user privileges that has write permissions to system directories like /usr, /etc etc.
Building has the following steps:
- configuration with cmake
- building with generated Makefiles
- installation to the system folders
In these instructions, all examples assume that there is a toplevel directory opensync/ that contains everything and plugins for example are subdirectories of this toplevel directory.
Building steps might differ a bit depending on how the source was get, from SCM checkout or from extracted tarballs. Either way, the steps must be repeated in right order and particular component directories as follows:
| component | path |
|---|---|
| libopensync | trunk/ |
| libopensync-plugin-vformat | format-plugins/vformat |
| libopensync-plugin-file | plugins/file-sync |
| libopensync-plugin-syncml | plugins/syncml |
| libopensync-plugin-evolution | plugins/evolution2 |
| libopensync-plugin-kdepim | plugins/kdepim |
| libopensync-plugin-ldap | plugins/ldap-sync |
| msynctool | trunk/msynctool1 |
In addition to right build order to ensure the opensync dependencies, the external dependencies listed in [wiki:releases/0.2x/docOutdateds/trunk/installation Installation page] must be met until the build can succeed.
Configuration with cmake
List of typical cmake variables
The following cmake variables are frequently used but not mandatory.
CMAKE_INSTALL_PREFIX:PATH=/usr CMAKE_INSTALL_LIBDIR:PATH=/usr/lib INCLUDE_INSTALL_DIR:PATH=/usr/include LIB_INSTALL_DIR:PATH=/usr/lib SYSCONF_INSTALL_DIR:PATH=/etc SHARE_INSTALL_PREFIX:PATH=/usr/share DBUILD_SHARED_LIBS:BOOL=ON
More information of available configuration can be easily found by executing the command:
ccmake .
which will start interactive configuration dialog:
CMAKE_BACKWARDS_COMPATIBILITY 2.4 CMAKE_BUILD_TYPE CMAKE_CXX_FLAGS_HACKING -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -g CMAKE_C_FLAGS_HACKING -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -g CMAKE_INSTALL_PREFIX /usr/local EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH LIB_SUFFIX OPENSYNC_CAPABILITIESDIR /usr/local/share/libopensync1/capabilities OPENSYNC_CONFIGDIR /usr/local/share/libopensync1/defaults . . .
An Example of cmake configuration
mkdir build
cd $_
cmake \
-D CMAKE_BUILD_TYPE=Debug \
-D OPENSYNC_DEBUG_MODULES:BOOL=ON \
-D OPENSYNC_TRACE:BOOL=ON \
-D OPENSYNC_UNITTESTS:BOOL=ON \
-D CMAKE_BUILD_TYPE=Hacking \
..
Building with make
make
Installation to system folders
By default, the installation installs to /usr/local which also requires root privileges.
cd build make install
