1 dnl -*- mode: Autoconf; -*-
2 dnl Invoke autogen.sh to produce a configure script.
4 # The STABLE_VERSION is used when building
5 # Debian packages. For prereleases (beta, alpha),
6 # set it to something like "0.9.2+" and the AC_INIT
7 # VERSION to 1.0beta1 to produce 0.9.2+1.0beta1.
9 # Starting with the 1.1 release cycle, the rpm-style
10 # .99 pseudo-version number is used to mark a pre-release.
11 AC_INIT([syncevolution], [1.0.99.7])
12 # STABLE_VERSION=1.0.1+
13 AC_SUBST(STABLE_VERSION)
15 AM_INIT_AUTOMAKE([tar-ustar])
16 AC_CONFIG_MACRO_DIR([m4])
17 define([SYNTHESISSRC_REPO], [])
18 dnl Specify git revisions/branches without prefix, i.e., without 'origin'.
19 dnl We'll sort that out below.
20 define([SYNTHESISSRC_REVISION], [syncevolution-0.9])
21 AM_CONFIG_HEADER(config.h)
24 dnl default device type (see AC_DEFINE below)
25 DEVICE_TYPE=workstation
27 AC_ARG_WITH(synthesis-src,
28 AS_HELP_STRING([--with-synthesis-src=<base directory|svn URL|git URL>],
29 [Specifies location of the Synthesis root directory.
30 Use this when the Synthesis library is to
31 be compiled as part of the SyncEvolution compilation. In release
32 versions of SyncEvolution, a copy of the Synthesis code is bundled
33 under 'src/synthesis' and compiled unless something else is
34 specified. --with-synthesis-src can be given a path to sources
35 checked out already, a Subversion repository URL or a git repository
36 URL. When given a repository URL, then the configure script
37 will checkout the sources into 'src/synthesis-workdir' or
38 update that working copy if the directory already exists.
39 Default: bundled source in src/synthesis (in released SyncEvolution sources),
40 SYNTHESISSRC_REPO otherwise.]),
41 [SYNTHESISSRC="$withval"
42 test "$SYNTHESISSRC" != "yes" || AC_MSG_ERROR([--with-synthesis-src requires a parameter (base directory, svn URL or git URL)])],
43 [SYNTHESISSRC="$SYNTHESISSRC_DEF"; REVISION="SYNTHESISSRC_REVISION"])
45 AC_ARG_WITH(syncml-engines,
46 AS_HELP_STRING([--with-syncml-engines=client|server|both],
47 [Determines which kind of support for SyncML is compiled and linked into SyncEvolution. Default is both. Currently has no effect.]),
48 [SYNCML_ENGINES="$withval"], SYNCML_ENGINES=both)
50 case $SYNCML_ENGINES in both|client) AC_DEFINE(ENABLE_SYNCML_CLIENT, 1, [SyncML client support available]);; esac
51 case $SYNCML_ENGINES in both|server) AC_DEFINE(ENABLE_SYNCML_SERVER, 1, [SyncML server support available]);; esac
52 case $SYNCML_ENGINES in both|server|client) true;; *) AC_ERROR([Invalid value for --with-syncml-engines: $SYNCML_ENGINES]);; esac
54 AC_ARG_WITH(synthesis-username,
55 AS_HELP_STRING([--with-synthesis-username=<svn username>],
56 [username to use when checking out --with-synthesis-src sources from Subversion, default 'guest']),
57 [USERNAME="$withval"], [USERNAME="guest"])
59 AC_ARG_WITH(synthesis-revision,
60 AS_HELP_STRING([--with-synthesis-revision=<git tag/branch/hash or Subversion revision>],
61 [Identifies which source revision to use from --with-synthesis-src repository, empty string stands for latest. Default for default --synthesis-src: SYNTHESISSRC_REVISION]),
62 [REVISION="$withval"])
65 AS_HELP_STRING([--enable-shared],
66 [build backends as dynamically loadable modules]),
67 enable_shared="$enableval", enable_shared="no")
70 AS_HELP_STRING([--enable-static],
71 [build backends also as static libraries]),
72 enable_static="$enableval", enable_static="no")
74 AC_ARG_ENABLE(unit-tests,
75 AS_HELP_STRING([--enable-unit-tests],
76 [enables tests embedded in the source code of the library (changes content of executable)]),
77 enable_unit_tests="$enableval", enable_unit_tests="no")
78 AC_ARG_ENABLE(integration-tests,
79 AS_HELP_STRING([--enable-integration-tests],
80 [enables tests outside of the library (can be used together with normal builds of the library)]),
81 enable_integration_tests="$enableval", enable_integration_tests="no")
83 AC_ARG_ENABLE(static-cxx,
84 AS_HELP_STRING([--enable-static-cxx],
85 [build executables which contain libstdc++ instead of requiring suitable libstdc++.so to run]),
86 enable_static_cxx="$enableval", enable_static_cxx="no")
88 AC_ARG_ENABLE(evolution-compatibility,
89 AS_HELP_STRING([--enable-evolution-compatibility],
90 [build executables which only call Evolution via dlopen/dlsym: this avoids all hard dependencies on EDS shared objects, but might lead to crashes when their ABI changes]),
91 enable_evolution_compatibility="$enableval", enable_evolution_compatibility="no")
93 AC_ARG_ENABLE(developer-mode,
94 AC_HELP_STRING([--enable-developer-mode],
95 [The dynamic loadble backend libraries is loaded from current build directory instead of the standard library path]),
96 enable_developer_mode="$enableval", enable_developer_mode="no")
99 # - wrap e_book_from_string() to fix invalid parameter
100 # - don't use UTF-8 encoding in Perl script
102 AS_HELP_STRING([--enable-maemo],
103 [enables some hacks which work around problems with the Maemo 2.0 until at least 3.0 EDS-Dbus]),
104 [AC_DEFINE(ENABLE_MAEMO, 1, [enable Maemo hacks])
106 MODIFY_SYNCCOMPARE='-e "s/use encoding/#use encoding/;" -e "s/:utf8//;"'])
107 AC_SUBST(MODIFY_SYNCCOMPARE)
109 AC_CHECK_HEADERS(signal.h dlfcn.h)
112 if test $enable_unit_tests == "yes" || test $enable_integration_tests == yes; then
113 CPPUNIT_CXXFLAGS=`cppunit-config --cflags` || AC_MSG_ERROR("cppunit-config --cflags failed - is it installed?")
114 CPPUNIT_LDFLAGS=`cppunit-config --libs` || AC_MSG_ERROR("cppunit-config --libs failed - is it installed?")
116 AC_SUBST(CPPUNIT_CXXFLAGS)
117 AC_SUBST(CPPUNIT_LDFLAGS)
119 if test "$enable_unit_tests" = "yes"; then
120 AC_DEFINE(ENABLE_UNIT_TESTS, 1, [enable unit tests inside the library's source code])
122 if test "$enable_integration_tests" = "yes"; then
123 AC_DEFINE(ENABLE_INTEGRATION_TESTS, 1, [enable integration tests inside the final library])
125 AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "$enable_unit_tests" = "yes"])
126 AM_CONDITIONAL([ENABLE_TESTING], [test "$enable_unit_tests" = "yes" || test "$enable_integration_tests" = "yes" ])
128 if test $enable_static_cxx == "yes"; then
130 CORE_LDADD_DEP=libstdc++.a
132 AC_SUBST(CORE_LDADD_DEP)
134 # Check for transport layer.
135 # Both curl and libsoup can be enabled and disabled explicitly.
136 # The default is to use libsoup if available, otherwise curl.
138 AC_MSG_CHECKING([for libcurl])
139 if LIBCURL_LIBS=`sh -c 'curl-config --libs' 2>&AS_MESSAGE_LOG_FD` && \
140 LIBCURL_CFLAGS=`sh -c 'curl-config --cflags' 2>&AS_MESSAGE_LOG_FD`; then
148 PKG_CHECK_MODULES(LIBSOUP, libsoup-gnome-2.4,
150 AC_DEFINE(HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H, 1, [enable GNOME specific libsoup])],
151 [PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4,
155 PKG_CHECK_MODULES(LIBOPENOBEX, openobex, have_obex="yes", have_obex="no")
157 if test $have_obex = "yes"; then
158 PKG_CHECK_MODULES(BLUEZ, bluez, have_bluez="yes", have_bluez="no")
159 if test $have_bluez = "yes"; then
163 AC_SUBST(LIBOPENOBEX_CFLAGS)
164 AC_SUBST(LIBOPENOBEX_LIBS)
165 AC_SUBST(BLUEZ_CFLAGS)
172 AC_ARG_WITH(ca-certificates,
173 AS_HELP_STRING([--with-ca-certificates=<colon separated list of files>],
174 [Specifies location of one or more CA certificate files.
175 This sets the default value for the SSLServerCertificates option.
176 Default: empty when using libcurl (because it has its own default),
177 a list of paths known to work for Debian and Red Hat otherwise.]),
178 [CA_CERTIFICATES="$withval"])
181 # choose default http transport (mirrors code in EvolutionSyncClient::createTransportAgent())
182 if test "$have_libsoup" = "yes"; then
183 default_http_transport="libsoup"
184 elif test "$have_libcurl" = "yes"; then
185 default_http_transport="libcurl"
188 AC_ARG_ENABLE(libcurl,
189 AC_HELP_STRING([--enable-libcurl],
190 [enable libcurl as transport layer]),
191 [ if test "$enableval" = "yes"; then
192 test "$have_libcurl" = "yes" || AC_MSG_ERROR([libcurl not found])
193 TRANSPORT="$TRANSPORT libcurl"
194 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBCURL_LIBS"
195 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBCURL_CFLAGS"
196 AC_DEFINE(ENABLE_LIBCURL, 1, [enable libcurl transport])
198 libcurl_disabled="yes"
200 [ if test "$have_libcurl" = "yes" && test "$default_http_transport" = "libcurl" ; then
201 TRANSPORT="$TRANSPORT libcurl"
202 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBCURL_LIBS"
203 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBCURL_CFLAGS"
204 AC_DEFINE(ENABLE_LIBCURL, 1, [enable libcurl transport])
207 AC_ARG_ENABLE(libsoup,
208 AC_HELP_STRING([--enable-libsoup],
209 [enable libsoup as transport layer]),
210 [ if test "$enableval" = "yes"; then
211 test "$have_libsoup" = "yes" || AC_MSG_ERROR([libsoup not found])
212 TRANSPORT="$TRANSPORT libsoup"
213 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBSOUP_LIBS"
214 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBSOUP_CFLAGS"
215 AC_DEFINE(ENABLE_LIBSOUP, 1, [enable libsoup transport])
217 libsoup_disabled="yes"
219 [ if test "$have_libsoup" = "yes" && test "$default_http_transport" = "libsoup"; then
220 TRANSPORT="$TRANSPORT libsoup"
221 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBSOUP_LIBS"
222 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBSOUP_CFLAGS"
223 AC_DEFINE(ENABLE_LIBSOUP, 1, [enable libsoup transport])
226 # SoupTransportAgent depends on glib
227 case "$TRANSPORT" in *libsoup*) need_glib=yes;; esac
229 bluetooth_disabled=no
230 AC_ARG_ENABLE(bluetooth,
231 AC_HELP_STRING([--enable-bluetooth],
232 [enable bluetooth transport support]),
233 [ enable_bluetooth="$enableval"
234 if test "$enableval" = "no"; then
235 bluetooth_disabled=yes
238 [ enable_bluetooth="$have_bluetooth" ])
240 if test "$enable_bluetooth" = "yes"; then
241 # currently we need Bluetooth and OBEX support
242 test "$have_bluetooth" = "yes" || AC_MSG_ERROR([openobex or bluez not found])
246 CFLAGS="$CPPFLAGS $BLUEZ_CFLAGS"
247 # test in this order:
248 # - recent libbluetooth (no _safe variant, base function has bufsize)
249 # - intermediate with _safe
250 # - else assume old-style (no bufsize, no _safe)
252 # The source code checks the signature both by via pointer assignment and calling
253 # it (better safe than sorry). One these should fail if the signature is not right.
254 AC_COMPILE_IFELSE([#include <bluetooth/sdp.h>
255 #include <bluetooth/sdp_lib.h>
256 sdp_record_t *(*extract_pdu)(const uint8_t *pdata, int bufsize, int *scanned) =
259 uint8_t *pdata = NULL;
261 sdp_extract_pdu(pdata, 100, &scanned);
264 AC_DEFINE(HAVE_BLUEZ_BUFSIZE, 1, [base libbluetooth functions accept bufsize parameter]),
265 AC_COMPILE_IFELSE([#include <bluetooth/sdp.h>
266 #include <bluetooth/sdp_lib.h>
267 sdp_record_t *(*extract_pdu)(const uint8_t *pdata, int bufsize, int *scanned) =
268 sdp_extract_pdu_safe;
270 uint8_t *pdata = NULL;
272 sdp_extract_pdu_safe(pdata, 100, &scanned);
275 AC_DEFINE(HAVE_BLUEZ_SAFE, 1, [libbluetooth has _safe variants])))
278 if test "$have_obex" = "yes"; then
279 AC_DEFINE(ENABLE_OBEX, 1, [define if openobex library is available])
281 if test "$have_bluez" = "yes"; then
282 AC_DEFINE(ENABLE_BLUETOOTH, 1, [define if bluez library is available])
285 AM_CONDITIONAL([ENABLE_OBEX], [test "$have_obex" = "yes" && test "$enable_bluetooth" = "yes"])
286 AM_CONDITIONAL([ENABLE_BLUETOOTH], [test "$have_bluetooth" = "yes" && test "$enable_bluetooth" = "yes"])
288 if test ! "$TRANSPORT" &&
289 test "$libsoup_disabled" != "yes" &&
290 test "$libcurl_disabled" != "yes" &&
291 test "$bluetooth_disabled" != "yes" &&
292 test "$have_bluetooth" != "yes" ; then
293 AC_ERROR([no transport library found, configure with --disable-libcurl --disable-libsoup --disable-bluetooth to continue anyway (only useful if users of libsyncevolution provide transport implementation)])
296 # for libsoup we must specify the SSL certificate file outself
297 if test "$libsoup_disabled" != "yes" && test -z "$CA_CERTIFICATES"; then
298 # Debian and Red Hat paths
299 CA_CERTIFICATES="/etc/ssl/certs/ca-certificates.crt:/etc/pki/tls/certs/ca-bundle.crt:/usr/share/ssl/certs/ca-bundle.crt"
301 AC_DEFINE_UNQUOTED(SYNCEVOLUTION_SSL_SERVER_CERTIFICATES, "$CA_CERTIFICATES", [default value for SSLServerCertificates option])
303 AC_SUBST(TRANSPORT_LIBS)
304 AC_SUBST(TRANSPORT_CFLAGS)
306 AC_ARG_ENABLE(ssl-certificate-check,
307 AC_HELP_STRING([--disable-ssl-certificate-check],
308 [Disable SSL certificate checking in all server
309 *templates*. Users can still choose to enable or
310 disable it in their configuration. This is necessary on
311 platforms where the transport library has problems
312 verifying the server's certificate (libsoup + Google,
313 http://bugzilla.moblin.org/show_bug.cgi?id=4551)]),
314 enable_ssl_certificate_check="$enableval",
315 enable_ssl_certificate_check="yes")
316 if test "$enable_ssl_certificate_check" = "yes"; then
317 AC_DEFINE(ENABLE_SSL_CERTIFICATE_CHECK, 1, [enable SSL certificate check in server templates])
320 # for dbus interface file mangling
321 AC_PATH_PROG(XSLT, xsltproc)
324 AS_HELP_STRING([--enable-gui[=gui type]],
325 [enables building the GTK+ UI that uses the SyncEvolution DBus API.
326 Options: gtk, moblin, all (builds sync-ui-gtk and sync-ui-moblin)
327 "gtk" is the default for --enable-gui without type. No GUI is
328 built when --enable-gui is not used.]),
329 [ if test "$enableval" = "gtk" ; then
331 elif test "$enableval" = "yes" ; then
333 elif test "$enableval" = "moblin" ; then
335 elif test "$enableval" = "no" ; then
337 elif test "$enableval" = "all" ; then
340 AC_ERROR([Unknown gui type: '$enableval'])
345 AM_CONDITIONAL([COND_GUI], [test "$enable_gui" != "no"])
348 AS_HELP_STRING([--enable-core],
349 [enables building the core SyncEvolution (library, backends)]),
350 enable_core="$enableval",
352 AM_CONDITIONAL([COND_CORE], [test "$enable_core" = "yes"])
354 AC_ARG_ENABLE(dbus-service,
355 AS_HELP_STRING([--enable-dbus-service],
356 [enables building the dbus service executable and all related features
357 (the DBus wrapper library, command line usage of server, etc).]),
358 enable_dbus_service="$enableval",
359 [if test $enable_gui == "no"; then
360 enable_dbus_service="no"
362 enable_dbus_service="yes"
364 AM_CONDITIONAL([COND_DBUS], [test "$enable_dbus_service" = "yes"])
366 PKG_CHECK_MODULES(KEYRING, [gnome-keyring-1], HAVE_KEYRING=yes, HAVE_KEYRING=no)
367 AC_ARG_ENABLE(gnome-keyring,
368 AS_HELP_STRING([--enable-gnome-keyring],
369 [enables or disables support for the GNOME keyring; default is on if development files are available]),
370 [enable_gnome_keyring="$enableval"
371 test "$enable_gnome_keyring" = "yes" || test "$enable_gnome_keyring" = "no" || AC_ERROR([invalid value for --enable-gnome-keyring: $enable_gnome_keyring])
372 test "$enable_gnome_keyring" = "no" || test "$HAVE_KEYRING" = "yes" || AC_ERROR([gnome-keyring-1 pkg not found, needed for --enable-gnome-keyring])],
373 enable_gnome_keyring="$HAVE_KEYRING")
374 if test $enable_gnome_keyring == "yes"; then
375 AC_DEFINE(USE_GNOME_KEYRING, 1, [define if gnome keyring should be used in dbus service])
376 PKG_CHECK_MODULES([KEYRING_2_20], [gnome-keyring-1 >= 2.20 ], KEYRING220=yes, KEYRING220=no)
377 if test $KEYRING220 == "yes"; then
378 AC_DEFINE(GNOME_KEYRING_220, 1, [define if gnome keyring version is above 2.20])
382 if test $enable_dbus_service == "yes"; then
383 if test -z "$XSLT"; then
384 AC_ERROR([xsltproc not found, is required for D-Bus service])
386 PKG_CHECK_MODULES(DBUS, dbus-1, dummy=yes,
387 AC_MSG_ERROR(libdbus-1 is required))
388 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
389 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
390 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
392 # Recent libnotify releases work with gtk+-2.0 and gtk+-3.0. We
393 # pick gtk+-2.0 here, to be compatible with old libnotify releases
394 # which had that hard-cored and because sync-ui also depends on
396 PKG_CHECK_MODULES(LIBNOTIFY, [libnotify gtk+-2.0], HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
397 AC_ARG_ENABLE(notify,
398 AS_HELP_STRING([--enable-notify],
399 [send notifications for automatic sync events]),
400 [ test "$enableval" = "no" || test $HAVE_LIBNOTIFY = "yes" || AC_ERROR([required libnotify package not found]) ],
401 [ test $HAVE_LIBNOTIFY = "yes" || AC_ERROR([required libnotify package not found, use --disable-notify to compile without notifications]) ])
402 if test $HAVE_LIBNOTIFY == "yes"; then
403 AC_DEFINE(HAS_NOTIFY, 1, [define if libnotify could be used in dbus service])
405 AC_DEFINE(DBUS_SERVICE, 1, [define if dbus service is enabled])
407 AC_SUBST(DBUS_CFLAGS)
409 AC_SUBST(DBUS_GLIB_CFLAGS)
410 AC_SUBST(DBUS_GLIB_LIBS)
411 AC_SUBST(KEYRING_CFLAGS)
412 AC_SUBST(KEYRING_LIBS)
413 AC_SUBST(LIBNOTIFY_CFLAGS)
414 AC_SUBST(LIBNOTIFY_LIBS)
417 DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
418 AC_SUBST(DBUS_SERVICES_DIR)
419 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Location of D-Bus services directory])
421 if test $enable_gui != "no" || test $enable_dbus_service == "yes"; then
422 IT_PROG_INTLTOOL([0.37.1])
423 GETTEXT_PACKAGE=syncevolution
424 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package name])
426 SYNCEVOLUTION_LOCALEDIR=[${datadir}/locale]
429 # decide which sync-ui(s) we are building:
430 # sync-ui (in either GTK or Moblin mode) or both (in separate binaries)
432 all) GUI_PROGRAMS='sync-ui-gtk${EXEEXT} sync-ui-moblin${EXEEXT}'; GUI_DESKTOP_FILES="sync-gtk.desktop sync-moblin.desktop";;
433 gtk|moblin) GUI_PROGRAMS='sync-ui${EXEEXT}'; GUI_DESKTOP_FILES="sync.desktop";;
434 no) GUI_PROGRAMS=; GUI_DESKTOP_FILES=;;
435 *) AC_ERROR([Unknown enable_gui type: '$enable_gui'])
438 if test $enable_gui != "no"; then
439 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 glib-2.0)
440 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
441 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
443 gui_modules="glib-2.0 dbus-glib-1 >= 0.60 gtk+-2.0 libglade-2.0 gio-2.0"
444 if test $enable_gui == "moblin"; then
445 AC_DEFINE(USE_MOBLIN_UX, 1, [Use Moblin UI widgets])
447 if test $enable_gui == "moblin" -o $enable_gui == "all"; then
448 gui_modules="$guimodules mx-gtk-1.0"
450 PKG_CHECK_MODULES(MX_GTK_0_99_1, mx-gtk-1.0 >= 0.99.1,
451 have_mx_gtk_0_99_1="yes",
452 have_mx_gtk_0_99_1="no")
453 if test $have_mx_gtk_0_99_1 == "yes"; then
454 AC_DEFINE(MX_GTK_0_99_1, 1, [we have Mx-Gtk 0.99.1 or better])
458 PKG_CHECK_MODULES(UNIQUE, unique-1.0,
461 if test $have_unique == "yes"; then
462 gui_modules="$gui_modules unique-1.0"
463 AC_DEFINE(ENABLE_UNIQUE, 1, [enable single-app-instance functionality])
466 PKG_CHECK_MODULES(GTK_2_18, gtk+-2.0 >= 2.18,
469 if test $have_gtk_2_18 == "yes"; then
470 AC_DEFINE(GTK_2_18, 1, [we have GTK+ 2.18 or better])
473 PKG_CHECK_MODULES(GUI, $gui_modules)
475 AC_PATH_PROG([GTK_BUILDER_CONV], gtk-builder-convert)
476 elif test "$enable_dbus_service" = "yes"; then
477 # syncevo-dbus-server needs localization
480 INTLTOOL_UPDATE="true"
483 AC_SUBST(SYNCEVOLUTION_LOCALEDIR)
484 AC_SUBST(GETTEXT_PACKAGE)
487 AC_SUBST(GUI_PROGRAMS)
488 AC_SUBST(GUI_DESKTOP_FILES)
491 # Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch
492 # doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available
493 # as Debian Etch backport.
496 # need rst2man for man pages
498 AS_HELP_STRING([--with-rst2man=<path to reStructuredText to man converter>],
499 [Specifies an explicit path to the utility if not found in PATH.
500 An explicit --without-rst2man or not having it installed turn off
501 building of man pages.]),
503 if test "$RST2MAN" == "yes"; then
504 AC_PATH_PROG(RST2MAN, rst2man, "no")
506 test "$RST2MAN" == "no" || test -x "$RST2MAN" || AC_ERROR([--with-rst2man=$RST2MAN: tool not found])],
507 [AC_PATH_PROG(RST2MAN, rst2man, "no")])
508 AM_CONDITIONAL([COND_MAN_PAGES], [test "$RST2MAN" != "no"])
510 # need rst2html for HTML version of README
511 AC_ARG_WITH(rst2html,
512 AS_HELP_STRING([--with-rst2html=<path to reStructuredText to HTML converter>],
513 [Specifies an explicit path to the utility if not found in PATH.
514 An explicit --without-rst2html or not having it installed turn off
515 building of README in HTML format.]),
517 if test "$RST2HTML" == "yes"; then
518 AC_PATH_PROG(RST2HTML, rst2html, "no")
520 test "$RST2HTML" == "no" || test -x "$RST2HTML" || AC_ERROR([--with-rst2html=$RST2HTML: tool not found])],
521 [AC_PATH_PROG(RST2HTML, rst2html, "no")])
522 AM_CONDITIONAL([COND_HTML_README], [test "$RST2HTML" != "no"])
524 # absolute patch to source of Synthesis client library
525 SYNTHESIS_SRC=no-synthesis-source
526 AC_SUBST(SYNTHESIS_SRC)
527 if test "$SYNTHESISSRC" && test "$SYNTHESISSRC" != "none"; then
528 # default: checkout a copy of the sources, remove it during maintainer-clean and distclean
529 CLEAN_CLIENT_SRC=synthesis-workdir
530 SYNTHESIS_SRC=$PWD/src/synthesis-workdir
532 AC_MSG_NOTICE( [updating the content of $SYNTHESIS_SRC from $SYNTHESISSRC] )
533 case "$SYNTHESISSRC" in
534 *.git) protocol=git;;
535 *://*) protocol="`echo $SYNTHESISSRC | sed -e 's;://.*;;'`";;
542 # use existing copy of the sources
544 case "$SYNTHESISSRC" in
545 /*) SYNTHESIS_SRC="$SYNTHESISSRC";;
546 *) SYNTHESIS_SRC="$PWD/$SYNTHESISSRC";;
550 SYNTHESISSRCREV="$SYNTHESISSRC"
551 if test "$REVISION"; then
552 revarg="-r $REVISION "
553 if `echo $SYNTHESISSRC | grep '@[0123456789]*'` >/dev/null; then
556 SYNTHESISSRCREV="$SYNTHESISSRC@$REVISION"
559 if test -d $SYNTHESIS_SRC ; then
560 ( set -x; cd $SYNTHESIS_SRC && svn --username=$USERNAME switch $revarg "$SYNTHESISSRC" ) || AC_ERROR([updating from $SYNTHESISSRC failed])
562 (set -x; svn --username=$USERNAME checkout $revarg "$SYNTHESISSRCREV" $SYNTHESIS_SRC ) || AC_ERROR([checking out $SYNTHESISSRC failed])
566 if test -d $SYNTHESIS_SRC ; then
567 ( set -x; cd $SYNTHESIS_SRC && git fetch "$SYNTHESISSRC" ) || AC_ERROR([updating from $SYNTHESISSRC failed])
569 ( set -x; git clone "$SYNTHESISSRC" $SYNTHESIS_SRC ) || AC_ERROR([cloning $SYNTHESISSRC failed])
571 if test "$REVISION"; then
572 # git 1.6 finds tags and branches without explicit prefix, 1.4.4.4 doesn't
573 ( set -x; cd $SYNTHESIS_SRC &&
574 (git checkout "$REVISION" ||
575 git checkout "tags/$REVISION" ||
576 git checkout "origin/$REVISION") ) || AC_ERROR([checking out $SYNTHESISSRC failed])
580 elif test "$SYNTHESISSRC" != "none" && test -d $srcdir/src/synthesis; then
581 # use existing copy of the sources; beware of
582 # out-of-tree compilation
584 /*) SYNTHESIS_SRC="$srcdir/src/synthesis";;
585 *) SYNTHESIS_SRC="$PWD/$srcdir/src/synthesis";;
587 elif test "$enable_shared" = "no"; then
588 # link against engine
589 PKG_CHECK_MODULES(SYNTHESIS, "synthesis")
590 SYNTHESIS_ENGINE="$SYNTHESIS_LIBS -lsynthesis"
592 # link against SDK alone, except in client-test
593 #PKG_CHECK_MODULES(SYNTHESIS, "synthesis-sdk")
594 #SYNTHESIS_ENGINE="`echo $SYNTHESIS_LIBS | sed -e 's/-lsynthesisstubs/-lsynthesis/'`"
596 # can't use the SDK alone because of sysync::SySyncDebugPuts()
597 PKG_CHECK_MODULES(SYNTHESIS, "synthesis")
598 SYNTHESIS_ENGINE="$SYNTHESIS_LIBS"
601 if test $SYNTHESIS_SRC != "no-synthesis-source"; then
602 ( cd $SYNTHESIS_SRC && ( test -f configure || sh autogen.sh ) ) || AC_MSG_ERROR([--with-synthesis-src=$SYNTHESIS_SRC: no Synthesis configure script found in that directory])
604 SYNTHESIS_CONFIGURE="$SYNTHESIS_SRC/configure"
605 chmod u+x $SYNTHESIS_SRC/configure $SYNTHESIS_SRC/config.sub $SYNTHESIS_SRC/config.guess
607 # use local copy of the sources, with dependencies
608 # to trigger building the synthesis library
609 SYNTHESIS_SUBDIR=$PWD/src/build-synthesis
610 SYNTHESIS_CFLAGS="-I$SYNTHESIS_SUBDIR/src"
611 SYNTHESIS_LIBS="$SYNTHESIS_SUBDIR/src/libsynthesissdk.la"
613 if test "$enable_core" = "no" && test "$enable_gui" != "no"; then
614 # SYNTHESIS_SUBDIR is ignored, at least build headers for GUI
615 SYNTHESIS_SUBDIR_INCLUDES=synthesis-includes
618 if test "$enable_shared" = "no"; then
619 # link against the engines that were enabled
620 case $SYNCML_ENGINES in both|client|server) SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/src/libsynthesis.la";; esac
621 AC_DEFINE(ENABLE_SYNCML_LINKED, 1, [SyncML engines are linked directly])
623 # It would be nice if we could avoid linking against libsynthesis.la here.
624 # This doesn't work at the moment because sysync::SySyncDebugPuts()
625 # is called directly by the libsynthesissdk instead of going through
626 # the normal C function pointer lookup.
627 SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/src/libsynthesis.la"
629 SYNTHESIS_DEP=$SYNTHESIS_LIBS
631 # for linking client-test
632 SYNTHESIS_ENGINE="$SYNTHESIS_SUBDIR/src/libsynthesis.la"
634 AC_MSG_NOTICE( [configuring the Synthesis library] )
635 if (set -x; mkdir -p $SYNTHESIS_SUBDIR && cd $SYNTHESIS_SUBDIR && eval "\$SHELL \"\$SYNTHESIS_CONFIGURE\" $ac_configure_args \"--srcdir=\$SYNTHESIS_SRC\" " ); then true; else
636 AC_MSG_ERROR( [configuring Synthesis library failed] )
640 AC_SUBST(SYNTHESIS_CFLAGS)
641 AC_SUBST(SYNTHESIS_LIBS)
643 AC_SUBST(SYNTHESIS_SUBDIR)
644 AC_SUBST(SYNTHESIS_SUBDIR_INCLUDES)
645 AC_SUBST(SYNTHESIS_DEP)
646 AC_SUBST(SYNTHESIS_ENGINE)
647 AC_SUBST(SYNTHESIS_LIB)
648 AC_SUBST(SYNTHESISSRC)
653 # AC_ARG_ENABLE_BACKEND(BACKEND, DIR, HELP-STRING, [ACTION-IF-GIVEN],
654 # [ACTION-IF-NOT-GIVEN])
656 # Same as AC_ARG_ENABLE(), but also tells configure that the
659 # BACKEND = name of modules built in that dir as .la files without the
660 # obligatory sync prefix, e.g. "ebook"
661 # DIR = name of the directory inside src/backends, e.g., "evolution"
662 AC_DEFUN([AC_ARG_ENABLE_BACKEND],
664 AC_ARG_ENABLE($1, $3, $4, $5)
665 BACKENDS="$BACKENDS $1"
666 BACKEND_DEFINES="$BACKEND_DEFINES ENABLE_`echo $1 | tr a-z A-Z`"
668 SYNCSOURCES="$SYNCSOURCES backends/$2/sync$1.la"
671 AC_SUBST(SYNCSOURCES)
672 AC_SUBST(BACKEND_DEFINES)
674 BACKEND_CPPFLAGS="$SYNTHESIS_CFLAGS $EPACKAGE_CFLAGS $EBOOK_CFLAGS $ECAL_CFLAGS $GLIB_CFLAGS $BOOST_CPPFLAGS"
675 AC_SUBST(BACKEND_CPPFLAGS)
677 # GNOME Bluetooth Panel plugin
678 PKG_CHECK_MODULES(GNOMEBLUETOOTH, [gnome-bluetooth-1.0 >= 2.27.6],
680 GNOMEBLUETOOTH_DIR=`$PKG_CONFIG --variable=libdir gnome-bluetooth-1.0 2>/dev/null`/gnome-bluetooth],
682 AC_SUBST(GNOMEBLUETOOTH_CFLAGS)
683 AC_SUBST(GNOMEBLUETOOTH_DIR)
685 AC_ARG_ENABLE(gnome-bluetooth-panel-plugin,
686 AC_HELP_STRING([--enable-gnome-bluetooth-panel-plugin],
687 [GNOME Bluetooth panel plugin adding a "sync" button for paired devices (off by default)]),
688 [enable_gnome_bluetooth_panel="$enableval"],
689 [enable_gnome_bluetooth_panel="no"]
691 if test "$enable_gnome_bluetooth_panel" = "yes"; then
692 test "$have_gbt" = "yes" || AC_MSG_ERROR([--enable-gnome-bluetooth-panel requires
693 pkg-config information for gnome-bluetooth-1.0 >= 2.27.6 which was not found])
695 AC_CONFIG_FILES(src/gnome-bluetooth/Makefile)
696 AM_CONDITIONAL([ENABLE_GNOME_BLUETOOTH_PANEL], [test "$have_gbt" = "yes" && test "$enable_gnome_bluetooth_panel" = "yes"])
699 AC_HELP_STRING([--enable-doc],
700 [generate backend and DBus API documentation]),
701 enable_doc="$enableval", enable_doc="no")
703 AM_CONDITIONAL([COND_DOC], [test "$enable_doc" != "no"])
705 dnl src/backends/*/configure-sub.in and configure-post.in follow
706 # vvvvvvvvvvvvvv src/backends/addressbook/configure-sub.in vvvvvvvvvvvvvv
707 dnl -*- mode: Autoconf; -*-
708 dnl Invoke autogen.sh to produce a configure script.
710 dnl hard-coded settings for Mac OS X AddressBook
713 ADDRESSBOOK_LIBS="-framework AddressBook -framework CoreFoundation"
714 AC_SUBST(ADDRESSBOOK_CFLAGS)
715 AC_SUBST(ADDRESSBOOK_LIBS)
716 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $ADDRESSBOOK_CFLAGS"
718 AC_ARG_ENABLE_BACKEND(addressbook, addressbook,
719 AS_HELP_STRING([--enable-addressbook], [enable access to Mac OS X address book (default off)]),
720 [enable_addressbook="$enableval"], [enable_addressbook="no"])
722 if test "$enable_addressbook" = "yes"; then
723 AC_DEFINE(ENABLE_ADDRESSBOOK, 1, [addressbook available])
730 AC_CONFIG_FILES(src/backends/addressbook/Makefile)
731 # ^^^^^^^^^^^^^^ src/backends/addressbook/configure-sub.in ^^^^^^^^^^^^^^
733 # vvvvvvvvvvvvvv src/backends/evolution/configure-sub.in vvvvvvvvvvvvvv
734 dnl -*- mode: Autoconf; -*-
735 dnl Invoke autogen.sh to produce a configure script.
737 pkg_emodules_10="libedataserver-1.0"
738 pkg_emodules_11="libedataserver-1.1"
739 pkg_emodules_12="libedataserver-1.2"
740 pkg_ebook_10="libebook-1.0"
741 pkg_ebook_11="libebook-1.1"
742 pkg_ebook_12="libebook-1.2"
743 pkg_ecal_10="libecal-1.0"
744 pkg_ecal_11="libecal-1.1"
745 pkg_ecal_12="libecal-1.2"
748 Please install the development packages of Evolution and/or
749 set the PKG_CONFIG_PATH variable so that it points towards
750 the .pc files of libedataserver, libecal and libebook (the
751 latter two are optional).
753 You can check that these packages are available by running
754 pkg-config --list-all."
756 evomissing="No compatible evolution-data-server was found.
759 dnl check for Evolution core packages
760 PKG_CHECK_MODULES(EPACKAGE, [$pkg_emodules_12], EDSFOUND=yes, [EDSFOUND=no])
761 if test "x${EDSFOUND}" = "xno"; then
762 PKG_CHECK_MODULES(EPACKAGE, [$pkg_emodules_11], EDSFOUND=yes, [EDSFOUND=no])
763 if test "x${EDSFOUND}" = "xno"; then
764 PKG_CHECK_MODULES(EPACKAGE, [$pkg_emodules_10], EDSFOUND=yes, [EDSFOUND=no])
768 dnl check for Evolution calendar packages
769 PKG_CHECK_MODULES(ECAL, [$pkg_ecal_12], ECALFOUND=yes, [ECALFOUND=no])
770 if test "x${ECALFOUND}" = "xno"; then
771 PKG_CHECK_MODULES(ECAL, [$pkg_ecal_11], ECALFOUND=yes, [ECALFOUND=no])
772 if test "x${ECALFOUND}" = "xno"; then
773 PKG_CHECK_MODULES(ECAL, [$pkg_ecal_10], ECALFOUND=yes, [ECALFOUND=no])
777 dnl check for Evolution contact packages
778 PKG_CHECK_MODULES(EBOOK, [$pkg_ebook_12], EBOOKFOUND=yes, [EBOOKFOUND=no])
779 if test "x${EBOOKFOUND}" = "xno"; then
780 PKG_CHECK_MODULES(EBOOK, [$pkg_ebook_11], EBOOKFOUND=yes, [EBOOKFOUND=no])
781 if test "x${EBOOKFOUND}" = "xno"; then
782 PKG_CHECK_MODULES(EBOOK, [$pkg_ebook_10], EBOOKFOUND=yes, [EBOOKFOUND=no])
786 AC_ARG_ENABLE_BACKEND(ebook, evolution,
787 AS_HELP_STRING([--disable-ebook], [disable access to Evolution addressbooks (must be used to compile without it)]),
788 [enable_ebook="$enableval"],
789 [test "$EBOOKFOUND" = "yes" && enable_ebook="yes" ||
790 AC_MSG_ERROR([libebook not found. Use --disable-ebook to compile without or install the necessary development files.])])
791 AC_ARG_ENABLE_BACKEND(ecal, evolution,
792 AS_HELP_STRING([--disable-ecal], [disable access to Evolution calendars and tasks (must be used to compile without it)]),
793 [enable_ecal="$enableval"],
794 [test "$ECALFOUND" = "yes" && enable_ecal="yes" ||
795 AC_MSG_ERROR([libecal not found. Use --disable-ecal to compile without or install the necessary development files.])])
798 if test "$enable_ebook" = "yes"; then
799 test "x${EBOOKFOUND}" == "xyes" || AC_MSG_ERROR([--enable-ebook requires pkg-config information for libebook, which was not found])
800 AC_DEFINE(ENABLE_EBOOK, 1, [libebook available])
807 AM_CONDITIONAL([ENABLE_ECAL], [test "$enable_ecal" == "yes"])
808 if test "$enable_ecal" = "yes"; then
809 test "x${ECALFOUND}" == "xyes" || AC_MSG_ERROR([--enable-ecal requires pkg-config information for libecal, which was not found"])
810 AC_DEFINE(ENABLE_ECAL, 1, [libecal available])
817 PKG_CHECK_MODULES(LIBICAL_AVAILABLE,
819 AC_DEFINE(HAVE_LIBICAL_R, 1, [have recent enough libical with _r variants]),
822 if test "$enable_evo" = "yes"; then
824 if test "$EDSFOUND" = "yes"; then
825 AC_DEFINE(HAVE_EDS, 1, [evolution-dataserver available])
827 AC_MSG_ERROR($evomissing)
834 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $EPACKAGE_CFLAGS $ECAL_CFLAGS $EBOOK_CFLAGS"
835 AC_CONFIG_FILES(src/backends/evolution/Makefile)
836 # ^^^^^^^^^^^^^^ src/backends/evolution/configure-sub.in ^^^^^^^^^^^^^^
838 # vvvvvvvvvvvvvv src/backends/file/configure-sub.in vvvvvvvvvvvvvv
839 dnl -*- mode: Autoconf; -*-
840 dnl Invoke autogen.sh to produce a configure script.
842 dnl Checks for required libraris can go here; none required for simple files.
844 dnl This is from the sqlite backend:
845 dnl PKG_CHECK_MODULES(SQLITE, sqlite3, SQLITEFOUND=yes, [SQLITEFOUND=no])
846 dnl AC_SUBST(SQLITE_CFLAGS)
847 dnl AC_SUBST(SQLITE_LIBS)
851 AC_SUBST(FILE_CFLAGS)
854 dnl If additional compile flags are necessary to include the header
855 dnl files of the backend, then add them here.
856 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $FILE_CFLAGS"
858 dnl name of backend library (there could be more than one per directory),
859 dnl name of the directory,
861 dnl --enable/disable chosen explicitly
862 dnl default, may depend on availability of prerequisites in more complex backends
863 AC_ARG_ENABLE_BACKEND(file,
865 AS_HELP_STRING([--disable-file],
866 [disable file-based backend which stores items in separate files in a fixed directory (default on)]),
867 [enable_file="$enableval"],
871 if test "$enable_file" = "yes"; then
872 dnl It's good to check the prerequisites here, in case --enable-file was used.
873 dnl test "x${SQLITEFOUND}" == "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
874 AC_DEFINE(ENABLE_FILE, 1, [file available])
876 AC_CONFIG_FILES(src/backends/file/Makefile)
877 # ^^^^^^^^^^^^^^ src/backends/file/configure-sub.in ^^^^^^^^^^^^^^
879 # vvvvvvvvvvvvvv src/backends/kcalextended/configure-sub.in vvvvvvvvvvvvvv
880 dnl -*- mode: Autoconf; -*-
881 dnl Invoke autogen.sh to produce a configure script.
883 # BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS ..."
885 AC_ARG_ENABLE_BACKEND(kcalextended,
887 AS_HELP_STRING([--enable-kcalextended],
888 [enable support for Maemo's KCalExtended storage]),
889 [enable_kcalextended="$enableval"],
890 [enable_kcalextended="no"]
893 if test "$enable_kcalextended" = "yes"; then
894 AC_DEFINE(ENABLE_KCALEXTENDED, 1, [KCalExtended available])
895 PKG_CHECK_MODULES(KCALEXTENDED, libmkcal libkcalcoren)
897 AC_CONFIG_FILES(src/backends/kcalextended/Makefile)
898 # ^^^^^^^^^^^^^^ src/backends/kcalextended/configure-sub.in ^^^^^^^^^^^^^^
900 # vvvvvvvvvvvvvv src/backends/maemo/configure-sub.in vvvvvvvvvvvvvv
901 dnl -*- mode: Autoconf; -*-
902 dnl Invoke autogen.sh to produce a configure script.
904 dnl Check for calendar-backend
905 PKG_CHECK_MODULES(MCALB, calendar-backend, MCALBFOUND=yes, [MCALBFOUND=no])
906 AC_SUBST(MCALB_CFLAGS)
908 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $MCALB_CFLAGS"
910 AC_ARG_ENABLE_BACKEND(maemocal, maemo,
911 AS_HELP_STRING([--enable-maemo-calendar],
912 [enable access to PIM data stored in Maemo 5 calendar application (default off)]),
913 [enable_maemocal="$enableval"], [enable_maemocal="no"])
915 if test "$enable_maemocal" = "yes"; then
916 test "x${MCALBFOUND}" == "xyes" || AC_MSG_ERROR([--enable-maemo-calendar requires pkg-config information for calendar-backend, which was not found])
917 AC_DEFINE(ENABLE_MAEMO_CALENDAR, 1, [Maemo 5 calendar available])
919 AC_CONFIG_FILES(src/backends/maemo/Makefile)
920 # ^^^^^^^^^^^^^^ src/backends/maemo/configure-sub.in ^^^^^^^^^^^^^^
922 # vvvvvvvvvvvvvv src/backends/qtcontacts/configure-sub.in vvvvvvvvvvvvvv
923 dnl -*- mode: Autoconf; -*-
924 dnl Invoke autogen.sh to produce a configure script.
926 # BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS ..."
928 AC_ARG_ENABLE_BACKEND(qtcontacts,
930 AS_HELP_STRING([--enable-qtcontacts],
931 [enable support for QtMobility's QtContacts storage]),
932 [enable_qtcontacts="$enableval"],
933 [enable_qtcontacts="no"]
936 if test "$enable_qtcontacts" = "yes"; then
937 AC_DEFINE(ENABLE_QTCONTACTS, 1, [QtContacts available])
938 # AC_WITH_QT() will be called in configure-post if need_qt_modules is not empty,
939 # setting QT_* flags.
940 qt_config="$qt_config +mobility"
942 MOBILITY += contacts versit"
944 AC_SUBST(QT_CONTACTS_LIBS)
945 AC_CONFIG_FILES(src/backends/qtcontacts/Makefile)
946 # ^^^^^^^^^^^^^^ src/backends/qtcontacts/configure-sub.in ^^^^^^^^^^^^^^
948 # vvvvvvvvvvvvvv src/backends/sqlite/configure-sub.in vvvvvvvvvvvvvv
949 dnl -*- mode: Autoconf; -*-
950 dnl Invoke autogen.sh to produce a configure script.
953 PKG_CHECK_MODULES(SQLITE, sqlite3, SQLITEFOUND=yes, [SQLITEFOUND=no])
954 AC_SUBST(SQLITE_CFLAGS)
955 AC_SUBST(SQLITE_LIBS)
956 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $SQLITE_CFLAGS"
958 AC_ARG_ENABLE_BACKEND(sqlite, sqlite,
959 AS_HELP_STRING([--enable-sqlite], [enable access to PIM data stored in SQLite files (experimental, default off)]),
960 [enable_sqlite="$enableval"], [enable_sqlite="no"])
962 if test "$enable_sqlite" = "yes"; then
963 test "x${SQLITEFOUND}" == "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
964 AC_DEFINE(ENABLE_SQLITE, 1, [sqlite available])
966 # avoid linking against it if not needed
970 AC_CONFIG_FILES(src/backends/sqlite/Makefile)
971 # ^^^^^^^^^^^^^^ src/backends/sqlite/configure-sub.in ^^^^^^^^^^^^^^
973 # vvvvvvvvvvvvvv src/backends/xmlrpc/configure-sub.in vvvvvvvvvvvvvv
974 dnl -*- mode: Autoconf; -*-
975 dnl Invoke autogen.sh to produce a configure script.
977 dnl Checks for required libraries.
979 dnl This is from the sqlite backend:
980 dnl PKG_CHECK_MODULES(SQLITE, sqlite3, SQLITEFOUND=yes, [SQLITEFOUND=no])
981 dnl AC_SUBST(SQLITE_CFLAGS)
982 dnl AC_SUBST(SQLITE_LIBS)
984 dnl No pkg-config available for xmlrpc-c
985 dnl PKG_CHECK_MODULES(XMLRPC,xmlrpc-c,XMLRPCFOUND=yes, [XMLRPCFOUND=no])
987 dnl name of backend library (there could be more than one per directory),
988 dnl name of the directory,
990 dnl --enable/disable chosen explicitly
991 dnl default, may depend on availability of prerequisites in more complex backends
992 AC_ARG_ENABLE_BACKEND(xmlrpc,
994 AS_HELP_STRING([--enable-xmlrpc],
995 [enable XMLRPC-based backend which stores items on a central web service (default off)]),
996 [enable_xmlrpc="$enableval"],
1000 if test "$enable_xmlrpc" = "yes"; then
1001 dnl It's good to check the prerequisites here, in case --enable-xmlrpc was used.
1002 dnl test "x${SQLITEFOUND}" == "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
1004 test -e /usr/bin/xmlrpc-c-config || AC_MSG_ERROR([--enable-xmlrpc requires xmlrpc-c-config, which was not found])
1006 XMLRPC_CFLAGS=`/usr/bin/xmlrpc-c-config c++2 client --cflags`
1007 XMLRPC_LIBS=`/usr/bin/xmlrpc-c-config c++2 client --libs`
1008 AC_SUBST(XMLRPC_CFLAGS)
1009 AC_SUBST(XMLRPC_LIBS)
1011 dnl If additional compile flags are necessary to include the header
1012 dnl files of the backend, then add them here.
1013 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $XMLRPC_CFLAGS"
1015 AC_DEFINE(ENABLE_XMLRPC, 1, [XMLRPC available])
1017 AC_CONFIG_FILES(src/backends/xmlrpc/Makefile)
1018 # ^^^^^^^^^^^^^^ src/backends/xmlrpc/configure-sub.in ^^^^^^^^^^^^^^
1020 dnl -*- mode: Autoconf; -*-
1021 dnl Invoke autogen.sh to produce a configure script.
1022 dnl configure-pre.in and src/backends/*/configure-sub.in and configure-post.in come before this part
1024 AC_SUBST(BACKEND_CPPFLAGS)
1027 backend_is_enabled () {
1028 eval echo \${enable_${1}}
1030 for backend in $BACKENDS; do
1031 if test `backend_is_enabled $backend` == "yes"; then
1033 SYNCEVOLUTION_MODULES="$SYNCEVOLUTION_MODULES src/backends/sync${backend}.la"
1037 if test "$enable_any" = "no"; then
1038 AC_MSG_ERROR([no backend enabled - refusing to continue: $anymissing])
1041 dnl check for programs.
1046 dnl glib initialization is done only if requested by some configure-sub.in,
1047 dnl for not needed otherwise even if found
1048 if test "$need_glib" = "yes"; then
1049 # HAVE_GLIB (aka GLIBFOUND) are a catch-all for these
1050 # three GNOME libs. Assume we have all three unless one of
1054 dnl check for glib - calling g_type_init() is expected on Maemo
1055 PKG_CHECK_MODULES(GLIB, "glib-2.0", , GLIBFOUND=no)
1056 # This check here is broken on Ubuntu 8.04: it calls glib-config,
1057 # which isn't found, but the error is not detected by configure.
1058 #if test "x${GLIBFOUND}" = "xno"; then
1059 # PKG_CHECK_MODULES(GLIB, "glib", GLIBFOUND=yes, GLIBFOUND=no)
1062 PKG_CHECK_MODULES(GTHREAD, "gthread-2.0", , GLIBFOUND=no)
1063 PKG_CHECK_MODULES(GOBJECT, "gobject-2.0", , GLIBFOUND=no)
1065 if test "x${GLIBFOUND}" = "xyes"; then
1066 AC_DEFINE(HAVE_GLIB, 1, [glib found])
1068 AC_ERROR([not all GNOME libraries found])
1070 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
1073 # Check for Qt if some backend needs it.
1074 if test "$need_qt_modules"; then
1075 AT_WITH_QT([-gui $need_qt_modules],
1080 # determine from where we can get a SHA-256 implementation
1082 if test "$GLIBFOUND" = "yes"; then
1083 # only use glib if we need it anyway, also has to be at lease 2.16
1084 PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
1085 [AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
1089 if test "$have_sha" = "no"; then
1090 # Fallback is Mozilla NSS. In contrast to libgcrypt it has a .pc
1091 # file and a simple API.
1092 PKG_CHECK_MODULES(NSS, "nss",
1093 [AC_DEFINE(USE_SHA256, 2, [choose implementation of SHA-256])
1098 dnl figure out whether we link all code statically or as modules
1099 AM_CONDITIONAL([ENABLE_MODULES], [test "$enable_shared" == "yes"])
1100 if test "$enable_shared" == "yes"; then
1101 AC_DEFINE(ENABLE_MODULES, 1, [enable dynamically opening sync source backends])
1103 AC_SUBST(SYNCEVOLUTION_LDADD)
1105 dnl CXXFLAGS gets applied to SyncEvolution and the client library.
1106 dnl For e.g. "-Wall -Werror" this might not be such a good idea;
1107 dnl SYNCEVOLUTION_CXXFLAGS can be used instead. It applies only
1108 dnl to the sources in the SyncEvolution repository.
1109 AC_SUBST(SYNCEVOLUTION_CXXFLAGS)
1111 dnl a quick-and-dirty way to detect compilation for the iPhone
1112 if test "$host" == "arm-apple-darwin"; then
1113 AC_DEFINE(IPHONE, 1, [compiling for iPhone])
1117 dnl --enable-evolution-compatibility
1118 if test "$enable_evolution_compatibility" == "yes"; then
1119 AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
1121 AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" == "yes"])
1123 dnl --enable-developer-mode
1124 if test "$enable_developer_mode" == "yes"; then
1125 backendsearchdir="`pwd`/src/backends/"
1127 backendsearchdir='$(libdir)'/syncevolution/backends/
1130 backenddir='$(libdir)'/syncevolution/backends
1131 AC_SUBST(backenddir)
1132 AC_SUBST(backendsearchdir)
1134 dnl This string is sent as part of the SyncML DevInf (device
1135 dnl information) structure to the server. All SyncEvolution platforms
1136 dnl use "SyncEvolution" as HTTP user agent and "Mod" (model), so the
1137 dnl device type is the only way how different kinds of clients can be
1139 AC_DEFINE_UNQUOTED(DEVICE_TYPE, "$DEVICE_TYPE", "SyncML DevInf DevType")
1141 AC_CHECK_HEADERS(stdarg.h valgrind/valgrind.h execinfo.h)
1143 AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")
1145 # fallback for lack of --with-docdir support in older automake
1146 if test ! "$docdir"; then
1147 docdir = ${datadir}/doc/syncevolution
1151 AC_ARG_ENABLE(dbus-timeout-hack,
1152 AS_HELP_STRING([--enable-dbus-timeout-hack],
1153 [Enables code which overrides the default timeout in dbus_connection_send_with_reply() so that the method call never times out. Needed for libecal/ebook >= 2.30, so enabled by default if either of these is enabled.]),
1154 [enable_dbus_timeout_hack=$enableval],
1155 [if test $enable_ebook = "yes" || test $enable_ecal = "yes"; then
1156 enable_dbus_timeout_hack="yes"
1158 if test $enable_dbus_timeout_hack = "yes"; then
1159 AC_DEFINE(ENABLE_DBUS_TIMEOUT_HACK, 1, [overrides the default D-Bus timeout so that synchronous calls never time out])
1162 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)
1166 echo CONFIGURATION SUMMARY
1167 echo "Core SyncEvolution: $enable_core"
1168 for backend in $BACKENDS; do
1169 eval echo $backend: \${enable_${backend}}
1171 echo "DBus service: $enable_dbus_service"
1172 echo "GNOME keyring: $enable_gnome_keyring"
1173 echo "UI (DBus client): $enable_gui"
1174 echo "Bluetooth transport: $have_bluetooth"
1175 echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
1176 echo "SHA-256: $have_sha"
1177 echo "API documentation: $enable_doc"
1178 echo "D-Bus Timeout Hack: $enable_dbus_timeout_hack"