2 dnl Evolution-Data-Server version
3 m4_define([eds_major_version], [3])
4 m4_define([eds_minor_version], [5])
5 m4_define([eds_micro_version], [3])
7 m4_define([eds_version],
8 [eds_major_version.eds_minor_version.eds_micro_version])
10 dnl Base Version: This is for API/version tracking for things like
11 dnl Bonobo server files. This should always be the major/minor of
12 dnl the stable version or stable version to be. Note, this is set
13 dnl the way it is so that GETTEXT_PACKAGE will be parsed correctly.
15 m4_define([base_version], [3.6])
17 dnl This number is meaningless, but we're now stuck with it in our
18 dnl library names for backward compatibility.
19 m4_define([api_version], [1.2])
21 dnl Autoconf / Automake Initialization
23 AC_INIT([evolution-data-server],[eds_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server])
24 AM_INIT_AUTOMAKE([gnu 1.10 tar-ustar dist-xz no-dist-gzip -Wall -Wno-portability -Werror foreign])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_SRCDIR(README)
27 AC_CONFIG_HEADERS(config.h)
29 dnl This is for the autoconf tests only - it set's the language we use
32 dnl Automake 1.11 - Silent Build Rules
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
35 dnl Required Package Versions
36 m4_define([glib_minimum_version], [2.32])
37 m4_define([gtk_minimum_version], [3.2])
38 m4_define([gconf_minimum_version], [2.0.0]) dnl XXX Just a Guess
39 m4_define([gcr_minimum_version], [3.4])
40 m4_define([gnome_keyring_minimum_version], [2.20.1])
41 m4_define([goa_minimum_version], [3.2])
42 m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
43 m4_define([libsoup_minimum_version], [2.38.1])
44 m4_define([libgdata_minimum_version], [0.10])
45 m4_define([oauth_minimum_version], [0.9.4])
46 m4_define([sqlite_minimum_version], [3.5])
47 m4_define([libical_minimum_version], [0.43])
48 m4_define([gweather_minimum_version], [2.90.0])
50 AC_SUBST([BASE_VERSION],[base_version])
51 AC_SUBST([API_VERSION],[api_version])
52 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
53 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
55 EDS_MAJOR_VERSION=eds_major_version
56 EDS_MINOR_VERSION=eds_minor_version
57 EDS_MICRO_VERSION=eds_micro_version
61 dnl ******************************
63 dnl ******************************
64 ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook3"
65 CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar2"
66 SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources0"
69 ADDRESS_BOOK_DBUS_SERVICE_NAME,
70 ["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
71 [D-Bus service name for the address book factory])
74 CALENDAR_DBUS_SERVICE_NAME,
75 ["$CALENDAR_DBUS_SERVICE_NAME"],
76 [D-Bus service name for the calendar factory])
79 SOURCES_DBUS_SERVICE_NAME,
80 ["$SOURCES_DBUS_SERVICE_NAME"],
81 [D-Bus service name for the source registry])
83 AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
84 AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
85 AC_SUBST(SOURCES_DBUS_SERVICE_NAME)
87 dnl ******************************
88 dnl Libtool versioning
89 dnl ******************************
90 LIBEDATASERVER_CURRENT=16
91 LIBEDATASERVER_REVISION=0
94 LIBEDATASERVERUI_CURRENT=3
95 LIBEDATASERVERUI_REVISION=0
96 LIBEDATASERVERUI_AGE=0
102 LIBEDATACAL_CURRENT=17
103 LIBEDATACAL_REVISION=0
106 LIBEDATABOOK_CURRENT=14
107 LIBEDATABOOK_REVISION=0
118 LIBEBACKEND_CURRENT=3
119 LIBEBACKEND_REVISION=0
122 AC_SUBST(EDS_MAJOR_VERSION)
123 AC_SUBST(EDS_MINOR_VERSION)
124 AC_SUBST(EDS_MICRO_VERSION)
125 AC_SUBST(LIBEDATASERVER_CURRENT)
126 AC_SUBST(LIBEDATASERVER_REVISION)
127 AC_SUBST(LIBEDATASERVER_AGE)
128 AC_SUBST(LIBEDATASERVERUI_CURRENT)
129 AC_SUBST(LIBEDATASERVERUI_REVISION)
130 AC_SUBST(LIBEDATASERVERUI_AGE)
131 AC_SUBST(LIBECAL_CURRENT)
132 AC_SUBST(LIBECAL_REVISION)
133 AC_SUBST(LIBECAL_AGE)
134 AC_SUBST(LIBEDATACAL_CURRENT)
135 AC_SUBST(LIBEDATACAL_REVISION)
136 AC_SUBST(LIBEDATACAL_AGE)
137 AC_SUBST(LIBEBOOK_CURRENT)
138 AC_SUBST(LIBEBOOK_REVISION)
139 AC_SUBST(LIBEBOOK_AGE)
140 AC_SUBST(LIBEDATABOOK_CURRENT)
141 AC_SUBST(LIBEDATABOOK_REVISION)
142 AC_SUBST(LIBEDATABOOK_AGE)
143 AC_SUBST(LIBCAMEL_CURRENT)
144 AC_SUBST(LIBCAMEL_REVISION)
145 AC_SUBST(LIBCAMEL_AGE)
146 AC_SUBST(LIBEBACKEND_CURRENT)
147 AC_SUBST(LIBEBACKEND_REVISION)
148 AC_SUBST(LIBEBACKEND_AGE)
150 dnl **************************************
151 dnl Put the ACLOCAL flags in the Makefile
152 dnl **************************************
153 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
155 dnl ******************************
156 dnl Compiler Warning Flags
157 dnl ******************************
158 AS_COMPILER_FLAGS(WARNING_FLAGS,
160 -Wno-missing-field-initializers
162 -Wno-unused-parameter
163 -Wno-deprecated-declarations
164 -Wdeclaration-after-statement
165 -Werror-implicit-function-declaration
166 -Wformat-security -Winit-self
167 -Wmissing-declarations -Wmissing-include-dirs
168 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
169 -Wredundant-decls -Wundef -Wwrite-strings")
170 AC_SUBST(WARNING_FLAGS)
172 dnl More depracation from EBook/ECal:
173 dnl -DE_BOOK_DISABLE_DEPRECATED
174 dnl -DE_CAL_DISABLE_DEPRECATED
176 dnl Other useful compiler warnings for test builds only.
177 dnl These may produce warnings we have no control over,
178 dnl or false positives we don't always want to see.
180 dnl -Wformat-nonliteral
181 dnl -Wmissing-format-attribute
183 dnl -Wstrict-aliasing=2
185 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
186 AC_SUBST(AM_CPPFLAGS)
189 dnl define disable deprecated for EBook and ECal .am files
190 case "$WARNING_FLAGS" in
191 *E_BOOK_DISABLE_DEPRECATED*)
192 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 1 == 1 ])
195 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 0 == 1 ])
199 case "$WARNING_FLAGS" in
200 *E_CAL_DISABLE_DEPRECATED*)
201 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 1 == 1 ])
204 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 0 == 1 ])
208 dnl ******************************
209 dnl Initialize maintainer mode
210 dnl ******************************
211 AM_MAINTAINER_MODE([enable])
213 if test "x$enable_maintainer_mode" = "xyes" ; then
214 AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
228 AC_MSG_ERROR([You need bison to build evolution-data-server])
232 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
233 dnl behavior that -- according to the C99 standard -- is supposed to be
234 dnl undefined. We may still have aliasing abuses lying around that rely
235 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
236 dnl optimization until we can find and fix all the abuses.
237 dnl (AC_PROG_CC must run first to set the GCC variable.)
238 dnl XXX This really belongs in AM_CFLAGS.
239 if test "x${GCC}" = "xyes"; then
240 CFLAGS="$CFLAGS -fno-strict-aliasing"
243 dnl ******************************
244 dnl Test whether jw is installed
245 dnl ******************************
246 AC_PATH_PROG(JW,jw,no)
247 if test "x$JW" = "xno"; then
252 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
255 dnl ******************************
257 dnl ******************************
258 IT_PROG_INTLTOOL([0.35.5])
260 AM_GNU_GETTEXT_VERSION([0.17])
261 AM_GNU_GETTEXT([external])
263 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
264 AC_SUBST(GETTEXT_PACKAGE)
265 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
267 localedir='$(prefix)/$(DATADIRNAME)/locale'
270 dnl ******************************
271 dnl Initialize libtool
272 dnl ******************************
274 LT_INIT(disable-static win32-dll)
278 dnl ******************************
280 dnl ******************************
281 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
283 dnl The private D-Bus documentation is for developers only.
284 AC_ARG_WITH([private-docs],
285 AS_HELP_STRING([--with-private-docs],
286 [Build documentation for private libraries ]
287 [(requires --enable-gtk-doc) [default=no]],),
288 [with_private_docs="$withval"],[with_private_docs="no"])
289 AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
291 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
294 dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
297 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
301 dnl ******************************
303 dnl ******************************
304 AC_MSG_CHECKING([for Win32])
308 NO_UNDEFINED='-no-undefined'
309 SOCKET_LIBS='-lws2_32 -ldnsapi'
311 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
312 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
313 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
320 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
327 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
330 AC_MSG_RESULT([$os_win32])
331 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
332 AC_SUBST(NO_UNDEFINED)
333 AC_SUBST(SOCKET_LIBS)
334 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
336 dnl **************************************
337 dnl Check for posix compatible sys/wait.h
338 dnl **************************************
341 dnl ************************************
342 dnl Check for posix compatible alloca()
343 dnl ************************************
346 dnl ******************************
347 dnl Checks for functions
348 dnl ******************************
349 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
351 dnl ***********************************
352 dnl Check for base dependencies early.
353 dnl ***********************************
354 PKG_CHECK_MODULES(GNOME_PLATFORM,
355 [gio-2.0 >= glib_minimum_version
356 gmodule-2.0 >= glib_minimum_version
357 gtk+-3.0 >= gtk_minimum_version
358 gconf-2.0 >= gconf_minimum_version
359 libxml-2.0 >= libxml_minimum_version
360 libsoup-2.4 >= libsoup_minimum_version
361 libgdata >= libgdata_minimum_version])
363 if test x$os_win32 = xno; then
364 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
367 dnl ******************************
368 dnl DBus-glib stuff, to initialize thread for GConf, which is using it
369 dnl this is returned back only temporarily and wil lbe removed as soon
370 dnl as eds will stop using GConf completely
371 dnl ******************************
372 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.6)
373 AC_SUBST(DBUS_GLIB_CFLAGS)
374 AC_SUBST(DBUS_GLIB_LIBS)
376 dnl *******************************
377 dnl Check for GNOME Online Accounts
378 dnl *******************************
380 [AS_HELP_STRING([--enable-goa],
381 [enable GNOME Online Accounts support (default=yes)])],
382 [enable_goa=$enableval], [enable_goa=yes])
383 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
384 AC_MSG_RESULT([$enable_goa])
385 if test "x$enable_goa" = xyes; then
386 PKG_CHECK_MODULES([GOA], [goa-1.0 >= goa_minimum_version],,
387 [AC_MSG_ERROR([goa-1.0 not found (or version < goa_minimum_version),
388 If you want to disable GNOME Online Accounts support,
389 please append --disable-goa to configure.])])
391 PKG_CHECK_MODULES([OAUTH], [oauth >= oauth_minimum_version],,
392 [AC_MSG_ERROR([oauth not found (or version < oauth_minimum_version),
393 If you want to disable GNOME Online Accounts support,
394 please append --disable-goa to configure.])])
396 if `$PKG_CONFIG --atleast-version=0.9.1 libgdata`; then
397 AC_DEFINE(HAVE_GOA,1,[Have goa-1.0 and libgdata >= 0.9.1])
400 libgdata >= 0.9.1 is required for GNOME Online Accounts support.
401 If you want to disable GNOME Online Accounts support, please
402 append --disable-goa to configure.])
405 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
407 dnl ***********************************
408 dnl Check for GNOME Keyring.
409 dnl ***********************************
410 if test x$os_win32 = xno; then
411 PKG_CHECK_MODULES(GNOME_KEYRING,
412 [gnome-keyring-1 >= gnome_keyring_minimum_version])
414 AC_SUBST(GNOME_KEYRING_CFLAGS)
415 AC_SUBST(GNOME_KEYRING_LIBS)
417 dnl **********************************************************
418 dnl gcr-base is needed for secure password exchange over D-Bus
419 dnl **********************************************************
420 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
421 AC_SUBST(GCR_BASE_CFLAGS)
422 AC_SUBST(GCR_BASE_LIBS)
424 LIBICAL_REQUIRED=libical_minimum_version
425 AC_SUBST(LIBICAL_REQUIRED)
427 dnl ******************************
429 dnl ******************************
430 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
432 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
433 [AC_MSG_ERROR([No regex library found])])])
436 dnl ******************************
438 dnl ******************************
440 AS_HELP_STRING([--with-libdb=PREFIX],
441 [Prefix where libdb is installed]),
442 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
444 DB_CFLAGS="-I$libdb_prefix/include"
445 DB_LIBS="-L$libdb_prefix/lib -ldb"
447 AC_MSG_CHECKING([Berkeley DB])
448 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
449 save_libs=$LIBS; LIBS="$DB_LIBS"
450 AC_LINK_IFELSE([AC_LANG_PROGRAM(
452 [[db_create(NULL, NULL, 0)]])],
453 [AC_MSG_RESULT([yes])],
454 [AC_MSG_ERROR([Cannot find libdb])])
460 dnl ******************************
462 dnl ******************************
466 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
467 AC_LINK_IFELSE([AC_LANG_PROGRAM(
474 cd = iconv_open ("UTF-8", "ISO-8859-1");
476 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
478 if test "x$ac_cv_libiconv" = "xyes"; then
480 if test "x$os_win32" = "xyes"; then
481 dnl Don't pointlessly auto-export the global symbols
482 dnl from a potentially static libiconv.a
483 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
488 AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
491 if test "x$have_iconv" = "xyes"; then
492 if test "x$ac_cv_libiconv" = "xno"; then
493 AC_CHECK_FUNCS(gnu_get_libc_version)
495 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
496 AC_RUN_IFELSE([AC_LANG_SOURCE([[
500 #ifdef HAVE_GNU_GET_LIBC_VERSION
501 #include <gnu/libc-version.h>
504 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
505 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
506 char *transbuf = malloc (10), *trans = transbuf;
508 size_t jp_len = strlen (jp), utf8_len = 10;
509 size_t utf8_real_len = strlen (utf8);
511 #ifdef HAVE_GNU_GET_LIBC_VERSION
512 /* glibc 2.1.2's iconv is broken in hard to test ways. */
513 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
517 cd = iconv_open ("UTF-8", "ISO-2022-JP");
518 if (cd == (iconv_t) -1)
520 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
522 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
526 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
529 if test "x$have_iconv" = "xno"; then
530 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
534 CFLAGS="$CFLAGS -I$srcdir"
536 AC_MSG_CHECKING([preferred charset name formats for system iconv])
537 AC_RUN_IFELSE([AC_LANG_SOURCE([[
539 #include "iconv-detect.c"
541 [AC_MSG_RESULT([found])],
542 [AC_MSG_RESULT([not found])
544 *** The iconv-detect program was unable to determine the
545 *** preferred charset name formats recognized by your
546 *** iconv library. It is suggested that you install a
547 *** working iconv library such as the one found at
548 *** ftp://ftp.gnu.org/pub/gnu/libiconv
550 [if test "x$os_win32" = xyes; then
551 AC_MSG_RESULT([using known win32 result])
552 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
553 echo >>iconv-detect.h
554 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
555 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
556 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
558 AC_MSG_RESULT([unknown])
560 *** We can't determine the preferred charset name formats
561 *** recognized by your iconv library. You are
562 *** cross-compiling and supposed to know what you are doing.
563 *** Please construct the iconv-detect.h file manually.
568 CFLAGS="$save_CFLAGS"
571 AC_ARG_ENABLE([backtraces],
572 [AS_HELP_STRING([--enable-backtraces],
573 [enable backtraces for e_pointer_tracker (default=no)])],
574 [enable_backtraces=$enableval], [enable_backtraces=no])
576 if test "x$enable_backtraces" = xyes; then
577 dnl ****************************
578 dnl Check for backtrace_symbols function and dwfl from elfutils
579 dnl ****************************
580 AC_MSG_CHECKING([libc backtrace_symbols function])
581 AC_LINK_IFELSE([AC_LANG_PROGRAM(
582 [[#include <execinfo.h>]],
583 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
584 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
585 AC_MSG_RESULT([$ac_cv_have_bsf])
587 if test "x$ac_cv_have_bsf" = xyes; then
590 AC_MSG_CHECKING([elfutils/libdwfl])
591 AC_LINK_IFELSE([AC_LANG_PROGRAM(
592 [[#include <elfutils/libdwfl.h>]],
596 Dwarf_Addr module_low_addr;
599 dwfl_standard_find_debuginfo;
600 dwfl_linux_proc_find_elf;
602 dwfl_linux_proc_report (NULL, 1);
603 dwfl_report_end (NULL, NULL, NULL);
605 dwfl_module_addrname (NULL, NULL);
606 dwfl_module_getsrc (NULL, NULL);
607 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
608 DWARF_CB_ABORT; DWARF_CB_OK;
609 dwfl_getmodules (NULL, NULL, NULL, 0);
611 [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
612 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
616 if test "x$ac_cv_have_elfdwfl" = xyes; then
618 AC_SUBST(LIBDWFL_LIBS)
623 dnl **********************************
624 dnl Check for nl_langinfo and CODESET
625 dnl **********************************
626 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
627 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
628 [[#include <langinfo.h>]],
629 [[char *codeset = nl_langinfo (CODESET);]]
630 )],[ac_cv_langinfo_codeset=yes],[ac_cv_langinfo_codeset=no])
631 if test "x$ac_cv_langinfo_codeset" = "xyes"; then
632 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
634 AC_MSG_RESULT([$ac_cv_langinfo_codeset])
636 dnl *******************************************************
637 dnl Check to see if strftime supports the use of %l and %k
638 dnl *******************************************************
639 AC_MSG_CHECKING([for %l and %k support in strftime])
640 AC_RUN_IFELSE([AC_LANG_SOURCE(
641 [[ #include <stdlib.h>
644 int main(int argc, char **argv) {
650 timeinfo=localtime(&rawtime);
652 strftime(buf, 10, "%lx%k", timeinfo);
654 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
661 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
662 AC_MSG_RESULT([$ac_cv_lkstrftime])
664 dnl ********************************************************************************
665 dnl security extension support (SSL and S/MIME)
667 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
668 dnl needed by Camel (SSL and S/MIME).
670 dnl The Evolution security extensions are only built if these libraries are found
671 dnl ********************************************************************************
674 AC_ARG_ENABLE([smime],
675 AS_HELP_STRING([--enable-smime],
676 [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
677 [enable_smime="$enableval"],[enable_smime="yes"])
679 AC_ARG_WITH([nspr-includes],
680 AS_HELP_STRING([--with-nspr-includes],
681 [Prefix of Mozilla nspr4 includes.]),
682 [with_nspr_includes="$withval"])
684 AC_ARG_WITH([nspr-libs],
685 AS_HELP_STRING([--with-nspr-libs],
686 [Prefix of Mozilla nspr4 libs.]),
687 [with_nspr_libs="$withval"])
689 AC_ARG_WITH([nss-includes],
690 AS_HELP_STRING([--with-nss-includes],
691 [Prefix of Mozilla nss3 includes.]),
692 [with_nss_includes="$withval"])
694 AC_ARG_WITH([nss-libs],
695 AS_HELP_STRING([--with-nss-libs],
696 [Prefix of Mozilla nss3 libs.]),
697 [with_nss_libs="$withval"])
699 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
705 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
706 if test "x${check_manually}" = "xno"; then
707 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
708 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
709 for pc in $mozilla_nspr_pcs; do
710 if $PKG_CONFIG --exists $pc; then
717 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
718 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
719 for pc in $mozilla_nss_pcs; do
720 if $PKG_CONFIG --exists $pc; then
727 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
728 if test "x$enable_smime" = "xyes"; then
729 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
732 MANUAL_NSPR_CFLAGS=""
743 if test "x${check_manually}" = "xyes"; then
744 dnl ******************
746 dnl ******************
747 AC_MSG_CHECKING([for Mozilla nspr4 includes])
748 CPPFLAGS_save="$CPPFLAGS"
749 if test -n "$with_nspr_includes"; then
750 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
753 AC_CHECK_HEADERS(nspr.h prio.h,
754 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
755 CPPFLAGS="$CPPFLAGS_save"
757 if test "x${moz_nspr_includes}" = "xyes"; then
758 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
760 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
762 AC_MSG_RESULT([$moz_nspr_includes])
764 AC_MSG_CHECKING([for Mozilla nspr libraries])
765 CFLAGS_save="$CFLAGS"
766 LDFLAGS_save="$LDFLAGS"
768 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
770 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
772 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
773 if test -n "${with_nspr_libs}"; then
774 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
779 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
780 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
782 CFLAGS="$CFLAGS_save"
783 LDFLAGS="$LDFLAGS_save"
786 if test "x${moz_nspr_libs}" = "xyes"; then
787 if test -n "${with_nspr_libs}"; then
788 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
790 MANUAL_NSPR_LIBS="$nsprlibs"
793 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
795 AC_MSG_RESULT([$moz_nspr_libs])
797 dnl *****************
799 dnl *****************
800 AC_MSG_CHECKING([for Mozilla nss3 includes])
801 CPPFLAGS_save="$CPPFLAGS"
802 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
804 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
805 [moz_nss_includes="yes"],[moz_nss_includes="no"])
806 CPPFLAGS="$CPPFLAGS_save"
808 if test "x${moz_nss_includes}" = "xyes"; then
809 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
811 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
813 AC_MSG_RESULT($moz_nss_includes)
815 AC_MSG_CHECKING([for Mozilla nss libraries])
816 LDFLAGS_save="$LDFLAGS"
818 nsslibs="-lssl3 -lsmime3 -lnss3"
820 LIBS="$nsslibs $nsprlibs"
821 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
822 if test -n "${with_nss_libs}"; then
823 LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
825 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
828 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
829 [moz_nss_libs="yes"],[moz_nss_libs="no"])
830 LDFLAGS="$LDFLAGS_save"
833 if test "x${moz_nss_libs}" = "xyes"; then
834 if test "x${enable_smime}" = "xyes"; then
835 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
838 if test -n "${with_nss_libs}"; then
839 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
841 MANUAL_NSS_LIBS="$nsslibs"
844 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
846 AC_MSG_RESULT([$moz_nss_libs])
848 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
849 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
852 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
854 dnl For pkgconfig files.
855 AC_SUBST(mozilla_nss)
856 AC_SUBST(mozilla_nspr)
858 AC_SUBST(MANUAL_NSPR_CFLAGS)
859 AC_SUBST(MANUAL_NSPR_LIBS)
860 AC_SUBST(MANUAL_NSS_CFLAGS)
861 AC_SUBST(MANUAL_NSS_LIBS)
863 dnl ******************************
864 dnl system mail stuff
865 dnl ******************************
866 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
867 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
869 AC_MSG_CHECKING([system mail directory])
870 if test -d /var/mail -a '!' -h /var/mail ; then
871 system_mail_dir="/var/mail"
873 system_mail_dir="/var/spool/mail"
875 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
877 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
879 CAMEL_LOCK_HELPER_USER=""
880 CAMEL_LOCK_HELPER_GROUP=""
881 system_mail_perm="world writable"
884 CAMEL_LOCK_HELPER_USER=""
885 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
886 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
889 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
890 CAMEL_LOCK_HELPER_GROUP=""
891 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
894 CAMEL_LOCK_HELPER_USER=""
895 CAMEL_LOCK_HELPER_GROUP=""
896 system_mail_perm="???"
900 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
901 AC_SUBST(CAMEL_LOCK_HELPER_USER)
902 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
904 dnl ******************************
906 dnl ******************************
907 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
908 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
909 [[ #include <time.h> ]],
914 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
915 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
916 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
918 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
919 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
920 [[ #include <time.h> ]],
922 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
923 if test "x$ac_cv_var_timezone" = "xyes"; then
924 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
925 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
926 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
927 [[ #include <time.h> ]],
929 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
930 if test "x$ac_cv_var_altzone" = "xyes"; then
931 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
934 AC_MSG_ERROR([unable to find a way to determine timezone])
938 dnl ******************************
939 dnl ctime_r prototype
940 dnl ******************************
941 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
943 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
944 [[ #include <time.h> ]],
947 ctime_r (&date, buf, 100); ]]
948 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
951 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
952 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
955 dnl ******************************
956 dnl gethostbyname_r prototype
957 dnl ******************************
958 AC_CHECK_FUNCS(gethostbyname_r,[
959 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
961 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
963 #include "confdefs.h"
964 #include <sys/types.h>
965 #include <sys/socket.h>
966 #include <netinet/in.h>
968 #define BUFSIZE (sizeof(struct hostent)+10)
972 char buffer[BUFSIZE];
975 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
977 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
980 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
981 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
984 dnl ******************************
985 dnl gethostbyaddr_r prototype
986 dnl ******************************
987 AC_CHECK_FUNCS(gethostbyaddr_r,[
988 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
990 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
992 #include "confdefs.h"
993 #include <sys/types.h>
994 #include <sys/socket.h>
995 #include <netinet/in.h>
997 #define BUFSIZE (sizeof(struct hostent)+10)
1000 struct hostent hent;
1001 char buffer[BUFSIZE];
1002 int bufsize=BUFSIZE;
1004 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1005 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1008 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1009 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1012 dnl ******************************
1013 dnl stat(v)fs location/type
1014 dnl ******************************
1015 AC_CHECK_HEADER([sys/statvfs.h],
1016 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1017 [[ #if HAVE_SYS_STATVFS_H
1018 #include <sys/statvfs.h>
1021 AC_CHECK_FUNCS(statvfs)
1023 AC_CHECK_HEADER([sys/param.h],
1024 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1025 [[ #if HAVE_SYS_PARAM_H
1026 #include <sys/param.h>
1029 AC_CHECK_HEADER([sys/mount.h],
1030 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1031 [[ #if HAVE_SYS_MOUNT_H
1032 #include <sys/mount.h>
1035 AC_CHECK_FUNCS(statfs)
1037 dnl ******************************
1038 dnl IPv6 support and getaddrinfo calls
1039 dnl ******************************
1040 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1042 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1043 [[ #include "confdefs.h"
1044 #include <sys/types.h>
1045 #include <sys/socket.h>
1046 #include <netinet/in.h>
1050 [[ #ifndef NI_MAXHOST
1051 #define NI_MAXHOST 1025
1055 #define NI_MAXSERV 32
1058 struct addrinfo hints, *res;
1059 struct sockaddr_in6 sin6;
1061 char host[NI_MAXHOST];
1062 char serv[NI_MAXSERV];
1064 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1066 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1067 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1070 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1071 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1072 if test "x$enable_ipv6" = "xyes" ; then
1073 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1077 AC_ARG_ENABLE([ipv6],
1078 AS_HELP_STRING([--enable-ipv6=no/yes],
1079 [Enable support for resolving IPv6 addresses.]),
1080 [enable_ipv6=$enableval],[enable_ipv6=yes])
1081 if test "x$enable_ipv6" = "xyes"; then
1083 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1084 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1085 [[ #include "confdefs.h"
1086 #include <sys/types.h>
1087 #include <sys/socket.h>
1088 #include <netinet/in.h>
1091 [[ struct addrinfo hints;
1092 hints.ai_flags = AI_ADDRCONFIG;
1094 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1100 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1102 AC_CHECK_HEADER([wspiapi.h],
1103 [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1105 dnl **********************************
1106 dnl Weather calendar backend support
1107 dnl **********************************
1108 AC_MSG_CHECKING([if we should build the weather calendar backend])
1109 AC_ARG_ENABLE([weather],
1110 [AS_HELP_STRING([--enable-weather],
1111 [Build the weather calendar backend (default=yes)])],
1112 [use_gweather=$enableval], [use_gweather=yes])
1114 AC_MSG_RESULT([$use_gweather])
1115 if test "x$use_gweather" = "xyes"; then
1116 PKG_CHECK_MODULES([LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1117 [AC_MSG_ERROR([The weather calendar backend requires GWeather >= gweather_minimum_version. Alternatively, you may specify --disable-weather as a configure option to avoid building the backend.])])
1119 dnl gweather-3.5 introduces API changes we do not yet support.
1120 if `$PKG_CONFIG --atleast-version=3.5 gweather-3.0`; then
1121 AC_MSG_ERROR([gweather-3.5 is not yet supported. Install gweather-3.4 or specify --disable-weather as a configure option to avoid building the backend.])
1124 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1126 dnl ******************************
1128 dnl ******************************
1129 AC_ARG_ENABLE([nntp],
1130 AS_HELP_STRING([--enable-nntp],
1131 [Build Usenet news (NNTP) backend]),
1132 [enable_nntp=$enableval],[enable_nntp=yes])
1133 if test "x$enable_nntp" = "xyes"; then
1134 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1139 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1141 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1143 dnl ******************************
1145 dnl ******************************
1146 AC_ARG_ENABLE([dot-locking],
1147 AS_HELP_STRING([--enable-dot-locking=yes/no],
1148 [Enable support for locking mail files with dot locking]),
1149 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1151 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1152 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1158 AC_ARG_ENABLE([file-locking],
1159 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1160 [Enable support for locking mail files with file locking]),
1161 [],[enable_file_locking=fcntl])
1163 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1164 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1167 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1168 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1175 dnl ******************************
1176 dnl sendmail operation
1177 dnl ******************************
1178 AC_MSG_CHECKING([for SunOS broken spool format])
1179 if test "x$host_os" = "xsunos" ; then
1180 with_broken_spool="yes"
1183 AC_ARG_WITH([broken-spool],
1184 AS_HELP_STRING([--with-broken-spool=yes/no],
1185 [Using SunOS/Solaris sendmail which has a broken spool format]),
1186 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1188 if test "x$with_broken_spool" = "xyes"; then
1189 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1192 AC_MSG_RESULT([$with_broken_spool])
1194 dnl ******************************
1195 dnl DBus call timeout
1196 dnl ******************************
1198 AC_ARG_WITH([dbus-call-timeout],
1199 AS_HELP_STRING([--with-dbus-call-timeout=miliseconds],
1200 [Default timeout used when invoking g_dbus_proxy_call() family functions in EBook and ECal library (default=-1)]),
1201 [ac_cv_dbus_call_timeout=$withval],[ac_cv_dbus_call_timeout=-1])
1203 DEFAULT_EDS_DBUS_TIMEOUT=$ac_cv_dbus_call_timeout
1204 AC_SUBST(DEFAULT_EDS_DBUS_TIMEOUT)
1209 EVO_KRB5_SUPPORT(no)
1211 dnl ******************************
1213 dnl ******************************
1216 dnl ******************************
1218 dnl ******************************
1219 if test "x$os_win32" != "xyes"; then
1221 case $with_openldap in
1226 case $with_static_ldap in
1228 msg_ldap="$with_openldap (static)"
1231 msg_ldap="$with_openldap (dynamic)"
1236 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1237 if test "x$with_openldap" = "xno" ; then
1238 EVO_SUNLDAP_CHECK(no)
1239 case $with_sunldap in
1244 case $with_static_sunldap in
1246 msg_ldap="$with_sunldap (static)"
1249 msg_ldap="$with_sunldap (dynamic)"
1256 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1258 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1260 dnl Win32 LDAP support
1261 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1262 LDAP_LIBS="-lwldap32"
1263 AC_SUBST(LDAP_CFLAGS)
1265 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1266 AM_CONDITIONAL(ENABLE_LDAP, true)
1267 AM_CONDITIONAL(SUNLDAP, false)
1271 dnl ******************************
1272 dnl GObject marshalling
1273 dnl ******************************
1276 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1277 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1278 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1280 dnl ******************************
1281 dnl Code coverage flags
1282 dnl ******************************
1284 AC_ARG_ENABLE([code-coverage],
1285 AS_HELP_STRING([--enable-code-coverage], [compile with code coverage code]),
1286 [enable_code_coverage=$enableval], [enable_code_coverage=no])
1288 if test "x$GCC" = "xyes"; then
1289 if test "x$enable_code_coverage" = "xyes"; then
1290 CODE_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage -O0 -ggdb"
1291 CODE_COVERAGE_LDFLAGS="-lgcov"
1295 AC_SUBST([CODE_COVERAGE_CFLAGS])
1296 AC_SUBST([CODE_COVERAGE_LDFLAGS])
1298 dnl ******************************
1299 dnl Utility macro to set compiler flags for a specific lib.
1300 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1301 dnl ******************************
1302 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1303 PKG_CHECK_MODULES([$1], [$2])
1304 $1_CFLAGS="[$]$1_CFLAGS $3 "
1305 $1_LIBS="[$]$1_LIBS $4 "
1308 dnl ******************************
1310 dnl ******************************
1311 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1313 dnl ******************************
1314 dnl libedataserver flags
1315 dnl ******************************
1316 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1318 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1319 AC_SUBST(E_DATA_SERVER_CFLAGS)
1320 AC_SUBST(E_DATA_SERVER_LIBS)
1322 dnl ******************************
1323 dnl libedataserverui
1324 dnl ******************************
1325 E_DATA_SERVER_UI_DEPS="gtk+-3.0 libxml-2.0 gconf-2.0"
1327 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, , )
1328 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1329 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1331 if test "x$enable_maintainer_mode" = "xyes" ; then
1332 FACTORY_GTK_CFLAGS=$E_DATA_SERVER_UI_CFLAGS
1333 FACTORY_GTK_LIBS=$E_DATA_SERVER_UI_LIBS
1334 AC_SUBST(FACTORY_GTK_CFLAGS)
1335 AC_SUBST(FACTORY_GTK_LIBS)
1338 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 gnome-keyring-1 libxml-2.0 gconf-2.0"
1340 dnl ******************************
1341 dnl libebackend flags
1342 dnl ******************************
1343 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1344 AC_SUBST(E_BACKEND_CFLAGS)
1345 AC_SUBST(E_BACKEND_LIBS)
1347 dnl ******************************
1348 dnl evolution-addressbook flags
1349 dnl ******************************
1350 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 gconf-2.0"
1352 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1353 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1354 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1356 dnl ******************************
1357 dnl evolution-calendar flags
1358 dnl ******************************
1359 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libxml-2.0 gconf-2.0"
1362 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1363 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1364 dnl to differentiate between <libical/ical.h> and <ical.h>
1365 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1366 dnl libical is fixed, we have to work-around the buggy CFlags.
1368 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1369 LIBICAL_EXTRA_LIBS=""
1370 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1371 AC_SUBST(LIBICAL_EXTRA_LIBS)
1373 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1374 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1375 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1377 dnl ****************************
1378 dnl Check for ical_set_unknown_token_handling_setting function
1379 dnl ****************************
1380 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1381 save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1382 save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1383 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1384 [[#include <libical/ical.h>]],
1385 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1386 [AC_DEFINE(HAVE_ICAL_UNKNOWN_TOKEN_HANDLING, 1, [libical provides ical_set_unknown_token_handling_setting function]) ac_cv_have_iuth=yes],[ac_cv_have_iuth=no])
1389 AC_MSG_RESULT([$ac_cv_have_iuth])
1391 dnl ******************************
1393 dnl ******************************
1394 LIBGDATA_REQUIRED=libgdata_minimum_version
1395 AC_SUBST(LIBGDATA_REQUIRED)
1397 EVO_SET_COMPILE_FLAGS(GDATA, libgdata)
1398 AC_SUBST(GDATA_CFLAGS)
1399 AC_SUBST(GDATA_LIBS)
1401 dnl ******************************
1403 dnl ******************************
1404 LIBSOUP_REQUIRED=libsoup_minimum_version
1405 AC_SUBST(LIBSOUP_REQUIRED)
1407 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1408 AC_SUBST(SOUP_CFLAGS)
1411 dnl ******************************
1413 dnl ******************************
1414 SQLITE_REQUIRED=sqlite_minimum_version
1415 AC_SUBST(SQLITE_REQUIRED)
1418 dnl deflateInit is a #define, use deflateEnd instead
1419 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1421 if test "x$zlib_found" = "xfalse"; then
1422 AC_MSG_ERROR([*** zlib is required])
1425 dnl ******************************
1426 dnl Checks for large file support
1427 dnl ******************************
1428 AC_ARG_ENABLE([largefile],
1429 AS_HELP_STRING([--enable-largefile],
1430 [enable support for large files [[default=no]]]),
1431 [],[enable_largefile="yes"])
1433 if test "x$enable_largefile" != "xno"; then
1435 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1436 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1437 [[ #include <sys/types.h>
1438 #include <sys/stat.h>
1441 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1442 )],[ac_cv_largefile64_source="no"],
1443 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1444 [[ #define _LARGEFILE64_SOURCE
1445 #include <sys/types.h>
1446 #include <sys/stat.h>
1449 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1450 [ac_cv_largefile64_source="unknown"])])
1453 enable_largefile="no"
1455 if test "x$ac_cv_largefile64_source" = "xyes"; then
1456 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1457 enable_largefile="yes"
1458 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1459 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1462 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1463 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1464 enable_largefile="yes"
1467 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1468 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1469 enable_largefile="yes"
1472 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1476 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1478 EVO_SET_COMPILE_FLAGS(CAMEL, gio-2.0 gmodule-2.0 $mozilla_nss sqlite3 >= sqlite_minimum_version, $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS, -lz $KRB5_LIBS $MANUAL_NSS_LIBS)
1479 AC_SUBST(CAMEL_CFLAGS)
1480 AC_SUBST(CAMEL_LIBS)
1482 dnl ******************************
1483 dnl Special directories
1484 dnl ******************************
1486 dnl If you add something here, consider whether or not you also
1487 dnl need to add it to one or more .pc.in files (for Connector,
1490 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1491 AC_SUBST(privdatadir)
1493 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1494 AC_SUBST(privincludedir)
1496 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1497 AC_SUBST(privlibdir)
1499 imagesdir='${datadir}'/pixmaps/evolution-data-server
1502 moduledir='${libdir}'/evolution-data-server/registry-modules
1505 ebook_backenddir='${libdir}'/evolution-data-server/addressbook-backends
1506 AC_SUBST(ebook_backenddir)
1508 ecal_backenddir='${libdir}'/evolution-data-server/calendar-backends
1509 AC_SUBST(ecal_backenddir)
1511 ro_sourcesdir='${datadir}'/evolution-data-server-$BASE_VERSION/ro-sources
1512 AC_SUBST(ro_sourcesdir)
1514 rw_sourcesdir='${datadir}'/evolution-data-server-$BASE_VERSION/rw-sources
1515 AC_SUBST(rw_sourcesdir)
1517 if test "x$use_gweather" = "xyes"; then
1518 weatherdatadir="$privdatadir/weather"
1519 AC_SUBST(weatherdatadir)
1522 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1523 camel_providerdir='${libdir}'/evolution-data-server/camel-providers
1524 AC_SUBST(camel_providerdir)
1526 dnl *******************
1527 dnl D-BUS service stuff
1528 dnl *******************
1529 m4_pattern_allow([AM_V_GEN])
1530 EVO_SUBST_SERVICE_RULE='%.service: %.service.in Makefile ; $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" -e s"|\@ADDRESS_BOOK_DBUS_SERVICE_NAME\@|$(ADDRESS_BOOK_DBUS_SERVICE_NAME)|" -e "s|\@CALENDAR_DBUS_SERVICE_NAME\@|$(CALENDAR_DBUS_SERVICE_NAME)|" -e "s|\@SOURCES_DBUS_SERVICE_NAME\@|$(SOURCES_DBUS_SERVICE_NAME)|" $< > $@'
1531 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1533 dnl ******************************
1535 dnl ******************************
1536 AC_PATH_PROG(GCONFTOOL, gconftool-2, [no])
1539 dnl ******************************
1541 dnl ******************************
1542 AC_PATH_PROG(GPERF, gperf, [no])
1543 if test "x$GPERF" = "xno"; then
1544 AC_MSG_ERROR([You need gperf to build evolution-data-server])
1547 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1549 dnl ******************************
1551 dnl ******************************
1552 AC_ARG_ENABLE(vala-bindings,
1553 AC_HELP_STRING([--enable-vala-bindings],
1554 [build the EXPERIMENTAL Vala bindings]),
1555 enable_vala_bindings=$enableval,
1556 enable_vala_bindings=no)
1558 if test x$enable_vala_bindings = xyes; then
1559 if test "x$INTROSPECTION_SCANNER" = x; then
1560 AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1563 AM_PROG_VALAC([0.13.0])
1566 AC_PATH_PROG(VALAC, valac, valac)
1570 AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1572 if test "x$VAPIGEN" = "xfalse"; then
1573 AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1579 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1582 dnl ******************************
1584 dnl ******************************
1586 export privincludedir
1591 evolution-data-server-zip
1592 evolution-data-server.pc
1593 addressbook/Makefile
1594 addressbook/libebook/Makefile
1595 addressbook/libebook/libebook.pc
1596 addressbook/libedata-book/Makefile
1597 addressbook/libedata-book/libedata-book.pc
1598 addressbook/libegdbus/Makefile
1599 addressbook/backends/Makefile
1600 addressbook/backends/file/Makefile
1601 addressbook/backends/vcf/Makefile
1602 addressbook/backends/ldap/Makefile
1603 addressbook/backends/google/Makefile
1604 addressbook/backends/webdav/Makefile
1607 calendar/libecal/Makefile
1608 calendar/libecal/libecal.pc
1609 calendar/libedata-cal/Makefile
1610 calendar/libedata-cal/libedata-cal.pc
1611 calendar/libegdbus/Makefile
1612 calendar/backends/Makefile
1613 calendar/backends/caldav/Makefile
1614 calendar/backends/file/Makefile
1615 calendar/backends/http/Makefile
1616 calendar/backends/contacts/Makefile
1617 calendar/backends/weather/Makefile
1619 camel/providers/Makefile
1620 camel/providers/imap/Makefile
1621 camel/providers/imapx/Makefile
1622 camel/providers/local/Makefile
1623 camel/providers/nntp/Makefile
1624 camel/providers/pop3/Makefile
1625 camel/providers/sendmail/Makefile
1626 camel/providers/smtp/Makefile
1627 camel/tests/Makefile
1628 camel/tests/folder/Makefile
1629 camel/tests/lib/Makefile
1630 camel/tests/message/Makefile
1631 camel/tests/mime-filter/Makefile
1632 camel/tests/misc/Makefile
1633 camel/tests/smime/Makefile
1635 libebackend/Makefile
1636 libebackend/libebackend.pc
1637 libedataserver/Makefile
1638 libedataserver/eds-version.h
1639 libedataserver/libedataserver.pc
1640 libedataserverui/Makefile
1641 libedataserverui/libedataserverui.pc
1644 services/evolution-addressbook-factory/Makefile
1645 services/evolution-calendar-factory/Makefile
1646 services/evolution-source-registry/Makefile
1648 tests/libebook/Makefile
1649 tests/libebook/client/Makefile
1650 tests/libebook/vcard/Makefile
1651 tests/libecal/Makefile
1652 tests/libecal/client/Makefile
1653 tests/libedata-cal/Makefile
1654 tests/libedataserver/Makefile
1655 tests/libedataserverui/Makefile
1657 docs/reference/Makefile
1658 docs/reference/addressbook/Makefile
1659 docs/reference/addressbook/libebook/Makefile
1660 docs/reference/addressbook/libedata-book/Makefile
1661 docs/reference/calendar/Makefile
1662 docs/reference/calendar/libecal/Makefile
1663 docs/reference/calendar/libedata-cal/Makefile
1664 docs/reference/camel/Makefile
1665 docs/reference/libedataserver/Makefile
1666 docs/reference/libedataserverui/Makefile
1667 docs/reference/libebackend/Makefile
1668 docs/reference/private/Makefile
1675 evolution-data-server has been configured as follows:
1676 Weather calendar: $use_gweather
1677 Mail Directory: $system_mail_dir, $system_mail_perm
1678 LDAP support: $msg_ldap
1679 NNTP support: $msg_nntp
1680 Kerberos 5: $msg_krb5
1681 SMIME support: $msg_smime
1682 IPv6 support: $msg_ipv6
1683 Dot Locking: $msg_dot
1684 File Locking: $msg_file
1685 Large files: $enable_largefile
1686 Gtk Doc: $enable_gtk_doc
1687 Introspection: $enable_introspection
1688 Vala bindings: $enable_vala_bindings
1689 GNOME Online Accounts $enable_goa
1690 Code coverage (gcov): $enable_code_coverage