1 dnl -*- mode: Autoconf; -*-
2 dnl Invoke autogen.sh to produce a configure script.
3 dnl configure-pre.in and src/backends/*/configure-sub.in and configure-post.in come before this part
5 AC_SUBST(BACKEND_CPPFLAGS)
8 backend_is_enabled () {
9 eval echo \${enable_${1}}
11 for backend in $BACKENDS; do
12 if test `backend_is_enabled $backend` == "yes"; then
14 SYNCEVOLUTION_MODULES="$SYNCEVOLUTION_MODULES src/backends/sync${backend}.la"
18 if test "$enable_any" = "no"; then
19 AC_MSG_ERROR([no backend enabled - refusing to continue: $anymissing])
22 dnl check for programs.
27 dnl glib initialization is done only if requested by some configure-sub.in,
28 dnl for not needed otherwise even if found
29 if test "$need_glib" = "yes"; then
30 # HAVE_GLIB (aka GLIBFOUND) are a catch-all for these
31 # three GNOME libs. Assume we have all three unless one of
35 dnl check for glib - calling g_type_init() is expected on Maemo
36 PKG_CHECK_MODULES(GLIB, "glib-2.0", , GLIBFOUND=no)
37 # This check here is broken on Ubuntu 8.04: it calls glib-config,
38 # which isn't found, but the error is not detected by configure.
39 #if test "x${GLIBFOUND}" = "xno"; then
40 # PKG_CHECK_MODULES(GLIB, "glib", GLIBFOUND=yes, GLIBFOUND=no)
43 PKG_CHECK_MODULES(GTHREAD, "gthread-2.0", , GLIBFOUND=no)
44 PKG_CHECK_MODULES(GOBJECT, "gobject-2.0", , GLIBFOUND=no)
46 if test "x${GLIBFOUND}" = "xyes"; then
47 AC_DEFINE(HAVE_GLIB, 1, [glib found])
49 AC_ERROR([not all GNOME libraries found])
51 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
54 # determine from where we can get a SHA-256 implementation
56 if test "$GLIBFOUND" = "yes"; then
57 # only use glib if we need it anyway, also has to be at lease 2.16
58 PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
59 [AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
63 if test "$have_sha" = "no"; then
64 # Fallback is Mozilla NSS. In contrast to libgcrypt it has a .pc
65 # file and a simple API.
66 PKG_CHECK_MODULES(NSS, "nss",
67 [AC_DEFINE(USE_SHA256, 2, [choose implementation of SHA-256])
72 dnl figure out whether we link all code statically or as modules
73 AM_CONDITIONAL([ENABLE_MODULES], [test "$enable_shared" == "yes"])
74 if test "$enable_shared" == "yes"; then
75 AC_DEFINE(ENABLE_MODULES, 1, [enable dynamically opening sync source backends])
77 AC_SUBST(SYNCEVOLUTION_LDADD)
79 dnl CXXFLAGS gets applied to SyncEvolution and the client library.
80 dnl For e.g. "-Wall -Werror" this might not be such a good idea;
81 dnl SYNCEVOLUTION_CXXFLAGS can be used instead. It applies only
82 dnl to the sources in the SyncEvolution repository.
83 AC_SUBST(SYNCEVOLUTION_CXXFLAGS)
85 dnl a quick-and-dirty way to detect compilation for the iPhone
86 if test "$host" == "arm-apple-darwin"; then
87 AC_DEFINE(IPHONE, 1, [compiling for iPhone])
91 dnl --enable-evolution-compatibility
92 if test "$enable_evolution_compatibility" == "yes"; then
93 AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
95 AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" == "yes"])
97 dnl --enable-developer-mode
98 if test "$enable_developer_mode" == "yes"; then
99 backendsearchdir="`pwd`/src/backends/"
101 backendsearchdir='$(libdir)'/syncevolution/backends/
104 backenddir='$(libdir)'/syncevolution/backends
106 AC_SUBST(backendsearchdir)
108 dnl This string is sent as part of the SyncML DevInf (device
109 dnl information) structure to the server. All SyncEvolution platforms
110 dnl use "SyncEvolution" as HTTP user agent and "Mod" (model), so the
111 dnl device type is the only way how different kinds of clients can be
113 AC_DEFINE_UNQUOTED(DEVICE_TYPE, "$DEVICE_TYPE", "SyncML DevInf DevType")
115 AC_CHECK_HEADERS(stdarg.h valgrind/valgrind.h execinfo.h)
117 AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")
119 # fallback for lack of --with-docdir support in older automake
120 if test ! "$docdir"; then
121 docdir = ${datadir}/doc/syncevolution
125 AC_CONFIG_FILES(Makefile src/dbus/interfaces/Makefile src/gdbus/Makefile src/dbus/Makefile src/Makefile src/syncevo/Makefile src/syncevo/syncevolution.pc src/syncevo/configs/Makefile src/synthesis-includes/Makefile src/gtk-ui/Makefile po/Makefile.in test/Makefile src/dbus/syncevo-dbus.pc)
129 echo CONFIGURATION SUMMARY
130 echo "Core SyncEvolution: $enable_core"
131 for backend in $BACKENDS; do
132 eval echo $backend: \${enable_${backend}}
134 echo "DBus service: $enable_dbus_service"
135 echo "UI (DBus client): $enable_gui"
136 echo "Bluetooth transport: $have_bluetooth"
137 echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
138 echo "SHA-256: $have_sha"