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], [m4_esyscmd([build/gen-git-version.sh 1.3.99.5])])
12 # STABLE_VERSION=1.0.1+
13 AC_SUBST(STABLE_VERSION)
15 # Generate some files.
19 # Default value for --enable/disable-release-mode.
20 # Determined by gen-autotools.sh based on versioning.
21 # Official, stable releases enable it, pre-releases
24 SE_CHECK_FOR_STABLE_RELEASE
26 # Minimum version of libsynthesis as defined in its
27 # configure script and thus .pc files:
28 define([SYNTHESIS_MIN_VERSION], [3.4.0.16.11])
30 # Line above is patched by gen-autotools.sh. Handle
31 # both "yes" and "no".
32 m4_define([STABLE_RELEASE_HELP], m4_if(STABLE_RELEASE,[yes],[--disable-release-mode],[--enable-release-mode]))
34 AC_ARG_ENABLE(release-mode,
35 AS_HELP_STRING([STABLE_RELEASE_HELP],
36 [Controls whether resulting binary is for end-users or
37 testers/developers. For example, stable releases automatically
38 migrate on-disk files without asking, whereas other releases
39 ask before making downgrades impossible (or difficult).
40 Default in this source code is
41 "stable release: STABLE_RELEASE"]),
42 enable_release_mode="$enableval", enable_release_mode="STABLE_RELEASE")
43 if test "$enable_release_mode" = "yes"; then
44 AC_DEFINE(SYNCEVOLUTION_STABLE_RELEASE, 1, [binary is meant for end-users])
47 AM_INIT_AUTOMAKE([1.11.1 tar-ustar silent-rules subdir-objects -Wno-portability])
51 AM_MAINTAINER_MODE([enable]) # needed for nightly builds where reconfiguration fails under certain chroots
52 AC_CONFIG_MACRO_DIR([m4])
53 define([SYNTHESISSRC_REPO], [])
54 dnl Specify git revisions/branches without prefix, i.e., without 'origin'.
55 dnl We'll sort that out below.
56 define([SYNTHESISSRC_REVISION], [syncevolution-0.9])
57 AC_CONFIG_HEADERS(config.h)
61 dnl check for programs.
65 # Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch
66 # doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available
67 # as Debian Etch backport.
70 # TODO: Fix code to pass with -pedantic -Wextra.
71 # -Wno-unknown-pragmas needed because icalstrdup.h
72 # currently uses the "#pragma }" trick. Should remove that.
73 # Fix code to work without deprecated methods: G GDK GDK_PIXBUF CAIRO PANGO GTK
74 DK_ARG_ENABLE_WARNINGS([SYNCEVO_WFLAGS],
75 [-Wall -Wno-unknown-pragmas -Wno-deprecated-declarations],
76 [-Wall -Wno-unknown-pragmas -Wno-deprecated-declarations],
79 dnl default device type (see AC_DEFINE below)
80 DEVICE_TYPE=workstation
82 AC_ARG_WITH(synthesis-src,
83 AS_HELP_STRING([--with-synthesis-src=<base directory|svn URL|git URL>],
84 [Specifies location of the Synthesis root directory.
85 Use this when the Synthesis library is to
86 be compiled as part of the SyncEvolution compilation. In release
87 versions of SyncEvolution, a copy of the Synthesis code is bundled
88 under 'src/synthesis' and compiled unless something else is
89 specified. --with-synthesis-src can be given a path to sources
90 checked out already, a Subversion repository URL or a git repository
91 URL. When given a repository URL, then the configure script
92 will checkout the sources into 'src/synthesis-workdir' or
93 update that working copy if the directory already exists.
94 Default: bundled source in src/synthesis (in released SyncEvolution sources),
95 SYNTHESISSRC_REPO otherwise.]),
96 [SYNTHESISSRC="$withval"
97 test "$SYNTHESISSRC" != "yes" || AC_MSG_ERROR([--with-synthesis-src requires a parameter (base directory, svn URL or git URL)])],
98 [SYNTHESISSRC="$SYNTHESISSRC_DEF"; REVISION="SYNTHESISSRC_REVISION"])
100 AC_ARG_WITH(syncml-engines,
101 AS_HELP_STRING([--with-syncml-engines=client|server|both],
102 [Determines which kind of support for SyncML is compiled and linked into SyncEvolution. Default is both. Currently has no effect.]),
103 [SYNCML_ENGINES="$withval"], SYNCML_ENGINES=both)
105 case $SYNCML_ENGINES in both|client) AC_DEFINE(ENABLE_SYNCML_CLIENT, 1, [SyncML client support available]);; esac
106 case $SYNCML_ENGINES in both|server) AC_DEFINE(ENABLE_SYNCML_SERVER, 1, [SyncML server support available]);; esac
107 case $SYNCML_ENGINES in both|server|client) true;; *) AC_MSG_ERROR([Invalid value for --with-syncml-engines: $SYNCML_ENGINES]);; esac
109 AC_ARG_WITH(synthesis-username,
110 AS_HELP_STRING([--with-synthesis-username=<svn username>],
111 [username to use when checking out --with-synthesis-src sources from Subversion, default 'guest']),
112 [USERNAME="$withval"], [USERNAME="guest"])
114 AC_ARG_WITH(synthesis-revision,
115 AS_HELP_STRING([--with-synthesis-revision=<git tag/branch/hash or Subversion revision>],
116 [Identifies which source revision to use from --with-synthesis-src repository, empty string stands for latest. Default for default --synthesis-src: SYNTHESISSRC_REVISION]),
117 [REVISION="$withval"])
119 AC_ARG_ENABLE(shared,
120 AS_HELP_STRING([--enable-shared],
121 [build backends as dynamically loadable modules]),
122 enable_shared="$enableval", enable_shared="no")
124 AC_ARG_ENABLE(static,
125 AS_HELP_STRING([--enable-static],
126 [build backends also as static libraries]),
127 enable_static="$enableval", enable_static="no")
129 AC_ARG_ENABLE(unit-tests,
130 AS_HELP_STRING([--enable-unit-tests],
131 [enables tests embedded in the source code of the library (changes content of executable)]),
132 enable_unit_tests="$enableval", enable_unit_tests="no")
133 AC_ARG_ENABLE(integration-tests,
134 AS_HELP_STRING([--enable-integration-tests],
135 [enables tests outside of the library (can be used together with normal builds of the library)]),
136 enable_integration_tests="$enableval", enable_integration_tests="no")
138 AC_ARG_ENABLE(static-cxx,
139 AS_HELP_STRING([--enable-static-cxx],
140 [build executables which contain libstdc++ instead of requiring suitable libstdc++.so to run]),
141 enable_static_cxx="$enableval", enable_static_cxx="no")
143 AC_ARG_ENABLE(evolution-compatibility,
144 AS_HELP_STRING([--enable-evolution-compatibility],
145 [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]),
146 enable_evolution_compatibility="$enableval", enable_evolution_compatibility="no")
148 AC_ARG_ENABLE(developer-mode,
149 AS_HELP_STRING([--enable-developer-mode],
150 [The dynamic loadble backend libraries is loaded from current build directory instead of the standard library path]),
151 enable_developer_mode="$enableval", enable_developer_mode="no")
154 # - wrap e_book_from_string() to fix invalid parameter
155 # - don't use UTF-8 encoding in Perl script
157 AS_HELP_STRING([--enable-maemo],
158 [enables some hacks which work around problems with the Maemo 2.0 until at least 3.0 EDS-Dbus]),
159 [AC_DEFINE(ENABLE_MAEMO, 1, [enable Maemo hacks])
161 MODIFY_SYNCCOMPARE='-e "s/use encoding/#use encoding/;" -e "s/:utf8//;"'])
162 AC_SUBST(MODIFY_SYNCCOMPARE)
164 AC_CHECK_HEADERS(signal.h dlfcn.h)
166 # cppunit-config is used even when both unit tests and integration tests are disabled.
167 AC_PATH_PROG([CPPUNIT_CONFIG], [cppunit-config], [no])
170 if test "x$enable_unit_tests" = 'xyes' || test "x$enable_integration_tests" = 'xyes'; then
171 test "x$CPPUNIT_CONFIG" != 'xno' || AC_MSG_ERROR("cppunit-config not found.")
173 if test "x$CPPUNIT_CONFIG" != 'xno'; then
174 # Export the flags if available, even if not enabled. This allows
175 # "make src/client-test" in cases where "make all" would not build
177 CPPUNIT_CXXFLAGS=`$CPPUNIT_CONFIG --cflags`
178 CPPUNIT_LDFLAGS=`$CPPUNIT_CONFIG --libs`
180 AC_SUBST(CPPUNIT_CXXFLAGS)
181 AC_SUBST(CPPUNIT_LDFLAGS)
183 if test "x$enable_unit_tests" = 'xyes'; then
184 AC_DEFINE(ENABLE_UNIT_TESTS, 1, [enable unit tests inside the library's source code])
186 if test "x$enable_integration_tests" = 'xyes'; then
187 AC_DEFINE(ENABLE_INTEGRATION_TESTS, 1, [enable integration tests inside the final library])
189 AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "$enable_unit_tests" = "yes"])
190 AM_CONDITIONAL([ENABLE_TESTING], [test "$enable_unit_tests" = "yes" || test "$enable_integration_tests" = "yes" ])
192 if test $enable_static_cxx = "yes"; then
194 CORE_LDADD_DEP=libstdc++.a
196 AC_SUBST(CORE_LDADD_DEP)
198 # Check for transport layer.
199 # Both curl and libsoup can be enabled and disabled explicitly.
200 # The default is to use libsoup if available, otherwise curl.
202 AC_MSG_CHECKING([for libcurl])
203 if LIBCURL_LIBS=`sh -c 'curl-config --libs' 2>&AS_MESSAGE_LOG_FD` && \
204 LIBCURL_CFLAGS=`sh -c 'curl-config --cflags' 2>&AS_MESSAGE_LOG_FD`; then
212 PKG_CHECK_MODULES(LIBSOUP, libsoup-gnome-2.4,
214 AC_DEFINE(HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H, 1, [enable GNOME specific libsoup])],
215 [PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4,
219 PKG_CHECK_MODULES(LIBOPENOBEX, openobex, have_obex="yes", have_obex="no")
221 if test $have_obex = "yes"; then
222 PKG_CHECK_MODULES(BLUEZ, bluez, have_bluez="yes", have_bluez="no")
223 if test $have_bluez = "yes"; then
227 AC_SUBST(LIBOPENOBEX_CFLAGS)
228 AC_SUBST(LIBOPENOBEX_LIBS)
229 AC_SUBST(BLUEZ_CFLAGS)
236 AC_ARG_WITH(ca-certificates,
237 AS_HELP_STRING([--with-ca-certificates=<colon separated list of files>],
238 [Specifies location of one or more CA certificate files.
239 This sets the default value for the SSLServerCertificates option.
240 Default: empty when using libcurl (because it has its own default),
241 a list of paths known to work for Debian and Red Hat otherwise.]),
242 [CA_CERTIFICATES="$withval"])
245 # choose default http transport (mirrors code in EvolutionSyncClient::createTransportAgent())
246 if test "$have_libsoup" = "yes"; then
247 default_http_transport="libsoup"
248 elif test "$have_libcurl" = "yes"; then
249 default_http_transport="libcurl"
252 AC_ARG_ENABLE(libcurl,
253 AS_HELP_STRING([--enable-libcurl],
254 [enable libcurl as transport layer]),
255 [ if test "$enableval" = "yes"; then
256 test "$have_libcurl" = "yes" || AC_MSG_ERROR([libcurl not found])
257 TRANSPORT="$TRANSPORT libcurl"
258 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBCURL_LIBS"
259 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBCURL_CFLAGS"
260 AC_DEFINE(ENABLE_LIBCURL, 1, [enable libcurl transport])
262 libcurl_disabled="yes"
264 [ if test "$have_libcurl" = "yes" && test "$default_http_transport" = "libcurl" ; then
265 TRANSPORT="$TRANSPORT libcurl"
266 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBCURL_LIBS"
267 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBCURL_CFLAGS"
268 AC_DEFINE(ENABLE_LIBCURL, 1, [enable libcurl transport])
271 AC_ARG_ENABLE(libsoup,
272 AS_HELP_STRING([--enable-libsoup],
273 [enable libsoup as transport layer]),
274 [ if test "$enableval" = "yes"; then
275 test "$have_libsoup" = "yes" || AC_MSG_ERROR([libsoup not found])
276 TRANSPORT="$TRANSPORT libsoup"
277 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBSOUP_LIBS"
278 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBSOUP_CFLAGS"
279 AC_DEFINE(ENABLE_LIBSOUP, 1, [enable libsoup transport])
281 libsoup_disabled="yes"
283 [ if test "$have_libsoup" = "yes" && test "$default_http_transport" = "libsoup"; then
284 TRANSPORT="$TRANSPORT libsoup"
285 TRANSPORT_LIBS="$TRANSPORT_LIBS $LIBSOUP_LIBS"
286 TRANSPORT_CFLAGS="$TRANSPORT_CFLAGS $LIBSOUP_CFLAGS"
287 AC_DEFINE(ENABLE_LIBSOUP, 1, [enable libsoup transport])
290 # SoupTransportAgent depends on glib
291 case "$TRANSPORT" in *libsoup*) need_glib=yes;; esac
294 AS_HELP_STRING([--enable-dlt],
295 [enable logging via GENIVI Diagnostic Log and Trace (DLT)]),
296 [enable_dlt=$enableval
297 test $enable_dlt = "yes" || test $enable_dlt = "no" || AC_ERROR([invalid value of --enable-dlt: $enableval])],
299 if test "$enable_dlt" = "yes"; then
300 PKG_CHECK_MODULES(DLT, automotive-dlt,
302 [AC_ERROR([dlt not found, required for --enable-dlt])])
303 AC_DEFINE(USE_DLT, 1, "optionally use GENIVI Diagnostic Log and Trace for logging")
304 AC_ARG_WITH([dlt-syncevolution],
305 AS_HELP_STRING([--with-dlt-syncevolution=SYNS,SYNH,SYNL],
306 [controls the application IDs used by syncevo-dbus-server, syncevo-dbus-helper and syncevo-local-sync]),
307 [with_dlt_ids="$withval"],
308 [with_dlt_ids="SYNS,SYNH,SYNL"])
309 syns=`echo $with_dlt_ids | cut -d , -f 1`
310 synh=`echo $with_dlt_ids | cut -d , -f 2`
311 synl=`echo $with_dlt_ids | cut -d , -f 3`
312 AC_DEFINE_UNQUOTED(DLT_SYNCEVO_DBUS_SERVER_ID, "$syns", "DLT app ID for syncevo-dbus-server")
313 AC_DEFINE_UNQUOTED(DLT_SYNCEVO_DBUS_HELPER_ID, "$synh", "DLT app ID for syncevo-dbus-helper")
314 AC_DEFINE_UNQUOTED(DLT_SYNCEVO_LOCAL_HELPER_ID, "$synl", "DLT app ID for syncevo-local-helper")
317 bluetooth_disabled=no
318 AC_ARG_ENABLE(bluetooth,
319 AS_HELP_STRING([--enable-bluetooth],
320 [enable bluetooth transport support]),
321 [ enable_bluetooth="$enableval"
322 if test "$enableval" = "no"; then
323 bluetooth_disabled=yes
326 [ enable_bluetooth="$have_bluetooth" ])
328 if test "$enable_bluetooth" = "yes"; then
329 # currently we need Bluetooth and OBEX support
330 test "$have_bluetooth" = "yes" || AC_MSG_ERROR([openobex or bluez not found])
334 CFLAGS="$CPPFLAGS $BLUEZ_CFLAGS"
335 # test in this order:
336 # - recent libbluetooth (no _safe variant, base function has bufsize)
337 # - intermediate with _safe
338 # - else assume old-style (no bufsize, no _safe)
340 # The source code checks the signature both by via pointer assignment and calling
341 # it (better safe than sorry). One these should fail if the signature is not right.
342 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
343 #include <bluetooth/sdp.h>
344 #include <bluetooth/sdp_lib.h>
345 sdp_record_t *(*extract_pdu)(const uint8_t *pdata, int bufsize, int *scanned) =
348 uint8_t *pdata = NULL;
350 sdp_extract_pdu(pdata, 100, &scanned);
353 AC_DEFINE(HAVE_BLUEZ_BUFSIZE, 1, [base libbluetooth functions accept bufsize parameter]),
354 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
355 #include <bluetooth/sdp.h>
356 #include <bluetooth/sdp_lib.h>
357 sdp_record_t *(*extract_pdu)(const uint8_t *pdata, int bufsize, int *scanned) =
358 sdp_extract_pdu_safe;
360 uint8_t *pdata = NULL;
362 sdp_extract_pdu_safe(pdata, 100, &scanned);
365 AC_DEFINE(HAVE_BLUEZ_SAFE, 1, [libbluetooth has _safe variants])))
368 if test "$have_obex" = "yes"; then
369 AC_DEFINE(ENABLE_OBEX, 1, [define if openobex library is available])
371 if test "$have_bluez" = "yes"; then
372 AC_DEFINE(ENABLE_BLUETOOTH, 1, [define if bluez library is available])
375 AM_CONDITIONAL([ENABLE_OBEX], [test "$have_obex" = "yes" && test "$enable_bluetooth" = "yes"])
376 AM_CONDITIONAL([ENABLE_BLUETOOTH], [test "$have_bluetooth" = "yes" && test "$enable_bluetooth" = "yes"])
378 if test ! "$TRANSPORT" &&
379 test "$libsoup_disabled" != "yes" &&
380 test "$libcurl_disabled" != "yes" &&
381 test "$bluetooth_disabled" != "yes" &&
382 test "$have_bluetooth" != "yes" ; then
383 AC_MSG_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)])
386 # for libsoup we must specify the SSL certificate file outself
387 if test "$libsoup_disabled" != "yes" && test -z "$CA_CERTIFICATES"; then
388 # Debian and Red Hat paths
389 CA_CERTIFICATES="/etc/ssl/certs/ca-certificates.crt:/etc/pki/tls/certs/ca-bundle.crt:/usr/share/ssl/certs/ca-bundle.crt"
391 AC_DEFINE_UNQUOTED(SYNCEVOLUTION_SSL_SERVER_CERTIFICATES, "$CA_CERTIFICATES", [default value for SSLServerCertificates option])
393 AC_SUBST(TRANSPORT_LIBS)
394 AC_SUBST(TRANSPORT_CFLAGS)
396 AC_ARG_ENABLE(ssl-certificate-check,
397 AS_HELP_STRING([--disable-ssl-certificate-check],
398 [Disable SSL certificate checking in all server
399 *templates*. Users can still choose to enable or
400 disable it in their configuration. This is necessary on
401 platforms where the transport library has problems
402 verifying the server's certificate (libsoup + Google,
403 http://bugzilla.moblin.org/show_bug.cgi?id=4551)]),
404 enable_ssl_certificate_check="$enableval",
405 enable_ssl_certificate_check="yes")
406 if test "$enable_ssl_certificate_check" = "yes"; then
407 AC_DEFINE(ENABLE_SSL_CERTIFICATE_CHECK, 1, [enable SSL certificate check in server templates])
410 # for dbus interface file mangling
411 AC_PATH_PROG(XSLT, xsltproc)
414 # Changes in GTK3 mean that supporting both GTK3 and GTK2 in the same codebase
415 # is difficult. We want to support GTK2 for the time being so the code is forked.
417 AS_HELP_STRING([--enable-gtk=major version],
418 [Selects the gtk+ version ("2" or "3") to use for the UI.
419 If this option is used, --enable-gui should be used as well.
420 "3" is the default option if available, otherwise "2".]),
421 [ if test "$enableval" = "3" ; then
423 elif test "$enableval" = "2" ; then
426 AC_MSG_ERROR([Unknown gtk version: '$enableval'])
429 [ PKG_CHECK_EXISTS([gtk+-3.0],
430 [gtk_version=gtk+-3.0],
431 [gtk_version=gtk+-2.0]) ])
434 AM_CONDITIONAL([COND_GTK2], [test "$gtk_version" = "gtk+-2.0"])
437 AS_HELP_STRING([--enable-gui[=gui type]],
438 [enables building the GTK+ UI that uses the SyncEvolution DBus API.
439 Options: gtk, moblin, all (builds sync-ui-gtk and sync-ui-moblin)
440 "gtk" is the default for --enable-gui without type. No GUI is
441 built when --enable-gui is not used.]),
442 [ if test "$enableval" = "gtk" ; then
444 elif test "$enableval" = "yes" ; then
446 elif test "$enableval" = "moblin" ; then
448 elif test "$enableval" = "no" ; then
450 elif test "$enableval" = "all" ; then
453 AC_MSG_ERROR([Unknown gui type: '$enableval'])
458 AM_CONDITIONAL([COND_GUI], [test "$enable_gui" != "no"])
461 AS_HELP_STRING([--enable-core],
462 [enables building the core SyncEvolution (library, backends)]),
463 enable_core="$enableval",
465 AM_CONDITIONAL([COND_CORE], [test "$enable_core" = "yes"])
467 AC_ARG_ENABLE(dbus-service,
468 AS_HELP_STRING([--enable-dbus-service=args],
469 [Enables building the dbus service executable and all related features
470 (the DBus wrapper library, command line usage of server, etc).
471 The optional arguments are syncevo-dbus-server command line arguments
472 that are used when auto-starting via D-Bus or .desktop file. By default,
473 the daemon logs to syslog. This can be changed via command line arguments.
475 enable_dbus_service="$enableval",
476 [if test $enable_gui = "no"; then
477 enable_dbus_service="no"
479 enable_dbus_service="yes"
481 AM_CONDITIONAL([COND_DBUS], [test "$enable_dbus_service" != "no"])
482 if test "$enable_dbus_service" != "no" && test "$enable_dbus_service" != "yes"; then
483 SYNCEVO_DBUS_SERVER_ARGS="$enable_dbus_service"
485 AC_SUBST(SYNCEVO_DBUS_SERVER_ARGS)
487 AC_ARG_WITH([gio-gdbus],
488 AS_HELP_STRING([--with-gio-gdbus],
489 [enables use of GIO's GDBus instead of the in-tree, Bluez gdbus.]),
490 with_gio_gdbus="$withval",
491 PKG_CHECK_EXISTS([gio-2.0 >= 2.30],
492 [with_gio_gdbus="yes"],
493 [with_gio_gdbus="no"]))
494 AM_CONDITIONAL([COND_GIO_GDBUS], [test "x$with_gio_gdbus" = "xyes"])
496 # We only need to check for dbus-1 if gio-gdbus is not used.
498 # Local sync depends on D-Bus communication between parent
499 # and child process (works without a D-Bus daemon), and local
500 # sync is not an optional feature. Could be made one if
501 # someone is interested enough.
503 # Therefore, at the moment, either libdbus or gio-gdbus are needed
504 # unconditionally. glib is needed in all cases now.
506 AS_IF([test "x$with_gio_gdbus" = "xyes"],
507 [PKG_CHECK_MODULES([DBUS], [gio-2.0 >= 2.26])
508 AC_DEFINE([WITH_GIO_GDBUS],[],[Set if using GIO GDBus])],
509 [PKG_CHECK_MODULES(DBUS, dbus-1, dummy=yes,
510 AC_MSG_ERROR(libdbus-1 is required))
511 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
512 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
513 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))])
515 if test "$enable_dbus_service" != "no"; then
516 if test -z "$XSLT"; then
517 AC_MSG_ERROR([xsltproc not found, is required for D-Bus service])
519 # Recent libnotify releases work with gtk+-2.0 and gtk+-3.0.
520 AC_ARG_ENABLE([notify],
521 AS_HELP_STRING([--enable-notify],
522 [send notifications for automatic sync events, using libnotify]),
523 enable_notify="$enableval",
524 PKG_CHECK_EXISTS([libnotify $gtk_version],
525 [enable_notify="yes"],
526 [enable_notify="no"]))
527 AS_IF([test "x$enable_notify" = "xyes"], [PKG_CHECK_MODULES([LIBNOTIFY], [libnotify $gtk_version])]
528 [AC_DEFINE(HAS_NOTIFY, 1,
529 [define if libnotify could be used in dbus service])])
531 AC_ARG_ENABLE(notify-compatibility,
532 AS_HELP_STRING([--enable-notify-compatibility],
533 [increase compatibility with binary libnotify installations by loading libnotify.so.1..4 dynamically instead of linking against it]),
534 [enable_notify_compat="$enableval"],
535 [enable_notify_compat="no"]
537 if test "$enable_notify_compat" = "yes"; then
538 AC_DEFINE(NOTIFY_COMPATIBILITY, 1, [dynamically open libnotify])
539 LIBNOTIFY_LIBS="`echo $LIBNOTIFY_LIBS | sed -e 's/\(-lnotify\|[^ ]*libnotify.la\)/-ldl/'`"
542 # Here we're using QtGui too because mlite fails to depend on it,
543 # despite using QAction.
544 PKG_CHECK_MODULES(MLITE, [mlite QtGui], HAVE_MLITE=yes, HAVE_MLITE=no)
546 AS_HELP_STRING([--enable-mlite],
547 [send notifications for automatic sync events, using mlite (off by default)]),
548 [ enable_mlite="$enableval"
549 test "$enableval" = "no" || test $HAVE_MLITE = "yes" || AC_MSG_ERROR([required mlite package not found]) ],
550 [ enable_mlite="no" ])
551 if test $enable_mlite = "yes"; then
552 AC_DEFINE(HAS_MLITE, 1, [define if mlite could be used in dbus service])
554 # don't use mlite, even if found
558 AC_DEFINE(DBUS_SERVICE, 1, [define if dbus service is enabled])
560 AC_ARG_ENABLE(dbus-service-pim,
561 AS_HELP_STRING([--enable-dbus-service-pim[=<locale>]],
562 [Enable implementation of org._01.pim D-Bus APIs (depends on libfolks),
563 using src/dbus/server/pim/locale-factory-<locale>.cpp to implement sorting
564 and searching. The default is <locale>=boost, which uses boost::locale.]),
565 [ enable_dbus_pim="$enableval" ],
566 [ enable_dbus_pim="no" ])
567 case "$enable_dbus_pim" in
570 if test "$enable_dbus_pim" = "yes"; then
571 enable_dbus_pim=boost
573 if ! test -r "$srcdir/src/dbus/server/pim/locale-factory-$enable_dbus_pim.cpp"; then
574 AC_MSG_ERROR([invalid value '$enable_dbus_pim' for --enable-dbus-service-pim, $srcdir/src/dbus/server/pim/locale-factory-$enable_dbus_pim.cpp does not exist or is not readable])
576 PKG_CHECK_MODULES(FOLKS, [folks folks-eds])
577 AC_DEFINE(ENABLE_DBUS_PIM, 1, [org._01.pim D-Bus API enabled])
578 DBUS_PIM_PLUGIN=$enable_dbus_pim
579 AC_SUBST(DBUS_PIM_PLUGIN)
581 case "$enable_dbus_pim" in
584 # AX_BOOST_LOCALE incorrectly puts -L/... into LDFLAGS.
585 # That's broken because it then overrides the search path
586 # for *all* libraries in a link, not just for boost. Fix
587 # this by putting the LDFLAGS before the lib and leaving
588 # DBUS_PIM_PLUGIN_LDFLAGS empty (for now - might have to
589 # be revised if there ever are any boost flags which need
590 # to go to the start of the link line).
591 DBUS_PIM_PLUGIN_LIBS='$(BOOST_LDFLAGS) $(BOOST_LOCALE_LIB)'
592 DBUS_PIM_PLUGIN_LDFLAGS=
593 # We need to call ICU directly for the Han->Latin transformation.
594 PKG_CHECK_MODULES(ICU, [icu-uc])
597 AC_SUBST(DBUS_PIM_PLUGIN_CFLAGS)
598 AC_SUBST(DBUS_PIM_PLUGIN_LIBS)
599 AC_SUBST(DBUS_PIM_PLUGIN_LDFLAGS)
601 # http://code.google.com/p/libphonenumber/
603 SAVED_CPPFLAGS=$CPPFLAGS
604 CPPFLAGS="$CPPFLAGS ${PHONENUMBERS_CFLAGS}"
605 AC_CHECK_HEADERS([phonenumbers/phonenumberutil.h])
607 if test ! "$PHONENUMBERS_LIBS"; then
608 PHONENUMBERS_LIBS=-lphonenumber
610 LIBS="$LIBS $PHONENUMBERS_LIBS"
612 [AC_LANG_PROGRAM([#include <phonenumbers/phonenumberutil.h>],
613 [i18n::phonenumbers::PhoneNumberUtil::GetInstance()])],
615 [AC_ERROR([libphonebook not found, set PHONENUMBERS_CFLAGS and PHONENUMBERS_LIBS.])])
616 AC_SUBST(PHONENUMBERS_CFLAGS)
617 AC_SUBST(PHONENUMBERS_LIBS)
619 CPPFLAGS=$SAVED_CPPFLAGS
623 AM_CONDITIONAL([NOTIFY_COMPATIBILITY], [test "$enable_notify_compat" = "yes"])
624 AM_CONDITIONAL([COND_DBUS_PIM], [test "$enable_dbus_pim" != "no"])
626 AC_SUBST(DBUS_CFLAGS)
628 AC_SUBST(DBUS_GLIB_CFLAGS)
629 AC_SUBST(DBUS_GLIB_LIBS)
630 AC_SUBST(LIBNOTIFY_CFLAGS)
631 AC_SUBST(LIBNOTIFY_LIBS)
634 DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
635 AC_SUBST(DBUS_SERVICES_DIR)
636 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Location of D-Bus services directory])
638 if test "$enable_gui" != "no" || test "$enable_dbus_service" != "no"; then
639 IT_PROG_INTLTOOL([0.37.1])
640 GETTEXT_PACKAGE=syncevolution
641 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package name])
643 SYNCEVOLUTION_LOCALEDIR=[${datadir}/locale]
646 # decide which sync-ui(s) we are building:
647 # sync-ui (in either GTK or Moblin mode) or both (in separate binaries)
649 if test $gtk_version = "gtk+-3.0"; then
656 all) GUI_PROGRAMS=${gtk_dir}'/sync-ui-gtk${EXEEXT} '${gtk_dir}'/sync-ui-moblin${EXEEXT}'; GUI_DESKTOP_FILES="${gtk_dir}/sync-gtk.desktop ${gtk_dir}/sync-moblin.desktop";;
657 gtk|moblin) GUI_PROGRAMS=${gtk_dir}'/sync-ui${EXEEXT}'; GUI_DESKTOP_FILES="${gtk_dir}/sync.desktop";;
658 no) GUI_PROGRAMS=; GUI_DESKTOP_FILES=;;
659 *) AC_MSG_ERROR([Unknown enable_gui type: '$enable_gui'])
662 if test $enable_gui != "no"; then
663 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 glib-2.0)
664 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
665 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
667 gui_modules="$gtk_version glib-2.0 dbus-glib-1 >= 0.60 gio-2.0 gio-unix-2.0"
668 if test $enable_gui = "moblin"; then
669 AC_DEFINE(USE_MOBLIN_UX, 1, [Use Moblin UI widgets])
672 # gtk3 provides a switch widget, otherwise we need mx-gtk
673 if test $gtk_version != "gtk+-3.0" &&
674 test $enable_gui = "moblin" -o $enable_gui = "all"; then
675 gui_modules="$gui_modules mx-gtk-1.0"
677 PKG_CHECK_MODULES(MX_GTK_0_99_1, mx-gtk-1.0 >= 0.99.1,
678 have_mx_gtk_0_99_1="yes",
679 have_mx_gtk_0_99_1="no")
680 if test $have_mx_gtk_0_99_1 = "yes"; then
681 AC_DEFINE(MX_GTK_0_99_1, 1, [we have Mx-Gtk 0.99.1 or better])
685 PKG_CHECK_MODULES(UNIQUE, unique-1.0,
688 if test $have_unique = "yes"; then
689 gui_modules="$gui_modules unique-1.0"
690 AC_DEFINE(ENABLE_UNIQUE, 1, [enable single-app-instance functionality])
693 PKG_CHECK_MODULES(GTK_2_18, gtk+-2.0 >= 2.18,
696 if test $have_gtk_2_18 = "yes"; then
697 AC_DEFINE(GTK_2_18, 1, [we have GTK+ 2.18 or better])
700 PKG_CHECK_MODULES(GUI, $gui_modules)
702 elif test "$enable_dbus_service" != "no"; then
703 # syncevo-dbus-server needs localization
706 INTLTOOL_UPDATE="true"
709 AC_SUBST(SYNCEVOLUTION_LOCALEDIR)
710 AC_SUBST(GETTEXT_PACKAGE)
713 AC_SUBST(GUI_PROGRAMS)
714 AC_SUBST(GUI_DESKTOP_FILES)
716 # C++ regular expression support is required often enough to make it
718 PKG_CHECK_MODULES(PCRECPP, libpcrecpp,,
719 AC_CHECK_LIB(pcrecpp,main,
720 AC_SUBST(PCRECPP_LIBS,-lpcrecpp),
721 AC_MSG_ERROR([pcrecpp not found])
724 # need rst2man for man pages
726 AS_HELP_STRING([--with-rst2man=<path to reStructuredText to man converter>],
727 [Specifies an explicit path to the utility if not found in PATH.
728 An explicit --without-rst2man or not having it installed turn off
729 building of man pages.]),
731 if test "$RST2MAN" = "yes"; then
732 AC_PATH_PROG(RST2MAN, rst2man, "no")
734 test "$RST2MAN" = "no" || test -x "$RST2MAN" || AC_MSG_ERROR([--with-rst2man=$RST2MAN: tool not found])],
735 [AC_PATH_PROG(RST2MAN, rst2man, "no")])
736 AM_CONDITIONAL([COND_MAN_PAGES], [test "$RST2MAN" != "no"])
738 # need rst2html for HTML version of README
739 AC_ARG_WITH(rst2html,
740 AS_HELP_STRING([--with-rst2html=<path to reStructuredText to HTML converter>],
741 [Specifies an explicit path to the utility if not found in PATH.
742 An explicit --without-rst2html or not having it installed turn off
743 building of README in HTML format.]),
745 if test "$RST2HTML" = "yes"; then
746 AC_PATH_PROG(RST2HTML, rst2html, "no")
748 test "$RST2HTML" = "no" || test -x "$RST2HTML" || AC_MSG_ERROR([--with-rst2html=$RST2HTML: tool not found])],
749 [AC_PATH_PROG(RST2HTML, rst2html, "no")])
750 AM_CONDITIONAL([COND_HTML_README], [test "$RST2HTML" != "no"])
752 # absolute patch to source of Synthesis client library
753 SYNTHESIS_SRC=no-synthesis-source
754 AC_SUBST(SYNTHESIS_SRC)
755 if test "$SYNTHESISSRC" && test "$SYNTHESISSRC" != "none"; then
756 # default: checkout a copy of the sources, remove it during maintainer-clean and distclean
757 CLEAN_CLIENT_SRC=synthesis-workdir
758 SYNTHESIS_SRC=$PWD/src/synthesis-workdir
760 AC_MSG_NOTICE( [updating the content of $SYNTHESIS_SRC from $SYNTHESISSRC] )
761 case "$SYNTHESISSRC" in
762 *.git) protocol=git;;
763 *://*) protocol="`echo $SYNTHESISSRC | sed -e 's;://.*;;'`";;
770 # use existing copy of the sources
772 case "$SYNTHESISSRC" in
773 /*) SYNTHESIS_SRC="$SYNTHESISSRC";;
774 *) SYNTHESIS_SRC="$PWD/$SYNTHESISSRC";;
778 SYNTHESISSRCREV="$SYNTHESISSRC"
779 if test "$REVISION"; then
780 revarg="-r $REVISION "
781 if `echo $SYNTHESISSRC | grep '@[0123456789]*'` >/dev/null; then
784 SYNTHESISSRCREV="$SYNTHESISSRC@$REVISION"
787 if test -d $SYNTHESIS_SRC ; then
788 ( set -x; cd $SYNTHESIS_SRC && svn --username=$USERNAME switch $revarg "$SYNTHESISSRC" ) || AC_MSG_ERROR([updating from $SYNTHESISSRC failed])
790 (set -x; svn --username=$USERNAME checkout $revarg "$SYNTHESISSRCREV" $SYNTHESIS_SRC ) || AC_MSG_ERROR([checking out $SYNTHESISSRC failed])
794 if test -d $SYNTHESIS_SRC ; then
795 ( set -x; cd $SYNTHESIS_SRC && git fetch "$SYNTHESISSRC" ) || AC_MSG_ERROR([updating from $SYNTHESISSRC failed])
797 ( set -x; git clone "$SYNTHESISSRC" $SYNTHESIS_SRC ) || AC_MSG_ERROR([cloning $SYNTHESISSRC failed])
799 if test "$REVISION"; then
800 # git 1.6 finds tags and branches without explicit prefix, 1.4.4.4 doesn't
801 ( set -x; cd $SYNTHESIS_SRC &&
802 (git checkout "$REVISION" ||
803 git checkout "tags/$REVISION" ||
804 git checkout "origin/$REVISION") ) || AC_MSG_ERROR([checking out $SYNTHESISSRC failed])
808 elif test "$SYNTHESISSRC" != "none" && test -d $srcdir/src/synthesis; then
809 # use existing copy of the sources; beware of
810 # out-of-tree compilation
812 /*) SYNTHESIS_SRC="$srcdir/src/synthesis";;
813 *) SYNTHESIS_SRC="$PWD/$srcdir/src/synthesis";;
815 elif test "$enable_shared" = "no"; then
816 # link against engine
817 PKG_CHECK_MODULES([SYNTHESIS], [synthesis >= 3.4])
818 SYNTHESIS_ENGINE="$SYNTHESIS_LIBS -lsynthesis -lsmltk"
820 # link against SDK alone, except in client-test
821 #PKG_CHECK_MODULES(SYNTHESIS, "synthesis-sdk")
822 #SYNTHESIS_ENGINE="`echo $SYNTHESIS_LIBS | sed -e 's/-lsynthesisstubs/-lsynthesis/'`"
824 # can't use the SDK alone because of sysync::SySyncDebugPuts()
825 PKG_CHECK_MODULES([SYNTHESIS], [synthesis >= SYNTHESIS_MIN_VERSION])
826 SYNTHESIS_ENGINE="$SYNTHESIS_LIBS"
829 if test $SYNTHESIS_SRC != "no-synthesis-source"; then
830 ( 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])
832 SYNTHESIS_CONFIGURE="$SYNTHESIS_SRC/configure"
833 chmod u+x $SYNTHESIS_SRC/configure $SYNTHESIS_SRC/config.sub $SYNTHESIS_SRC/config.guess
835 # use local copy of the sources, with dependencies
836 # to trigger building the synthesis library
837 SYNTHESIS_SUBDIR=$PWD/src/build-synthesis
838 SYNTHESIS_CFLAGS="-I$SYNTHESIS_SUBDIR/src"
839 SYNTHESIS_LIBS="$SYNTHESIS_SUBDIR/src/libsynthesissdk.la $SYNTHESIS_SUBDIR/src/libsmltk.la"
841 if test "x$enable_core" = "xno" && test "x$enable_gui" != "xno"; then
842 # SYNTHESIS_SUBDIR is ignored, at least build headers for GUI
843 SYNTHESIS_SUBDIR_INCLUDES=src/synthesis-includes
846 if test "$enable_shared" = "no"; then
847 # link against the engines that were enabled
848 case $SYNCML_ENGINES in both|client|server) SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/src/libsynthesis.la $SYNTHESIS_SUBDIR/src/libsmltk.la";; esac
849 AC_DEFINE(ENABLE_SYNCML_LINKED, 1, [SyncML engines are linked directly])
851 # It would be nice if we could avoid linking against libsynthesis.la here.
852 # This doesn't work at the moment because sysync::SySyncDebugPuts()
853 # is called directly by the libsynthesissdk instead of going through
854 # the normal C function pointer lookup.
855 SYNTHESIS_LIBS="$SYNTHESIS_LIBS $SYNTHESIS_SUBDIR/src/libsynthesis.la $SYNTHESIS_SUBDIR/src/libsmltk.la"
857 SYNTHESIS_DEP=$SYNTHESIS_LIBS
859 # for linking client-test
860 SYNTHESIS_ENGINE="$SYNTHESIS_SUBDIR/src/libsynthesis.la"
862 AC_MSG_NOTICE( [configuring the Synthesis library] )
863 if (set -x; mkdir -p $SYNTHESIS_SUBDIR && cd $SYNTHESIS_SUBDIR && eval "\$SHELL \"\$SYNTHESIS_CONFIGURE\" $ac_configure_args \"--srcdir=\$SYNTHESIS_SRC\" " ); then true; else
864 AC_MSG_ERROR( [configuring Synthesis library failed] )
867 # do the version check with the .pc files prepared by the configure step above
868 export PKG_CONFIG_PATH=$SYNTHESIS_SUBDIR:$PKG_CONFIG_PATH
869 PKG_CHECK_MODULES([WITH_SYNTHESIS_SRC], [synthesis >= SYNTHESIS_MIN_VERSION],
871 [AC_MSG_ERROR([need at least libsynthesis >= SYNTHESIS_MIN_VERSION; the latest libsynthesis for SyncEvolution is the one from http://cgit.freedesktop.org/SyncEvolution/])])
875 AC_SUBST(SYNTHESIS_CFLAGS)
876 AC_SUBST(SYNTHESIS_LIBS)
878 AC_SUBST(SYNTHESIS_SUBDIR)
879 AC_SUBST(SYNTHESIS_SUBDIR_INCLUDES)
880 AC_SUBST(SYNTHESIS_DEP)
881 AC_SUBST(SYNTHESIS_ENGINE)
882 AC_SUBST(SYNTHESIS_LIB)
883 AC_SUBST(SYNTHESISSRC)
885 BACKEND_CPPFLAGS="$SYNTHESIS_CFLAGS $EPACKAGE_CFLAGS $EBOOK_CFLAGS $ECAL_CFLAGS $GLIB_CFLAGS $BOOST_CPPFLAGS"
886 AC_SUBST(BACKEND_CPPFLAGS)
888 # GNOME Bluetooth Panel plugin
889 PKG_CHECK_MODULES(GNOMEBLUETOOTH, [gnome-bluetooth-1.0 >= 2.27.6],
891 GNOMEBLUETOOTH_DIR=`$PKG_CONFIG --variable=libdir gnome-bluetooth-1.0 2>/dev/null`/gnome-bluetooth],
893 AC_SUBST(GNOMEBLUETOOTH_CFLAGS)
894 AC_SUBST(GNOMEBLUETOOTH_DIR)
896 AC_ARG_ENABLE(gnome-bluetooth-panel-plugin,
897 AS_HELP_STRING([--enable-gnome-bluetooth-panel-plugin],
898 [GNOME Bluetooth panel plugin adding a "sync" button for paired devices (off by default)]),
899 [enable_gnome_bluetooth_panel="$enableval"],
900 [enable_gnome_bluetooth_panel="no"]
902 if test "$enable_gnome_bluetooth_panel" = "yes"; then
903 test "$have_gbt" = "yes" || AC_MSG_ERROR([--enable-gnome-bluetooth-panel requires
904 pkg-config information for gnome-bluetooth-1.0 >= 2.27.6 which was not found])
906 AM_CONDITIONAL([ENABLE_GNOME_BLUETOOTH_PANEL], [test "$have_gbt" = "yes" && test "$enable_gnome_bluetooth_panel" = "yes"])
909 AS_HELP_STRING([--enable-doc],
910 [generate backend and DBus API documentation]),
911 enable_doc="$enableval", enable_doc="no")
913 AM_CONDITIONAL([COND_DOC], [test "$enable_doc" != "no"])
915 dnl add backends stuff.
918 dnl -*- mode: Autoconf; -*-
919 dnl Invoke autogen.sh to produce a configure script.
921 AC_ARG_ENABLE(qt-dbus,
922 AS_HELP_STRING([--enable-qt-dbus],
923 [build Qt bindings for D-Bus]),
924 enable_qt_dbus="$enableval", enable_qt_dbus="no")
926 if test "$enable_qt_dbus" = "yes"; then
927 AC_DEFINE(ENABLE_QT_DBUS, 1, [Qt D-Bus bindings available])
928 need_qt_modules="$need_qt_modules +dbus"
929 AC_PATH_PROG([QDBUSXML_TO_CPP], [qdbusxml2cpp], [no])
930 test "x$QDBUSXML_TO_CPP" != 'xno' || AC_MSG_ERROR([--enable-qt-dbus requires qdbusxml2cpp, which was not found])
933 AM_CONDITIONAL([ENABLE_QT_DBUS], [test "$enable_qt_dbus" = "yes"])
935 AC_SUBST(QT_DBUS_LIBS)
936 AC_CONFIG_FILES([src/dbus/qt/syncevolution-qt-dbus.pc])
938 dnl -*- mode: Autoconf; -*-
939 dnl Invoke autogen.sh to produce a configure script.
940 dnl configure-pre.in and src/backends/*/configure-sub.in and configure-post.in come before this part
942 AC_SUBST(BACKEND_CPPFLAGS)
945 backend_is_enabled () {
946 eval echo \${enable_${1}}
948 for backend in $BACKENDS; do
949 if test `backend_is_enabled $backend` = "yes"; then
951 SYNCEVOLUTION_MODULES="$SYNCEVOLUTION_MODULES src/backends/sync${backend}.la"
955 if test "$enable_any" = "no"; then
956 AC_MSG_ERROR([no backend enabled - refusing to continue: $anymissing])
959 dnl glib initialization is done only if requested by some configure-sub.in,
960 dnl for not needed otherwise even if found
961 if test "$need_glib" = "yes"; then
962 # HAVE_GLIB (aka GLIBFOUND) are a catch-all for these
963 # three GNOME libs. Assume we have all three unless one of
967 dnl check for glib - calling g_type_init() is expected on Maemo
968 PKG_CHECK_MODULES(GLIB, "glib-2.0", , GLIBFOUND=no)
969 # This check here is broken on Ubuntu 8.04: it calls glib-config,
970 # which isn't found, but the error is not detected by configure.
971 #if test "x${GLIBFOUND}" = "xno"; then
972 # PKG_CHECK_MODULES(GLIB, "glib", GLIBFOUND=yes, GLIBFOUND=no)
975 PKG_CHECK_MODULES(GTHREAD, "gthread-2.0", , GLIBFOUND=no)
976 PKG_CHECK_MODULES(GOBJECT, "gobject-2.0", , GLIBFOUND=no)
977 PKG_CHECK_MODULES(GIO, "gio-2.0", , GLIBFOUND=no)
979 if test "x${GLIBFOUND}" = "xyes"; then
980 AC_DEFINE(HAVE_GLIB, 1, [glib found])
982 AC_MSG_ERROR([not all GNOME libraries found])
984 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
987 dnl use libical if and only if required by some backend
988 if test "$need_ical" = "yes"; then
989 PKG_CHECK_MODULES(LIBICAL, libical,
991 [PKG_CHECK_MODULES(LIBICAL, libecal-1.2)])
992 AC_DEFINE(ENABLE_ICAL, 1, [libical in use])
994 AM_CONDITIONAL([ENABLE_ICAL], [test "$need_ical" = "yes"])
997 # Check for Qt if some backend needs it.
998 if test "$need_qt_modules"; then
999 AT_WITH_QT([-gui $need_qt_modules],
1004 # determine from where we can get a SHA-256 implementation
1006 if test "$GLIBFOUND" = "yes"; then
1007 # only use glib if we need it anyway, also has to be at lease 2.16
1008 PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
1009 [AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
1013 if test "$have_sha" = "no"; then
1014 # Fallback is Mozilla NSS. In contrast to libgcrypt it has a .pc
1015 # file and a simple API.
1016 PKG_CHECK_MODULES(NSS, "nss",
1017 [AC_DEFINE(USE_SHA256, 2, [choose implementation of SHA-256])
1022 dnl figure out whether we link all code statically or as modules
1023 AM_CONDITIONAL([ENABLE_MODULES], [test "$enable_shared" = "yes"])
1024 if test "$enable_shared" = "yes"; then
1025 AC_DEFINE(ENABLE_MODULES, 1, [enable dynamically opening sync source backends])
1027 AC_SUBST(SYNCEVOLUTION_LDADD)
1029 dnl CXXFLAGS gets applied to SyncEvolution and the client library.
1030 dnl For e.g. "-Wall -Werror" this might not be such a good idea;
1031 dnl SYNCEVOLUTION_CXXFLAGS can be used instead. It applies only
1032 dnl to the sources in the SyncEvolution repository.
1033 AC_SUBST(SYNCEVOLUTION_CXXFLAGS)
1035 dnl a quick-and-dirty way to detect compilation for the iPhone
1036 if test "$host" = "arm-apple-darwin"; then
1037 AC_DEFINE(IPHONE, 1, [compiling for iPhone])
1041 dnl --enable-evolution-compatibility
1042 if test "$enable_evolution_compatibility" = "yes"; then
1043 AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
1044 # don't link against libs wrapped by eds_abi_wrapper (no longer limited to EDS alone...)
1050 AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" = "yes"])
1051 PKG_CHECK_MODULES(LIBICAL_AVAILABLE,
1053 AC_DEFINE(HAVE_LIBICAL_R, 1, [have recent enough libical with _r variants]),
1056 dnl --enable-developer-mode
1057 if test "$enable_developer_mode" = "yes"; then
1058 BACKENDS_SEARCH_DIRECTORY="`pwd`/src/backends/"
1060 BACKENDS_SEARCH_DIRECTORY='$(libdir)/syncevolution/backends/'
1063 BACKENDS_DIRECTORY='$(libdir)/syncevolution/backends'
1064 AC_SUBST(BACKENDS_DIRECTORY)
1065 AC_SUBST(BACKENDS_SEARCH_DIRECTORY)
1067 # for ActiveSync backend
1068 syncevo_backenddir='$(libdir)'/syncevolution/backends
1069 AC_SUBST(syncevo_backenddir)
1071 dnl This string is sent as part of the SyncML DevInf (device
1072 dnl information) structure to the server. All SyncEvolution platforms
1073 dnl use "SyncEvolution" as HTTP user agent and "Mod" (model), so the
1074 dnl device type is the only way how different kinds of clients can be
1076 AC_DEFINE_UNQUOTED(DEVICE_TYPE, "$DEVICE_TYPE", "SyncML DevInf DevType")
1078 AC_CHECK_HEADERS(stdarg.h valgrind/valgrind.h execinfo.h)
1080 AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")
1082 # fallback for lack of --with-docdir support in older automake
1083 if test ! "$docdir"; then
1084 docdir = ${datadir}/doc/syncevolution
1088 AC_ARG_ENABLE(dbus-timeout-hack,
1089 AS_HELP_STRING([--enable-dbus-timeout-hack],
1090 [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.]),
1091 [enable_dbus_timeout_hack=$enableval],
1092 [if test $enable_ebook = "yes" || test $enable_ecal = "yes"; then
1093 enable_dbus_timeout_hack="yes"
1095 if test "$enable_dbus_timeout_hack" = "yes"; then
1096 AC_DEFINE(ENABLE_DBUS_TIMEOUT_HACK, 1, [overrides the default D-Bus timeout so that synchronous calls never time out])
1099 # Avoid hard-coding paths in backends. These names are chosen so
1100 # that a backend can alternatively use its own top-level configure
1101 # with PKG_CHECK_MODULES(SYNCEVOLUTION, "syncevolution") to set them.
1102 # need absolute path, use pwd instead of relative $srcdir
1104 # When adding something here, remember to also update syncevolution.pc.in.
1105 # -lrt is for clock_gettime() in the Timespec.h inline functions.
1106 SYNCEVOLUTION_CFLAGS=-I`cd $srcdir && pwd`/src
1107 # Linker flags including libsyncevolution.la and some libs.
1108 SYNCEVOLUTION_LIBS="src/syncevo/libsyncevolution.la -lrt"
1109 AC_SUBST(SYNCEVOLUTION_CFLAGS)
1110 AC_SUBST(SYNCEVOLUTION_LIBS)
1112 # invoking syncevolution binary is allowed to fail when cross-compiling
1113 AM_CONDITIONAL([COND_CROSS_COMPILING], [test "$cross_compiling" = "yes"])
1115 # Set by any of the backends providing a keyring, determines the
1116 # default for the "keyring" option.
1117 if test "$have_keyring" = "yes"; then
1118 AC_DEFINE(HAVE_KEYRING, 1, [some kind of secure credential store is available])
1123 src/syncevo/syncevolution.pc
1124 src/synthesis-includes/Makefile
1126 src/dbus/glib/syncevo-dbus.pc
1131 echo CONFIGURATION SUMMARY
1132 echo "Core SyncEvolution: $enable_core"
1133 for backend in $BACKENDS; do
1134 eval echo $backend: \${enable_${backend}}
1136 echo "DBus service: $enable_dbus_service"
1137 echo "org._01.pim support in DBus service: $enable_dbus_pim"
1138 echo "Notifications: $enable_notify"
1139 echo "GIO GDBus: $with_gio_gdbus"
1140 echo "GNOME keyring: $enable_gnome_keyring"
1141 if test "$enable_gui" = "no"; then
1142 echo "UI (DBus client): no"
1144 echo "UI (DBus client): $enable_gui (using $gtk_version)"
1146 echo "Bluetooth transport: $have_bluetooth"
1147 echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
1148 echo "SHA-256: $have_sha"
1149 echo "API documentation: $enable_doc"
1150 echo "D-Bus Timeout Hack: $enable_dbus_timeout_hack"