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([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
42 m4_define([libsoup_minimum_version], [2.38.1])
43 m4_define([libgdata_minimum_version], [0.10])
44 m4_define([oauth_minimum_version], [0.9.4])
45 m4_define([sqlite_minimum_version], [3.5])
46 m4_define([libical_minimum_version], [0.43])
49 m4_define([goa_minimum_version], [3.2])
50 m4_define([gweather_minimum_version], [2.90.0])
52 AC_SUBST([BASE_VERSION],[base_version])
53 AC_SUBST([API_VERSION],[api_version])
54 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
55 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
57 EDS_MAJOR_VERSION=eds_major_version
58 EDS_MINOR_VERSION=eds_minor_version
59 EDS_MICRO_VERSION=eds_micro_version
63 dnl ******************************
65 dnl ******************************
66 ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook3"
67 CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar2"
68 SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources0"
71 ADDRESS_BOOK_DBUS_SERVICE_NAME,
72 ["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
73 [D-Bus service name for the address book factory])
76 CALENDAR_DBUS_SERVICE_NAME,
77 ["$CALENDAR_DBUS_SERVICE_NAME"],
78 [D-Bus service name for the calendar factory])
81 SOURCES_DBUS_SERVICE_NAME,
82 ["$SOURCES_DBUS_SERVICE_NAME"],
83 [D-Bus service name for the source registry])
85 AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
86 AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
87 AC_SUBST(SOURCES_DBUS_SERVICE_NAME)
89 dnl ******************************
90 dnl Libtool versioning
91 dnl ******************************
92 LIBEDATASERVER_CURRENT=16
93 LIBEDATASERVER_REVISION=0
96 LIBEDATASERVERUI_CURRENT=3
97 LIBEDATASERVERUI_REVISION=0
98 LIBEDATASERVERUI_AGE=0
104 LIBEDATACAL_CURRENT=17
105 LIBEDATACAL_REVISION=0
108 LIBEDATABOOK_CURRENT=14
109 LIBEDATABOOK_REVISION=0
120 LIBEBACKEND_CURRENT=3
121 LIBEBACKEND_REVISION=0
124 AC_SUBST(EDS_MAJOR_VERSION)
125 AC_SUBST(EDS_MINOR_VERSION)
126 AC_SUBST(EDS_MICRO_VERSION)
127 AC_SUBST(LIBEDATASERVER_CURRENT)
128 AC_SUBST(LIBEDATASERVER_REVISION)
129 AC_SUBST(LIBEDATASERVER_AGE)
130 AC_SUBST(LIBEDATASERVERUI_CURRENT)
131 AC_SUBST(LIBEDATASERVERUI_REVISION)
132 AC_SUBST(LIBEDATASERVERUI_AGE)
133 AC_SUBST(LIBECAL_CURRENT)
134 AC_SUBST(LIBECAL_REVISION)
135 AC_SUBST(LIBECAL_AGE)
136 AC_SUBST(LIBEDATACAL_CURRENT)
137 AC_SUBST(LIBEDATACAL_REVISION)
138 AC_SUBST(LIBEDATACAL_AGE)
139 AC_SUBST(LIBEBOOK_CURRENT)
140 AC_SUBST(LIBEBOOK_REVISION)
141 AC_SUBST(LIBEBOOK_AGE)
142 AC_SUBST(LIBEDATABOOK_CURRENT)
143 AC_SUBST(LIBEDATABOOK_REVISION)
144 AC_SUBST(LIBEDATABOOK_AGE)
145 AC_SUBST(LIBCAMEL_CURRENT)
146 AC_SUBST(LIBCAMEL_REVISION)
147 AC_SUBST(LIBCAMEL_AGE)
148 AC_SUBST(LIBEBACKEND_CURRENT)
149 AC_SUBST(LIBEBACKEND_REVISION)
150 AC_SUBST(LIBEBACKEND_AGE)
152 dnl **************************************
153 dnl Put the ACLOCAL flags in the Makefile
154 dnl **************************************
155 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
157 dnl ******************************
158 dnl Compiler Warning Flags
159 dnl ******************************
160 AS_COMPILER_FLAGS(WARNING_FLAGS,
162 -Wno-missing-field-initializers
164 -Wno-unused-parameter
165 -Wno-deprecated-declarations
166 -Wdeclaration-after-statement
167 -Werror-implicit-function-declaration
168 -Wformat-security -Winit-self
169 -Wmissing-declarations -Wmissing-include-dirs
170 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
171 -Wredundant-decls -Wundef -Wwrite-strings")
172 AC_SUBST(WARNING_FLAGS)
174 dnl More depracation from EBook/ECal:
175 dnl -DE_BOOK_DISABLE_DEPRECATED
176 dnl -DE_CAL_DISABLE_DEPRECATED
178 dnl Other useful compiler warnings for test builds only.
179 dnl These may produce warnings we have no control over,
180 dnl or false positives we don't always want to see.
182 dnl -Wformat-nonliteral
183 dnl -Wmissing-format-attribute
185 dnl -Wstrict-aliasing=2
187 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
188 AC_SUBST(AM_CPPFLAGS)
191 dnl define disable deprecated for EBook and ECal .am files
192 case "$WARNING_FLAGS" in
193 *E_BOOK_DISABLE_DEPRECATED*)
194 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 1 == 1 ])
197 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 0 == 1 ])
201 case "$WARNING_FLAGS" in
202 *E_CAL_DISABLE_DEPRECATED*)
203 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 1 == 1 ])
206 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 0 == 1 ])
210 dnl ******************************
211 dnl Initialize maintainer mode
212 dnl ******************************
213 AM_MAINTAINER_MODE([enable])
215 if test "x$enable_maintainer_mode" = "xyes" ; then
216 AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
230 AC_MSG_ERROR([You need bison to build evolution-data-server])
234 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
235 dnl behavior that -- according to the C99 standard -- is supposed to be
236 dnl undefined. We may still have aliasing abuses lying around that rely
237 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
238 dnl optimization until we can find and fix all the abuses.
239 dnl (AC_PROG_CC must run first to set the GCC variable.)
240 dnl XXX This really belongs in AM_CFLAGS.
241 if test "x${GCC}" = "xyes"; then
242 CFLAGS="$CFLAGS -fno-strict-aliasing"
245 dnl ******************************
246 dnl Test whether jw is installed
247 dnl ******************************
248 AC_PATH_PROG(JW,jw,no)
249 if test "x$JW" = "xno"; then
254 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
257 dnl ******************************
259 dnl ******************************
260 IT_PROG_INTLTOOL([0.35.5])
262 AM_GNU_GETTEXT_VERSION([0.17])
263 AM_GNU_GETTEXT([external])
265 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
266 AC_SUBST(GETTEXT_PACKAGE)
267 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
269 localedir='$(prefix)/$(DATADIRNAME)/locale'
272 dnl ******************************
273 dnl Initialize libtool
274 dnl ******************************
276 LT_INIT(disable-static win32-dll)
280 dnl ******************************
282 dnl ******************************
283 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
285 dnl The private D-Bus documentation is for developers only.
286 AC_ARG_WITH([private-docs],
287 AS_HELP_STRING([--with-private-docs],
288 [Build documentation for private libraries ]
289 [(requires --enable-gtk-doc) [default=no]],),
290 [with_private_docs="$withval"],[with_private_docs="no"])
291 AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
293 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
296 dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
299 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
303 dnl ******************************
305 dnl ******************************
306 AC_MSG_CHECKING([for Win32])
310 NO_UNDEFINED='-no-undefined'
311 SOCKET_LIBS='-lws2_32 -ldnsapi'
313 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
314 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
315 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
322 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
329 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
332 AC_MSG_RESULT([$os_win32])
333 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
334 AC_SUBST(NO_UNDEFINED)
335 AC_SUBST(SOCKET_LIBS)
336 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
338 dnl **************************************
339 dnl Check for posix compatible sys/wait.h
340 dnl **************************************
343 dnl ************************************
344 dnl Check for posix compatible alloca()
345 dnl ************************************
348 dnl ******************************
349 dnl Checks for functions
350 dnl ******************************
351 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
353 dnl ***********************************
354 dnl Check for base dependencies early.
355 dnl ***********************************
356 PKG_CHECK_MODULES(GNOME_PLATFORM,
357 [gio-2.0 >= glib_minimum_version
358 gmodule-2.0 >= glib_minimum_version
359 gtk+-3.0 >= gtk_minimum_version
360 gconf-2.0 >= gconf_minimum_version
361 libxml-2.0 >= libxml_minimum_version
362 libsoup-2.4 >= libsoup_minimum_version
363 libgdata >= libgdata_minimum_version])
365 if test x$os_win32 = xno; then
366 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
369 dnl ******************************
370 dnl DBus-glib stuff, to initialize thread for GConf, which is using it
371 dnl this is returned back only temporarily and wil lbe removed as soon
372 dnl as eds will stop using GConf completely
373 dnl ******************************
374 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.6)
375 AC_SUBST(DBUS_GLIB_CFLAGS)
376 AC_SUBST(DBUS_GLIB_LIBS)
378 dnl *******************************
379 dnl Check for GNOME Online Accounts
380 dnl *******************************
382 [AS_HELP_STRING([--enable-goa],
383 [enable GNOME Online Accounts support (default=yes)])],
384 [enable_goa=$enableval], [enable_goa=yes])
385 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
386 AC_MSG_RESULT([$enable_goa])
387 if test "x$enable_goa" = xyes; then
388 PKG_CHECK_MODULES([GOA], [goa-1.0 >= goa_minimum_version],,
389 [AC_MSG_ERROR([goa-1.0 not found (or version < goa_minimum_version),
390 If you want to disable GNOME Online Accounts support,
391 please append --disable-goa to configure.])])
393 PKG_CHECK_MODULES([OAUTH], [oauth >= oauth_minimum_version],,
394 [AC_MSG_ERROR([oauth not found (or version < oauth_minimum_version),
395 If you want to disable GNOME Online Accounts support,
396 please append --disable-goa to configure.])])
398 if `$PKG_CONFIG --atleast-version=0.9.1 libgdata`; then
399 AC_DEFINE(HAVE_GOA,1,[Have goa-1.0 and libgdata >= 0.9.1])
402 libgdata >= 0.9.1 is required for GNOME Online Accounts support.
403 If you want to disable GNOME Online Accounts support, please
404 append --disable-goa to configure.])
407 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
409 dnl GoaPasswordBased was introduced in version 3.5.
410 if `$PKG_CONFIG --atleast-version=3.5 goa-1.0`; then
411 AC_DEFINE(HAVE_GOA_PASSWORD_BASED,1,[Have GoaPasswordBased in goa-1.0])
414 if test x$os_win32 = xno; then
415 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
418 dnl ***********************************
419 dnl Check for GNOME Keyring.
420 dnl ***********************************
421 if test x$os_win32 = xno; then
422 PKG_CHECK_MODULES(GNOME_KEYRING,
423 [gnome-keyring-1 >= gnome_keyring_minimum_version])
425 AC_SUBST(GNOME_KEYRING_CFLAGS)
426 AC_SUBST(GNOME_KEYRING_LIBS)
428 dnl **********************************************************
429 dnl gcr-base is needed for secure password exchange over D-Bus
430 dnl **********************************************************
431 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
432 AC_SUBST(GCR_BASE_CFLAGS)
433 AC_SUBST(GCR_BASE_LIBS)
435 LIBICAL_REQUIRED=libical_minimum_version
436 AC_SUBST(LIBICAL_REQUIRED)
438 dnl ******************************
440 dnl ******************************
441 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
443 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
444 [AC_MSG_ERROR([No regex library found])])])
447 dnl ******************************
449 dnl ******************************
451 AS_HELP_STRING([--with-libdb=PREFIX],
452 [Prefix where libdb is installed]),
453 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
455 DB_CFLAGS="-I$libdb_prefix/include"
456 DB_LIBS="-L$libdb_prefix/lib -ldb"
458 AC_MSG_CHECKING([Berkeley DB])
459 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
460 save_libs=$LIBS; LIBS="$DB_LIBS"
461 AC_LINK_IFELSE([AC_LANG_PROGRAM(
463 [[db_create(NULL, NULL, 0)]])],
464 [AC_MSG_RESULT([yes])],
465 [AC_MSG_ERROR([Cannot find libdb])])
471 dnl ******************************
473 dnl ******************************
477 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
478 AC_LINK_IFELSE([AC_LANG_PROGRAM(
485 cd = iconv_open ("UTF-8", "ISO-8859-1");
487 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
489 if test "x$ac_cv_libiconv" = "xyes"; then
491 if test "x$os_win32" = "xyes"; then
492 dnl Don't pointlessly auto-export the global symbols
493 dnl from a potentially static libiconv.a
494 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
499 AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
502 if test "x$have_iconv" = "xyes"; then
503 if test "x$ac_cv_libiconv" = "xno"; then
504 AC_CHECK_FUNCS(gnu_get_libc_version)
506 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
507 AC_RUN_IFELSE([AC_LANG_SOURCE([[
511 #ifdef HAVE_GNU_GET_LIBC_VERSION
512 #include <gnu/libc-version.h>
515 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
516 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
517 char *transbuf = malloc (10), *trans = transbuf;
519 size_t jp_len = strlen (jp), utf8_len = 10;
520 size_t utf8_real_len = strlen (utf8);
522 #ifdef HAVE_GNU_GET_LIBC_VERSION
523 /* glibc 2.1.2's iconv is broken in hard to test ways. */
524 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
528 cd = iconv_open ("UTF-8", "ISO-2022-JP");
529 if (cd == (iconv_t) -1)
531 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
533 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
537 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
540 if test "x$have_iconv" = "xno"; then
541 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
545 CFLAGS="$CFLAGS -I$srcdir"
547 AC_MSG_CHECKING([preferred charset name formats for system iconv])
548 AC_RUN_IFELSE([AC_LANG_SOURCE([[
550 #include "iconv-detect.c"
552 [AC_MSG_RESULT([found])],
553 [AC_MSG_RESULT([not found])
555 *** The iconv-detect program was unable to determine the
556 *** preferred charset name formats recognized by your
557 *** iconv library. It is suggested that you install a
558 *** working iconv library such as the one found at
559 *** ftp://ftp.gnu.org/pub/gnu/libiconv
561 [if test "x$os_win32" = xyes; then
562 AC_MSG_RESULT([using known win32 result])
563 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
564 echo >>iconv-detect.h
565 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
566 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
567 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
569 AC_MSG_RESULT([unknown])
571 *** We can't determine the preferred charset name formats
572 *** recognized by your iconv library. You are
573 *** cross-compiling and supposed to know what you are doing.
574 *** Please construct the iconv-detect.h file manually.
579 CFLAGS="$save_CFLAGS"
582 AC_ARG_ENABLE([backtraces],
583 [AS_HELP_STRING([--enable-backtraces],
584 [enable backtraces for e_pointer_tracker (default=no)])],
585 [enable_backtraces=$enableval], [enable_backtraces=no])
587 if test "x$enable_backtraces" = xyes; then
588 dnl ****************************
589 dnl Check for backtrace_symbols function and dwfl from elfutils
590 dnl ****************************
591 AC_MSG_CHECKING([libc backtrace_symbols function])
592 AC_LINK_IFELSE([AC_LANG_PROGRAM(
593 [[#include <execinfo.h>]],
594 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
595 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
596 AC_MSG_RESULT([$ac_cv_have_bsf])
598 if test "x$ac_cv_have_bsf" = xyes; then
601 AC_MSG_CHECKING([elfutils/libdwfl])
602 AC_LINK_IFELSE([AC_LANG_PROGRAM(
603 [[#include <elfutils/libdwfl.h>]],
607 Dwarf_Addr module_low_addr;
610 dwfl_standard_find_debuginfo;
611 dwfl_linux_proc_find_elf;
613 dwfl_linux_proc_report (NULL, 1);
614 dwfl_report_end (NULL, NULL, NULL);
616 dwfl_module_addrname (NULL, NULL);
617 dwfl_module_getsrc (NULL, NULL);
618 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
619 DWARF_CB_ABORT; DWARF_CB_OK;
620 dwfl_getmodules (NULL, NULL, NULL, 0);
622 [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
623 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
627 if test "x$ac_cv_have_elfdwfl" = xyes; then
629 AC_SUBST(LIBDWFL_LIBS)
634 dnl **********************************
635 dnl Check for nl_langinfo and CODESET
636 dnl **********************************
637 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
638 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
639 [[#include <langinfo.h>]],
640 [[char *codeset = nl_langinfo (CODESET);]]
641 )],[ac_cv_langinfo_codeset=yes],[ac_cv_langinfo_codeset=no])
642 if test "x$ac_cv_langinfo_codeset" = "xyes"; then
643 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
645 AC_MSG_RESULT([$ac_cv_langinfo_codeset])
647 dnl *******************************************************
648 dnl Check to see if strftime supports the use of %l and %k
649 dnl *******************************************************
650 AC_MSG_CHECKING([for %l and %k support in strftime])
651 AC_RUN_IFELSE([AC_LANG_SOURCE(
652 [[ #include <stdlib.h>
655 int main(int argc, char **argv) {
661 timeinfo=localtime(&rawtime);
663 strftime(buf, 10, "%lx%k", timeinfo);
665 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
672 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
673 AC_MSG_RESULT([$ac_cv_lkstrftime])
675 dnl ********************************************************************************
676 dnl security extension support (SSL and S/MIME)
678 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
679 dnl needed by Camel (SSL and S/MIME).
681 dnl The Evolution security extensions are only built if these libraries are found
682 dnl ********************************************************************************
685 AC_ARG_ENABLE([smime],
686 AS_HELP_STRING([--enable-smime],
687 [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
688 [enable_smime="$enableval"],[enable_smime="yes"])
690 AC_ARG_WITH([nspr-includes],
691 AS_HELP_STRING([--with-nspr-includes],
692 [Prefix of Mozilla nspr4 includes.]),
693 [with_nspr_includes="$withval"])
695 AC_ARG_WITH([nspr-libs],
696 AS_HELP_STRING([--with-nspr-libs],
697 [Prefix of Mozilla nspr4 libs.]),
698 [with_nspr_libs="$withval"])
700 AC_ARG_WITH([nss-includes],
701 AS_HELP_STRING([--with-nss-includes],
702 [Prefix of Mozilla nss3 includes.]),
703 [with_nss_includes="$withval"])
705 AC_ARG_WITH([nss-libs],
706 AS_HELP_STRING([--with-nss-libs],
707 [Prefix of Mozilla nss3 libs.]),
708 [with_nss_libs="$withval"])
710 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
716 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
717 if test "x${check_manually}" = "xno"; then
718 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
719 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
720 for pc in $mozilla_nspr_pcs; do
721 if $PKG_CONFIG --exists $pc; then
728 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
729 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
730 for pc in $mozilla_nss_pcs; do
731 if $PKG_CONFIG --exists $pc; then
738 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
739 if test "x$enable_smime" = "xyes"; then
740 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
743 MANUAL_NSPR_CFLAGS=""
754 if test "x${check_manually}" = "xyes"; then
755 dnl ******************
757 dnl ******************
758 AC_MSG_CHECKING([for Mozilla nspr4 includes])
759 CPPFLAGS_save="$CPPFLAGS"
760 if test -n "$with_nspr_includes"; then
761 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
764 AC_CHECK_HEADERS(nspr.h prio.h,
765 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
766 CPPFLAGS="$CPPFLAGS_save"
768 if test "x${moz_nspr_includes}" = "xyes"; then
769 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
771 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
773 AC_MSG_RESULT([$moz_nspr_includes])
775 AC_MSG_CHECKING([for Mozilla nspr libraries])
776 CFLAGS_save="$CFLAGS"
777 LDFLAGS_save="$LDFLAGS"
779 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
781 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
783 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
784 if test -n "${with_nspr_libs}"; then
785 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
790 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
791 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
793 CFLAGS="$CFLAGS_save"
794 LDFLAGS="$LDFLAGS_save"
797 if test "x${moz_nspr_libs}" = "xyes"; then
798 if test -n "${with_nspr_libs}"; then
799 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
801 MANUAL_NSPR_LIBS="$nsprlibs"
804 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
806 AC_MSG_RESULT([$moz_nspr_libs])
808 dnl *****************
810 dnl *****************
811 AC_MSG_CHECKING([for Mozilla nss3 includes])
812 CPPFLAGS_save="$CPPFLAGS"
813 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
815 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
816 [moz_nss_includes="yes"],[moz_nss_includes="no"])
817 CPPFLAGS="$CPPFLAGS_save"
819 if test "x${moz_nss_includes}" = "xyes"; then
820 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
822 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
824 AC_MSG_RESULT($moz_nss_includes)
826 AC_MSG_CHECKING([for Mozilla nss libraries])
827 LDFLAGS_save="$LDFLAGS"
829 nsslibs="-lssl3 -lsmime3 -lnss3"
831 LIBS="$nsslibs $nsprlibs"
832 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
833 if test -n "${with_nss_libs}"; then
834 LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
836 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
839 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
840 [moz_nss_libs="yes"],[moz_nss_libs="no"])
841 LDFLAGS="$LDFLAGS_save"
844 if test "x${moz_nss_libs}" = "xyes"; then
845 if test "x${enable_smime}" = "xyes"; then
846 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
849 if test -n "${with_nss_libs}"; then
850 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
852 MANUAL_NSS_LIBS="$nsslibs"
855 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
857 AC_MSG_RESULT([$moz_nss_libs])
859 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
860 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
863 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
865 dnl For pkgconfig files.
866 AC_SUBST(mozilla_nss)
867 AC_SUBST(mozilla_nspr)
869 AC_SUBST(MANUAL_NSPR_CFLAGS)
870 AC_SUBST(MANUAL_NSPR_LIBS)
871 AC_SUBST(MANUAL_NSS_CFLAGS)
872 AC_SUBST(MANUAL_NSS_LIBS)
874 dnl ******************************
875 dnl system mail stuff
876 dnl ******************************
877 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
878 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
880 AC_MSG_CHECKING([system mail directory])
881 if test -d /var/mail -a '!' -h /var/mail ; then
882 system_mail_dir="/var/mail"
884 system_mail_dir="/var/spool/mail"
886 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
888 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
890 CAMEL_LOCK_HELPER_USER=""
891 CAMEL_LOCK_HELPER_GROUP=""
892 system_mail_perm="world writable"
895 CAMEL_LOCK_HELPER_USER=""
896 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
897 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
900 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
901 CAMEL_LOCK_HELPER_GROUP=""
902 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
905 CAMEL_LOCK_HELPER_USER=""
906 CAMEL_LOCK_HELPER_GROUP=""
907 system_mail_perm="???"
911 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
912 AC_SUBST(CAMEL_LOCK_HELPER_USER)
913 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
915 dnl ******************************
917 dnl ******************************
918 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
919 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
920 [[ #include <time.h> ]],
925 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
926 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
927 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
929 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
930 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
931 [[ #include <time.h> ]],
933 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
934 if test "x$ac_cv_var_timezone" = "xyes"; then
935 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
936 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
937 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
938 [[ #include <time.h> ]],
940 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
941 if test "x$ac_cv_var_altzone" = "xyes"; then
942 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
945 AC_MSG_ERROR([unable to find a way to determine timezone])
949 dnl ******************************
950 dnl ctime_r prototype
951 dnl ******************************
952 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
954 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
955 [[ #include <time.h> ]],
958 ctime_r (&date, buf, 100); ]]
959 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
962 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
963 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
966 dnl ******************************
967 dnl gethostbyname_r prototype
968 dnl ******************************
969 AC_CHECK_FUNCS(gethostbyname_r,[
970 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
972 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
974 #include "confdefs.h"
975 #include <sys/types.h>
976 #include <sys/socket.h>
977 #include <netinet/in.h>
979 #define BUFSIZE (sizeof(struct hostent)+10)
983 char buffer[BUFSIZE];
986 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
988 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
991 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
992 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
995 dnl ******************************
996 dnl gethostbyaddr_r prototype
997 dnl ******************************
998 AC_CHECK_FUNCS(gethostbyaddr_r,[
999 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
1001 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1003 #include "confdefs.h"
1004 #include <sys/types.h>
1005 #include <sys/socket.h>
1006 #include <netinet/in.h>
1008 #define BUFSIZE (sizeof(struct hostent)+10)
1011 struct hostent hent;
1012 char buffer[BUFSIZE];
1013 int bufsize=BUFSIZE;
1015 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1016 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1019 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1020 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1023 dnl ******************************
1024 dnl stat(v)fs location/type
1025 dnl ******************************
1026 AC_CHECK_HEADER([sys/statvfs.h],
1027 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1028 [[ #if HAVE_SYS_STATVFS_H
1029 #include <sys/statvfs.h>
1032 AC_CHECK_FUNCS(statvfs)
1034 AC_CHECK_HEADER([sys/param.h],
1035 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1036 [[ #if HAVE_SYS_PARAM_H
1037 #include <sys/param.h>
1040 AC_CHECK_HEADER([sys/mount.h],
1041 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1042 [[ #if HAVE_SYS_MOUNT_H
1043 #include <sys/mount.h>
1046 AC_CHECK_FUNCS(statfs)
1048 dnl ******************************
1049 dnl IPv6 support and getaddrinfo calls
1050 dnl ******************************
1051 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1053 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1054 [[ #include "confdefs.h"
1055 #include <sys/types.h>
1056 #include <sys/socket.h>
1057 #include <netinet/in.h>
1061 [[ #ifndef NI_MAXHOST
1062 #define NI_MAXHOST 1025
1066 #define NI_MAXSERV 32
1069 struct addrinfo hints, *res;
1070 struct sockaddr_in6 sin6;
1072 char host[NI_MAXHOST];
1073 char serv[NI_MAXSERV];
1075 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1077 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1078 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1081 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1082 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1083 if test "x$enable_ipv6" = "xyes" ; then
1084 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1088 AC_ARG_ENABLE([ipv6],
1089 AS_HELP_STRING([--enable-ipv6=no/yes],
1090 [Enable support for resolving IPv6 addresses.]),
1091 [enable_ipv6=$enableval],[enable_ipv6=yes])
1092 if test "x$enable_ipv6" = "xyes"; then
1094 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1095 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1096 [[ #include "confdefs.h"
1097 #include <sys/types.h>
1098 #include <sys/socket.h>
1099 #include <netinet/in.h>
1102 [[ struct addrinfo hints;
1103 hints.ai_flags = AI_ADDRCONFIG;
1105 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1111 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1113 AC_CHECK_HEADER([wspiapi.h],
1114 [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1116 dnl **********************************
1117 dnl Weather calendar backend support
1118 dnl **********************************
1119 AC_MSG_CHECKING([if we should build the weather calendar backend])
1120 AC_ARG_ENABLE([weather],
1121 [AS_HELP_STRING([--enable-weather],
1122 [Build the weather calendar backend (default=yes)])],
1123 [use_gweather=$enableval], [use_gweather=yes])
1125 AC_MSG_RESULT([$use_gweather])
1126 if test "x$use_gweather" = "xyes"; then
1127 PKG_CHECK_MODULES([LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1128 [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.])])
1130 dnl gweather-3.5 introduces API changes we do not yet support.
1131 if `$PKG_CONFIG --atleast-version=3.5 gweather-3.0`; then
1132 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.])
1135 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1137 dnl ******************************
1139 dnl ******************************
1140 AC_ARG_ENABLE([nntp],
1141 AS_HELP_STRING([--enable-nntp],
1142 [Build Usenet news (NNTP) backend]),
1143 [enable_nntp=$enableval],[enable_nntp=yes])
1144 if test "x$enable_nntp" = "xyes"; then
1145 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1150 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1152 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1154 dnl ******************************
1156 dnl ******************************
1157 AC_ARG_ENABLE([dot-locking],
1158 AS_HELP_STRING([--enable-dot-locking=yes/no],
1159 [Enable support for locking mail files with dot locking]),
1160 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1162 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1163 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1169 AC_ARG_ENABLE([file-locking],
1170 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1171 [Enable support for locking mail files with file locking]),
1172 [],[enable_file_locking=fcntl])
1174 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1175 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1178 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1179 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1186 dnl ******************************
1187 dnl sendmail operation
1188 dnl ******************************
1189 AC_MSG_CHECKING([for SunOS broken spool format])
1190 if test "x$host_os" = "xsunos" ; then
1191 with_broken_spool="yes"
1194 AC_ARG_WITH([broken-spool],
1195 AS_HELP_STRING([--with-broken-spool=yes/no],
1196 [Using SunOS/Solaris sendmail which has a broken spool format]),
1197 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1199 if test "x$with_broken_spool" = "xyes"; then
1200 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1203 AC_MSG_RESULT([$with_broken_spool])
1205 dnl ******************************
1206 dnl DBus call timeout
1207 dnl ******************************
1209 AC_ARG_WITH([dbus-call-timeout],
1210 AS_HELP_STRING([--with-dbus-call-timeout=miliseconds],
1211 [Default timeout used when invoking g_dbus_proxy_call() family functions in EBook and ECal library (default=-1)]),
1212 [ac_cv_dbus_call_timeout=$withval],[ac_cv_dbus_call_timeout=-1])
1214 DEFAULT_EDS_DBUS_TIMEOUT=$ac_cv_dbus_call_timeout
1215 AC_SUBST(DEFAULT_EDS_DBUS_TIMEOUT)
1220 EVO_KRB5_SUPPORT(no)
1222 dnl ******************************
1224 dnl ******************************
1227 dnl ******************************
1229 dnl ******************************
1230 if test "x$os_win32" != "xyes"; then
1232 case $with_openldap in
1237 case $with_static_ldap in
1239 msg_ldap="$with_openldap (static)"
1242 msg_ldap="$with_openldap (dynamic)"
1247 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1248 if test "x$with_openldap" = "xno" ; then
1249 EVO_SUNLDAP_CHECK(no)
1250 case $with_sunldap in
1255 case $with_static_sunldap in
1257 msg_ldap="$with_sunldap (static)"
1260 msg_ldap="$with_sunldap (dynamic)"
1267 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1269 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1271 dnl Win32 LDAP support
1272 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1273 LDAP_LIBS="-lwldap32"
1274 AC_SUBST(LDAP_CFLAGS)
1276 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1277 AM_CONDITIONAL(ENABLE_LDAP, true)
1278 AM_CONDITIONAL(SUNLDAP, false)
1282 dnl ******************************
1283 dnl GObject marshalling
1284 dnl ******************************
1287 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1288 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1289 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1291 dnl ******************************
1292 dnl Code coverage flags
1293 dnl ******************************
1295 AC_ARG_ENABLE([code-coverage],
1296 AS_HELP_STRING([--enable-code-coverage], [compile with code coverage code]),
1297 [enable_code_coverage=$enableval], [enable_code_coverage=no])
1299 if test "x$GCC" = "xyes"; then
1300 if test "x$enable_code_coverage" = "xyes"; then
1301 CODE_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage -O0 -ggdb"
1302 CODE_COVERAGE_LDFLAGS="-lgcov"
1306 AC_SUBST([CODE_COVERAGE_CFLAGS])
1307 AC_SUBST([CODE_COVERAGE_LDFLAGS])
1309 dnl ******************************
1310 dnl Utility macro to set compiler flags for a specific lib.
1311 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1312 dnl ******************************
1313 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1314 PKG_CHECK_MODULES([$1], [$2])
1315 $1_CFLAGS="[$]$1_CFLAGS $3 "
1316 $1_LIBS="[$]$1_LIBS $4 "
1319 dnl ******************************
1321 dnl ******************************
1322 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1324 dnl ******************************
1325 dnl libedataserver flags
1326 dnl ******************************
1327 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 gnome-keyring-1 libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1329 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1330 AC_SUBST(E_DATA_SERVER_CFLAGS)
1331 AC_SUBST(E_DATA_SERVER_LIBS)
1333 dnl ******************************
1334 dnl libedataserverui
1335 dnl ******************************
1336 E_DATA_SERVER_UI_DEPS="gtk+-3.0 libxml-2.0 gconf-2.0"
1338 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, , )
1339 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1340 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1342 if test "x$enable_maintainer_mode" = "xyes" ; then
1343 FACTORY_GTK_CFLAGS=$E_DATA_SERVER_UI_CFLAGS
1344 FACTORY_GTK_LIBS=$E_DATA_SERVER_UI_LIBS
1345 AC_SUBST(FACTORY_GTK_CFLAGS)
1346 AC_SUBST(FACTORY_GTK_LIBS)
1349 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 gnome-keyring-1 libxml-2.0 gconf-2.0"
1351 dnl ******************************
1352 dnl libebackend flags
1353 dnl ******************************
1354 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1355 AC_SUBST(E_BACKEND_CFLAGS)
1356 AC_SUBST(E_BACKEND_LIBS)
1358 dnl ******************************
1359 dnl evolution-addressbook flags
1360 dnl ******************************
1361 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 gconf-2.0"
1363 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1364 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1365 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1367 dnl ******************************
1368 dnl evolution-calendar flags
1369 dnl ******************************
1370 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libxml-2.0 gconf-2.0"
1373 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1374 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1375 dnl to differentiate between <libical/ical.h> and <ical.h>
1376 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1377 dnl libical is fixed, we have to work-around the buggy CFlags.
1379 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1380 LIBICAL_EXTRA_LIBS=""
1381 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1382 AC_SUBST(LIBICAL_EXTRA_LIBS)
1384 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1385 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1386 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1388 dnl ****************************
1389 dnl Check for ical_set_unknown_token_handling_setting function
1390 dnl ****************************
1391 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1392 save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1393 save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1394 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1395 [[#include <libical/ical.h>]],
1396 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1397 [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])
1400 AC_MSG_RESULT([$ac_cv_have_iuth])
1402 dnl ******************************
1404 dnl ******************************
1405 LIBGDATA_REQUIRED=libgdata_minimum_version
1406 AC_SUBST(LIBGDATA_REQUIRED)
1408 EVO_SET_COMPILE_FLAGS(GDATA, libgdata)
1409 AC_SUBST(GDATA_CFLAGS)
1410 AC_SUBST(GDATA_LIBS)
1412 dnl ******************************
1414 dnl ******************************
1415 LIBSOUP_REQUIRED=libsoup_minimum_version
1416 AC_SUBST(LIBSOUP_REQUIRED)
1418 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1419 AC_SUBST(SOUP_CFLAGS)
1422 dnl ******************************
1424 dnl ******************************
1425 SQLITE_REQUIRED=sqlite_minimum_version
1426 AC_SUBST(SQLITE_REQUIRED)
1429 dnl deflateInit is a #define, use deflateEnd instead
1430 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1432 if test "x$zlib_found" = "xfalse"; then
1433 AC_MSG_ERROR([*** zlib is required])
1436 dnl ******************************
1437 dnl Checks for large file support
1438 dnl ******************************
1439 AC_ARG_ENABLE([largefile],
1440 AS_HELP_STRING([--enable-largefile],
1441 [enable support for large files [[default=no]]]),
1442 [],[enable_largefile="yes"])
1444 if test "x$enable_largefile" != "xno"; then
1446 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1447 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1448 [[ #include <sys/types.h>
1449 #include <sys/stat.h>
1452 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1453 )],[ac_cv_largefile64_source="no"],
1454 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1455 [[ #define _LARGEFILE64_SOURCE
1456 #include <sys/types.h>
1457 #include <sys/stat.h>
1460 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1461 [ac_cv_largefile64_source="unknown"])])
1464 enable_largefile="no"
1466 if test "x$ac_cv_largefile64_source" = "xyes"; then
1467 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1468 enable_largefile="yes"
1469 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1470 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1473 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1474 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1475 enable_largefile="yes"
1478 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1479 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1480 enable_largefile="yes"
1483 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1487 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1489 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)
1490 AC_SUBST(CAMEL_CFLAGS)
1491 AC_SUBST(CAMEL_LIBS)
1493 dnl ******************************
1494 dnl Special directories
1495 dnl ******************************
1497 dnl If you add something here, consider whether or not you also
1498 dnl need to add it to one or more .pc.in files (for Connector,
1501 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1502 AC_SUBST(privdatadir)
1504 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1505 AC_SUBST(privincludedir)
1507 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1508 AC_SUBST(privlibdir)
1510 imagesdir='${datadir}'/pixmaps/evolution-data-server
1513 moduledir='${libdir}'/evolution-data-server/registry-modules
1516 ebook_backenddir='${libdir}'/evolution-data-server/addressbook-backends
1517 AC_SUBST(ebook_backenddir)
1519 ecal_backenddir='${libdir}'/evolution-data-server/calendar-backends
1520 AC_SUBST(ecal_backenddir)
1522 ro_sourcesdir='${datadir}'/evolution-data-server-$BASE_VERSION/ro-sources
1523 AC_SUBST(ro_sourcesdir)
1525 rw_sourcesdir='${datadir}'/evolution-data-server-$BASE_VERSION/rw-sources
1526 AC_SUBST(rw_sourcesdir)
1528 if test "x$use_gweather" = "xyes"; then
1529 weatherdatadir="$privdatadir/weather"
1530 AC_SUBST(weatherdatadir)
1533 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1534 camel_providerdir='${libdir}'/evolution-data-server/camel-providers
1535 AC_SUBST(camel_providerdir)
1537 dnl *******************
1538 dnl D-BUS service stuff
1539 dnl *******************
1540 m4_pattern_allow([AM_V_GEN])
1541 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)|" $< > $@'
1542 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1544 dnl ******************************
1546 dnl ******************************
1547 AC_PATH_PROG(GCONFTOOL, gconftool-2, [no])
1550 dnl ******************************
1552 dnl ******************************
1556 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1557 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1558 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1560 dnl ******************************
1562 dnl ******************************
1563 AC_PATH_PROG(GPERF, gperf, [no])
1564 if test "x$GPERF" = "xno"; then
1565 AC_MSG_ERROR([You need gperf to build evolution-data-server])
1568 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1570 dnl ******************************
1572 dnl ******************************
1573 AC_ARG_ENABLE(vala-bindings,
1574 AC_HELP_STRING([--enable-vala-bindings],
1575 [build the EXPERIMENTAL Vala bindings]),
1576 enable_vala_bindings=$enableval,
1577 enable_vala_bindings=no)
1579 if test x$enable_vala_bindings = xyes; then
1580 if test "x$INTROSPECTION_SCANNER" = x; then
1581 AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1584 AM_PROG_VALAC([0.13.0])
1587 AC_PATH_PROG(VALAC, valac, valac)
1591 AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1593 if test "x$VAPIGEN" = "xfalse"; then
1594 AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1600 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1603 dnl ******************************
1605 dnl ******************************
1607 export privincludedir
1612 evolution-data-server-zip
1613 evolution-data-server.pc
1614 addressbook/Makefile
1615 addressbook/libebook/Makefile
1616 addressbook/libebook/libebook.pc
1617 addressbook/libedata-book/Makefile
1618 addressbook/libedata-book/libedata-book.pc
1619 addressbook/libegdbus/Makefile
1620 addressbook/backends/Makefile
1621 addressbook/backends/file/Makefile
1622 addressbook/backends/vcf/Makefile
1623 addressbook/backends/ldap/Makefile
1624 addressbook/backends/google/Makefile
1625 addressbook/backends/webdav/Makefile
1628 calendar/libecal/Makefile
1629 calendar/libecal/libecal.pc
1630 calendar/libedata-cal/Makefile
1631 calendar/libedata-cal/libedata-cal.pc
1632 calendar/libegdbus/Makefile
1633 calendar/backends/Makefile
1634 calendar/backends/caldav/Makefile
1635 calendar/backends/file/Makefile
1636 calendar/backends/http/Makefile
1637 calendar/backends/contacts/Makefile
1638 calendar/backends/weather/Makefile
1640 camel/providers/Makefile
1641 camel/providers/imap/Makefile
1642 camel/providers/imapx/Makefile
1643 camel/providers/local/Makefile
1644 camel/providers/nntp/Makefile
1645 camel/providers/pop3/Makefile
1646 camel/providers/sendmail/Makefile
1647 camel/providers/smtp/Makefile
1648 camel/tests/Makefile
1649 camel/tests/folder/Makefile
1650 camel/tests/lib/Makefile
1651 camel/tests/message/Makefile
1652 camel/tests/mime-filter/Makefile
1653 camel/tests/misc/Makefile
1654 camel/tests/smime/Makefile
1657 data/sources/Makefile
1658 libebackend/Makefile
1659 libebackend/libebackend.pc
1660 libedataserver/Makefile
1661 libedataserver/eds-version.h
1662 libedataserver/libedataserver.pc
1663 libedataserverui/Makefile
1664 libedataserverui/libedataserverui.pc
1666 modules/google-backend/Makefile
1667 modules/online-accounts/Makefile
1670 services/evolution-addressbook-factory/Makefile
1671 services/evolution-calendar-factory/Makefile
1672 services/evolution-source-registry/Makefile
1674 tests/libebook/Makefile
1675 tests/libebook/client/Makefile
1676 tests/libebook/vcard/Makefile
1677 tests/libecal/Makefile
1678 tests/libecal/client/Makefile
1679 tests/libedata-cal/Makefile
1680 tests/libedataserver/Makefile
1681 tests/libedataserverui/Makefile
1683 docs/reference/Makefile
1684 docs/reference/addressbook/Makefile
1685 docs/reference/addressbook/libebook/Makefile
1686 docs/reference/addressbook/libedata-book/Makefile
1687 docs/reference/calendar/Makefile
1688 docs/reference/calendar/libecal/Makefile
1689 docs/reference/calendar/libedata-cal/Makefile
1690 docs/reference/camel/Makefile
1691 docs/reference/libedataserver/Makefile
1692 docs/reference/libedataserverui/Makefile
1693 docs/reference/libebackend/Makefile
1694 docs/reference/private/Makefile
1701 evolution-data-server has been configured as follows:
1702 Weather calendar: $use_gweather
1703 Mail Directory: $system_mail_dir, $system_mail_perm
1704 LDAP support: $msg_ldap
1705 NNTP support: $msg_nntp
1706 Kerberos 5: $msg_krb5
1707 SMIME support: $msg_smime
1708 IPv6 support: $msg_ipv6
1709 Dot Locking: $msg_dot
1710 File Locking: $msg_file
1711 Large files: $enable_largefile
1712 Gtk Doc: $enable_gtk_doc
1713 Introspection: $enable_introspection
1714 Vala bindings: $enable_vala_bindings
1715 GNOME Online Accounts $enable_goa
1716 Code coverage (gcov): $enable_code_coverage