2 dnl Evolution-Data-Server version
3 m4_define([eds_major_version], [3])
4 m4_define([eds_minor_version], [7])
5 m4_define([eds_micro_version], [90])
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.8])
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 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
37 dnl Keep these two definitions in agreement.
38 m4_define([glib_minimum_version], [2.34])
39 m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
41 dnl Keep these two definitions in agreement.
42 m4_define([gdk_minimum_version], [3.2])
43 m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
45 dnl Keep these two definitions in agreement.
46 m4_define([soup_minimum_version], [2.40.3])
47 m4_define([soup_encoded_version], [SOUP_VERSION_2_40])
49 m4_define([gcr_minimum_version], [3.4])
50 m4_define([libsecret_minimum_version], [0.5])
51 m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
52 m4_define([libgdata_minimum_version], [0.10])
53 m4_define([sqlite_minimum_version], [3.5])
54 m4_define([libical_minimum_version], [0.43])
57 m4_define([goa_minimum_version], [3.2])
58 m4_define([gweather_minimum_version], [3.5.0])
59 m4_define([libaccounts_glib_minimum_version], [1.4])
60 m4_define([libsignon_glib_minimum_version], [1.8])
62 AC_SUBST([BASE_VERSION],[base_version])
63 AC_SUBST([API_VERSION],[api_version])
64 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
65 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
67 EDS_MAJOR_VERSION=eds_major_version
68 EDS_MINOR_VERSION=eds_minor_version
69 EDS_MICRO_VERSION=eds_micro_version
73 dnl ******************************
75 dnl ******************************
76 ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook5"
77 CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar4"
78 SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources1"
79 USER_PROMPTER_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.UserPrompter0"
82 ADDRESS_BOOK_DBUS_SERVICE_NAME,
83 ["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
84 [D-Bus service name for the address book factory])
87 CALENDAR_DBUS_SERVICE_NAME,
88 ["$CALENDAR_DBUS_SERVICE_NAME"],
89 [D-Bus service name for the calendar factory])
92 SOURCES_DBUS_SERVICE_NAME,
93 ["$SOURCES_DBUS_SERVICE_NAME"],
94 [D-Bus service name for the source registry])
97 USER_PROMPTER_DBUS_SERVICE_NAME,
98 ["$USER_PROMPTER_DBUS_SERVICE_NAME"],
99 [D-Bus service name for the user prompter])
101 AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
102 AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
103 AC_SUBST(SOURCES_DBUS_SERVICE_NAME)
104 AC_SUBST(USER_PROMPTER_DBUS_SERVICE_NAME)
106 dnl ******************************
107 dnl Libtool versioning
108 dnl ******************************
109 LIBEDATASERVER_CURRENT=17
110 LIBEDATASERVER_REVISION=0
117 LIBEDATACAL_CURRENT=20
118 LIBEDATACAL_REVISION=0
121 LIBEDATABOOK_CURRENT=16
122 LIBEDATABOOK_REVISION=0
133 LIBEBACKEND_CURRENT=7
134 LIBEBACKEND_REVISION=0
137 AC_SUBST(EDS_MAJOR_VERSION)
138 AC_SUBST(EDS_MINOR_VERSION)
139 AC_SUBST(EDS_MICRO_VERSION)
140 AC_SUBST(LIBEDATASERVER_CURRENT)
141 AC_SUBST(LIBEDATASERVER_REVISION)
142 AC_SUBST(LIBEDATASERVER_AGE)
143 AC_SUBST(LIBECAL_CURRENT)
144 AC_SUBST(LIBECAL_REVISION)
145 AC_SUBST(LIBECAL_AGE)
146 AC_SUBST(LIBEDATACAL_CURRENT)
147 AC_SUBST(LIBEDATACAL_REVISION)
148 AC_SUBST(LIBEDATACAL_AGE)
149 AC_SUBST(LIBEBOOK_CURRENT)
150 AC_SUBST(LIBEBOOK_REVISION)
151 AC_SUBST(LIBEBOOK_AGE)
152 AC_SUBST(LIBEDATABOOK_CURRENT)
153 AC_SUBST(LIBEDATABOOK_REVISION)
154 AC_SUBST(LIBEDATABOOK_AGE)
155 AC_SUBST(LIBCAMEL_CURRENT)
156 AC_SUBST(LIBCAMEL_REVISION)
157 AC_SUBST(LIBCAMEL_AGE)
158 AC_SUBST(LIBEBACKEND_CURRENT)
159 AC_SUBST(LIBEBACKEND_REVISION)
160 AC_SUBST(LIBEBACKEND_AGE)
162 dnl **************************************
163 dnl Put the ACLOCAL flags in the Makefile
164 dnl **************************************
165 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
167 dnl *********************************************
168 dnl Figure out early if we'll need a C++ compiler
169 dnl *********************************************
174 dnl ******************************
175 dnl Compiler Warning Flags
176 dnl ******************************
177 proposed_warning_flags="-Wall -Wextra
178 -Wdeprecated-declarations
179 -Werror-implicit-function-declaration
180 -Wformat-security -Winit-self
181 -Wmissing-declarations -Wmissing-include-dirs
182 -Wmissing-noreturn -Wpointer-arith
183 -Wredundant-decls -Wundef -Wwrite-strings"
185 proposed_c_warning_flags="$proposed_warning_flags
186 -Wdeclaration-after-statement
187 -Wno-missing-field-initializers
189 -Wno-unused-parameter
192 proposed_cxx_warning_flags="$proposed_warning_flags
195 AS_COMPILER_FLAGS(WARNING_FLAGS, [$proposed_c_warning_flags])
196 AC_SUBST(WARNING_FLAGS)
198 dnl Other useful compiler warnings for test builds only.
199 dnl These may produce warnings we have no control over,
200 dnl or false positives we don't always want to see.
202 dnl -Wformat-nonliteral
203 dnl -Wmissing-format-attribute
205 dnl -Wstrict-aliasing=2
207 AM_CFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
210 if test "x$evo_with_cxx" = xyes; then
214 AS_COMPILER_FLAGS(CXX_WARNING_FLAGS, [$proposed_cxx_warning_flags])
215 AC_SUBST(CXX_WARNING_FLAGS)
216 AM_CXXFLAGS="$CXX_WARNING_FLAGS"
217 AC_SUBST(AM_CXXFLAGS)
221 dnl *******************************
222 dnl Check for --enable-strict
223 dnl *******************************
224 AC_ARG_ENABLE([strict],
225 [AS_HELP_STRING([--enable-strict],
226 [enable strict building, like without deprecated symbols (default=auto); auto enables strict building only if .git subdirectory exists])],
227 [enable_strict=$enableval], [enable_strict=auto])
229 AC_MSG_CHECKING([if strict building is enabled])
230 if test "x$enable_strict" = xauto; then
231 dnl Be strict when compiling with .git subdirectory
232 if test -d .git ; then
238 AC_MSG_RESULT([$enable_strict])
242 if test "x$enable_strict" = xyes; then
243 AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
246 dnl Warn about API usage that violates our minimum requirements.
247 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
248 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
249 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
251 dnl These will suppress warnings about newly-deprecated symbols. Ideally
252 dnl these settings should match our minimum requirements and we will clean
253 dnl up any new deprecation warnings after bumping our minimum requirements.
254 dnl But if the warnings get to be overwhelming, use fixed versions instead.
255 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
256 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"
257 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
259 AC_SUBST(AM_CPPFLAGS)
261 dnl ******************************
262 dnl Initialize maintainer mode
263 dnl ******************************
264 AM_MAINTAINER_MODE([enable])
266 if test "x$enable_maintainer_mode" = "xyes" ; then
267 AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
278 dnl For gen-western-table.py
281 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
282 dnl behavior that -- according to the C99 standard -- is supposed to be
283 dnl undefined. We may still have aliasing abuses lying around that rely
284 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
285 dnl optimization until we can find and fix all the abuses.
286 dnl (AC_PROG_CC must run first to set the GCC variable.)
287 dnl XXX This really belongs in AM_CFLAGS.
288 if test "x${GCC}" = "xyes"; then
289 CFLAGS="$CFLAGS -fno-strict-aliasing"
292 dnl ******************************
294 dnl ******************************
295 IT_PROG_INTLTOOL([0.35.5])
297 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
298 AC_SUBST(GETTEXT_PACKAGE)
299 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
301 localedir='$(prefix)/$(DATADIRNAME)/locale'
304 dnl ******************************
305 dnl Initialize libtool
306 dnl ******************************
308 LT_INIT(disable-static win32-dll)
312 dnl This relies on $SED, which is defined in ltmain.sh, which
313 dnl is invoked by LT_INIT (at least I think that's how it works).
316 dnl ******************************
318 dnl ******************************
319 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
321 dnl The private D-Bus documentation is for developers only.
322 AC_ARG_WITH([private-docs],
323 AS_HELP_STRING([--with-private-docs],
324 [Build documentation for private libraries ]
325 [(requires --enable-gtk-doc) [default=no]],),
326 [with_private_docs="$withval"],[with_private_docs="no"])
327 AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
329 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
332 dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
335 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
339 dnl ******************************
341 dnl ******************************
342 AC_MSG_CHECKING([for Win32])
346 NO_UNDEFINED='-no-undefined'
347 SOCKET_LIBS='-lws2_32 -ldnsapi'
349 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
350 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
351 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
358 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
365 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
368 AC_MSG_RESULT([$os_win32])
369 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
370 AC_SUBST(NO_UNDEFINED)
371 AC_SUBST(SOCKET_LIBS)
372 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
374 dnl **************************************
375 dnl Check for posix compatible sys/wait.h
376 dnl **************************************
379 dnl ************************************
380 dnl Check for posix compatible alloca()
381 dnl ************************************
384 dnl ******************************
385 dnl Checks for functions
386 dnl ******************************
387 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
389 dnl ***********************************
390 dnl Check for base dependencies early.
391 dnl ***********************************
392 PKG_CHECK_MODULES(GNOME_PLATFORM,
393 [gio-2.0 >= glib_minimum_version
394 gmodule-2.0 >= glib_minimum_version
395 libxml-2.0 >= libxml_minimum_version
396 libsoup-2.4 >= soup_minimum_version])
398 if test x$os_win32 = xno; then
399 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
402 dnl ******************************
403 dnl Check for libphonenumber
404 dnl ******************************
406 EVO_PHONENUMBER_SUPPORT
408 dnl *************************
410 dnl *************************
412 [AS_HELP_STRING([--enable-gtk],
413 [enable GTK+ (default=yes)])],
414 [enable_gtk=$enableval], [enable_gtk=yes])
415 AC_MSG_CHECKING([if GTK+ support is enabled])
416 AC_MSG_RESULT([$enable_gtk])
417 if test "x$enable_gtk" = xyes; then
418 PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= gdk_minimum_version],,
421 gtk+-3.0 not found (or version < gdk_minimum_version)
423 If you want to disable GTK+ support,
424 please append --disable-gtk to configure.
427 AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
429 AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
431 dnl *******************************
432 dnl Check for GNOME Online Accounts
433 dnl *******************************
435 [AS_HELP_STRING([--enable-goa],
436 [enable GNOME Online Accounts support (default=yes)])],
437 [enable_goa=$enableval], [enable_goa=yes])
438 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
439 AC_MSG_RESULT([$enable_goa])
440 if test "x$enable_goa" = xyes; then
441 PKG_CHECK_MODULES([GOA], [goa-1.0 >= goa_minimum_version],,
444 goa-1.0 not found (or version < goa_minimum_version)
446 If you want to disable GNOME Online Accounts support,
447 please append --disable-goa to configure.
450 AC_DEFINE(HAVE_GOA, 1, [Define to 1 if you have the goa-1.0 package.])
452 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
454 dnl GoaPasswordBased was introduced in version 3.5.
455 if `$PKG_CONFIG --atleast-version=3.5 goa-1.0`; then
456 AC_DEFINE(HAVE_GOA_PASSWORD_BASED,1,[Have GoaPasswordBased in goa-1.0])
459 dnl ********************************
460 dnl Check for Ubuntu Online Accounts
461 dnl ********************************
463 [AS_HELP_STRING([--enable-uoa],
464 [enable Ubuntu Online Accounts support (default=yes)])],
465 [enable_uoa=$enableval], [enable_uoa=yes])
466 AC_MSG_CHECKING([if Ubuntu Online Accounts support is enabled])
467 AC_MSG_RESULT([$enable_uoa])
468 if test "x$enable_uoa" = xyes; then
469 PKG_CHECK_MODULES([LIBACCOUNTS_GLIB],
470 [libaccounts-glib >= libaccounts_glib_minimum_version],,
473 libaccounts-glib not found (or version < libaccounts_glib_minimum_version)
475 If you want to disable Ubuntu Online Accounts support,
476 please append --disable-uoa to configure.
479 PKG_CHECK_MODULES([LIBSIGNON_GLIB],
480 [libsignon-glib >= libsignon_glib_minimum_version],,
483 libsignon-glib not found (or version < libsignon_glib_minimum_version)
485 If you want to disable Ubuntu Online Accounts support,
486 please append --disable-uoa to configure.
489 PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0],,
492 json-glib-1.0 not found
494 If you want to disable Ubuntu Online Accounts support,
495 please append --disable-uoa to configure.
498 PKG_CHECK_MODULES([REST], [rest-0.7],,
501 librest-0.7 not found
503 If you want to disable Ubuntu Online Accounts support,
504 please append --disable-uoa to configure.
507 AC_DEFINE(HAVE_UOA, 1, [Have libaccounts-glib])
509 AM_CONDITIONAL(HAVE_UOA, [test x$enable_uoa = xyes])
511 dnl ***********************************
512 dnl Check for GNOME Keyring.
513 dnl ***********************************
514 if test x$os_win32 = xno; then
515 PKG_CHECK_MODULES(LIBSECRET,
516 [libsecret-unstable >= libsecret_minimum_version])
518 AC_SUBST(LIBSECRET_CFLAGS)
519 AC_SUBST(LIBSECRET_LIBS)
521 dnl **********************************************************
522 dnl gcr-base is needed for secure password exchange over D-Bus
523 dnl **********************************************************
524 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
525 AC_SUBST(GCR_BASE_CFLAGS)
526 AC_SUBST(GCR_BASE_LIBS)
528 LIBICAL_REQUIRED=libical_minimum_version
529 AC_SUBST(LIBICAL_REQUIRED)
531 dnl ******************************
533 dnl ******************************
534 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
536 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
537 [AC_MSG_ERROR([No regex library found])])])
540 dnl ******************************
542 dnl ******************************
544 AS_HELP_STRING([--with-libdb=PREFIX],
545 [Prefix where libdb is installed]),
546 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
548 DB_CFLAGS="-I$libdb_prefix/include"
549 DB_LIBS="-L$libdb_prefix/lib -ldb"
551 AC_MSG_CHECKING([Berkeley DB])
552 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
553 save_libs=$LIBS; LIBS="$DB_LIBS"
554 AC_LINK_IFELSE([AC_LANG_PROGRAM(
556 [[db_create(NULL, NULL, 0)]])],
557 [AC_MSG_RESULT([yes])],
558 [AC_MSG_ERROR([Cannot find libdb])])
564 dnl ******************************
566 dnl ******************************
570 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
571 AC_LINK_IFELSE([AC_LANG_PROGRAM(
578 cd = iconv_open ("UTF-8", "ISO-8859-1");
580 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
582 if test "x$ac_cv_libiconv" = "xyes"; then
584 if test "x$os_win32" = "xyes"; then
585 dnl Don't pointlessly auto-export the global symbols
586 dnl from a potentially static libiconv.a
587 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
592 AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
595 if test "x$have_iconv" = "xyes"; then
596 if test "x$ac_cv_libiconv" = "xno"; then
597 AC_CHECK_FUNCS(gnu_get_libc_version)
599 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
600 AC_RUN_IFELSE([AC_LANG_SOURCE([[
604 #ifdef HAVE_GNU_GET_LIBC_VERSION
605 #include <gnu/libc-version.h>
608 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
609 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
610 char *transbuf = malloc (10), *trans = transbuf;
612 size_t jp_len = strlen (jp), utf8_len = 10;
613 size_t utf8_real_len = strlen (utf8);
615 #ifdef HAVE_GNU_GET_LIBC_VERSION
616 /* glibc 2.1.2's iconv is broken in hard to test ways. */
617 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
621 cd = iconv_open ("UTF-8", "ISO-2022-JP");
622 if (cd == (iconv_t) -1)
624 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
626 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
630 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
633 if test "x$have_iconv" = "xno"; then
634 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
638 CFLAGS="$CFLAGS -I$srcdir"
640 AC_MSG_CHECKING([preferred charset name formats for system iconv])
641 AC_RUN_IFELSE([AC_LANG_SOURCE([[
643 #include "iconv-detect.c"
645 [AC_MSG_RESULT([found])],
646 [AC_MSG_RESULT([not found])
648 *** The iconv-detect program was unable to determine the
649 *** preferred charset name formats recognized by your
650 *** iconv library. It is suggested that you install a
651 *** working iconv library such as the one found at
652 *** ftp://ftp.gnu.org/pub/gnu/libiconv
654 [if test "x$os_win32" = xyes; then
655 AC_MSG_RESULT([using known win32 result])
656 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
657 echo >>iconv-detect.h
658 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
659 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
660 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
662 AC_MSG_RESULT([unknown])
664 *** We can't determine the preferred charset name formats
665 *** recognized by your iconv library. You are
666 *** cross-compiling and supposed to know what you are doing.
667 *** Please construct the iconv-detect.h file manually.
672 CFLAGS="$save_CFLAGS"
675 AC_ARG_ENABLE([backtraces],
676 [AS_HELP_STRING([--enable-backtraces],
677 [enable backtraces for camel_pointer_tracker (default=no)])],
678 [enable_backtraces=$enableval], [enable_backtraces=no])
680 if test "x$enable_backtraces" = xyes; then
681 dnl ****************************
682 dnl Check for backtrace_symbols function and dwfl from elfutils
683 dnl ****************************
684 AC_MSG_CHECKING([libc backtrace_symbols function])
685 AC_LINK_IFELSE([AC_LANG_PROGRAM(
686 [[#include <execinfo.h>]],
687 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
688 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
689 AC_MSG_RESULT([$ac_cv_have_bsf])
691 if test "x$ac_cv_have_bsf" = xyes; then
694 AC_MSG_CHECKING([elfutils/libdwfl])
695 AC_LINK_IFELSE([AC_LANG_PROGRAM(
696 [[#include <elfutils/libdwfl.h>]],
700 Dwarf_Addr module_low_addr;
703 dwfl_standard_find_debuginfo;
704 dwfl_linux_proc_find_elf;
706 dwfl_linux_proc_report (NULL, 1);
707 dwfl_report_end (NULL, NULL, NULL);
709 dwfl_module_addrname (NULL, NULL);
710 dwfl_module_getsrc (NULL, NULL);
711 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
712 DWARF_CB_ABORT; DWARF_CB_OK;
713 dwfl_getmodules (NULL, NULL, NULL, 0);
715 [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
716 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
720 if test "x$ac_cv_have_elfdwfl" = xyes; then
722 AC_SUBST(LIBDWFL_LIBS)
727 dnl ******************************
728 dnl Check for nl_langinfo features
729 dnl ******************************
730 EVO_CHECK_LANGINFO([CODESET])
731 EVO_CHECK_LANGINFO([_NL_ADDRESS_COUNTRY_AB2])
733 dnl *******************************************************
734 dnl Check to see if strftime supports the use of %l and %k
735 dnl *******************************************************
736 AC_MSG_CHECKING([for %l and %k support in strftime])
737 AC_RUN_IFELSE([AC_LANG_SOURCE(
738 [[ #include <stdlib.h>
741 int main(int argc, char **argv) {
747 timeinfo=localtime(&rawtime);
749 strftime(buf, 10, "%lx%k", timeinfo);
751 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
758 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
759 AC_MSG_RESULT([$ac_cv_lkstrftime])
761 dnl ********************************************************************************
762 dnl security extension support (SSL and S/MIME)
764 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
765 dnl needed by Camel (SSL and S/MIME).
767 dnl The Evolution security extensions are only built if these libraries are found
768 dnl ********************************************************************************
771 AC_ARG_ENABLE([smime],
772 AS_HELP_STRING([--enable-smime],
773 [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
774 [enable_smime="$enableval"],[enable_smime="yes"])
776 AC_ARG_WITH([nspr-includes],
777 AS_HELP_STRING([--with-nspr-includes],
778 [Prefix of Mozilla nspr4 includes.]),
779 [with_nspr_includes="$withval"])
781 AC_ARG_WITH([nspr-libs],
782 AS_HELP_STRING([--with-nspr-libs],
783 [Prefix of Mozilla nspr4 libs.]),
784 [with_nspr_libs="$withval"])
786 AC_ARG_WITH([nss-includes],
787 AS_HELP_STRING([--with-nss-includes],
788 [Prefix of Mozilla nss3 includes.]),
789 [with_nss_includes="$withval"])
791 AC_ARG_WITH([nss-libs],
792 AS_HELP_STRING([--with-nss-libs],
793 [Prefix of Mozilla nss3 libs.]),
794 [with_nss_libs="$withval"])
796 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
802 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
803 if test "x${check_manually}" = "xno"; then
804 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
805 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
806 for pc in $mozilla_nspr_pcs; do
807 if $PKG_CONFIG --exists $pc; then
814 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
815 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
816 for pc in $mozilla_nss_pcs; do
817 if $PKG_CONFIG --exists $pc; then
824 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
825 if test "x$enable_smime" = "xyes"; then
826 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
829 MANUAL_NSPR_CFLAGS=""
840 if test "x${check_manually}" = "xyes"; then
841 dnl ******************
843 dnl ******************
844 AC_MSG_CHECKING([for Mozilla nspr4 includes])
845 CPPFLAGS_save="$CPPFLAGS"
846 if test -n "$with_nspr_includes"; then
847 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
850 AC_CHECK_HEADERS(nspr.h prio.h,
851 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
852 CPPFLAGS="$CPPFLAGS_save"
854 if test "x${moz_nspr_includes}" = "xyes"; then
855 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
857 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
859 AC_MSG_RESULT([$moz_nspr_includes])
861 AC_MSG_CHECKING([for Mozilla nspr libraries])
862 CFLAGS_save="$CFLAGS"
863 LDFLAGS_save="$LDFLAGS"
865 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
867 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
869 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
870 if test -n "${with_nspr_libs}"; then
871 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
876 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
877 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
879 CFLAGS="$CFLAGS_save"
880 LDFLAGS="$LDFLAGS_save"
883 if test "x${moz_nspr_libs}" = "xyes"; then
884 if test -n "${with_nspr_libs}"; then
885 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
887 MANUAL_NSPR_LIBS="$nsprlibs"
890 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
892 AC_MSG_RESULT([$moz_nspr_libs])
894 dnl *****************
896 dnl *****************
897 AC_MSG_CHECKING([for Mozilla nss3 includes])
898 CPPFLAGS_save="$CPPFLAGS"
899 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
901 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
902 [moz_nss_includes="yes"],[moz_nss_includes="no"])
903 CPPFLAGS="$CPPFLAGS_save"
905 if test "x${moz_nss_includes}" = "xyes"; then
906 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
908 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
910 AC_MSG_RESULT($moz_nss_includes)
912 AC_MSG_CHECKING([for Mozilla nss libraries])
913 LDFLAGS_save="$LDFLAGS"
915 nsslibs="-lssl3 -lsmime3 -lnss3"
917 LIBS="$nsslibs $nsprlibs"
918 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
919 if test -n "${with_nss_libs}"; then
920 LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
922 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
925 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
926 [moz_nss_libs="yes"],[moz_nss_libs="no"])
927 LDFLAGS="$LDFLAGS_save"
930 if test "x${moz_nss_libs}" = "xyes"; then
931 if test "x${enable_smime}" = "xyes"; then
932 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
935 if test -n "${with_nss_libs}"; then
936 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
938 MANUAL_NSS_LIBS="$nsslibs"
941 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
943 AC_MSG_RESULT([$moz_nss_libs])
945 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
946 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
949 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
951 dnl For pkgconfig files.
952 AC_SUBST(mozilla_nss)
953 AC_SUBST(mozilla_nspr)
955 AC_SUBST(MANUAL_NSPR_CFLAGS)
956 AC_SUBST(MANUAL_NSPR_LIBS)
957 AC_SUBST(MANUAL_NSS_CFLAGS)
958 AC_SUBST(MANUAL_NSS_LIBS)
960 dnl ******************************
961 dnl system mail stuff
962 dnl ******************************
963 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
964 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
966 AC_MSG_CHECKING([system mail directory])
967 if test -d /var/mail -a '!' -h /var/mail ; then
968 system_mail_dir="/var/mail"
970 system_mail_dir="/var/spool/mail"
972 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
974 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
976 CAMEL_LOCK_HELPER_USER=""
977 CAMEL_LOCK_HELPER_GROUP=""
978 system_mail_perm="world writable"
981 CAMEL_LOCK_HELPER_USER=""
982 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
983 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
986 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
987 CAMEL_LOCK_HELPER_GROUP=""
988 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
991 CAMEL_LOCK_HELPER_USER=""
992 CAMEL_LOCK_HELPER_GROUP=""
993 system_mail_perm="???"
997 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
998 AC_SUBST(CAMEL_LOCK_HELPER_USER)
999 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
1001 dnl ******************************
1003 dnl ******************************
1004 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
1005 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1006 [[ #include <time.h> ]],
1011 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
1012 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
1013 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
1015 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
1016 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1017 [[ #include <time.h> ]],
1019 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
1020 if test "x$ac_cv_var_timezone" = "xyes"; then
1021 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
1022 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
1023 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1024 [[ #include <time.h> ]],
1026 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
1027 if test "x$ac_cv_var_altzone" = "xyes"; then
1028 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
1031 AC_MSG_ERROR([unable to find a way to determine timezone])
1035 dnl ******************************
1036 dnl ctime_r prototype
1037 dnl ******************************
1038 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
1040 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1041 [[ #include <time.h> ]],
1044 ctime_r (&date, buf, 100); ]]
1045 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
1048 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
1049 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
1052 dnl ******************************
1053 dnl gethostbyname_r prototype
1054 dnl ******************************
1055 AC_CHECK_FUNCS(gethostbyname_r,[
1056 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
1058 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1060 #include "confdefs.h"
1061 #include <sys/types.h>
1062 #include <sys/socket.h>
1063 #include <netinet/in.h>
1065 #define BUFSIZE (sizeof(struct hostent)+10)
1068 struct hostent hent;
1069 char buffer[BUFSIZE];
1070 int bufsize=BUFSIZE;
1072 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
1074 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
1077 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
1078 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
1081 dnl ******************************
1082 dnl gethostbyaddr_r prototype
1083 dnl ******************************
1084 AC_CHECK_FUNCS(gethostbyaddr_r,[
1085 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
1087 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1089 #include "confdefs.h"
1090 #include <sys/types.h>
1091 #include <sys/socket.h>
1092 #include <netinet/in.h>
1094 #define BUFSIZE (sizeof(struct hostent)+10)
1097 struct hostent hent;
1098 char buffer[BUFSIZE];
1099 int bufsize=BUFSIZE;
1101 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1102 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1105 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1106 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1109 dnl ******************************
1110 dnl stat(v)fs location/type
1111 dnl ******************************
1112 AC_CHECK_HEADER([sys/statvfs.h],
1113 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1114 [[ #if HAVE_SYS_STATVFS_H
1115 #include <sys/statvfs.h>
1118 AC_CHECK_FUNCS(statvfs)
1120 AC_CHECK_HEADER([sys/param.h],
1121 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1122 [[ #if HAVE_SYS_PARAM_H
1123 #include <sys/param.h>
1126 AC_CHECK_HEADER([sys/mount.h],
1127 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1128 [[ #if HAVE_SYS_MOUNT_H
1129 #include <sys/mount.h>
1132 AC_CHECK_FUNCS(statfs)
1134 dnl ******************************
1135 dnl IPv6 support and getaddrinfo calls
1136 dnl ******************************
1137 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1139 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1140 [[ #include "confdefs.h"
1141 #include <sys/types.h>
1142 #include <sys/socket.h>
1143 #include <netinet/in.h>
1147 [[ #ifndef NI_MAXHOST
1148 #define NI_MAXHOST 1025
1152 #define NI_MAXSERV 32
1155 struct addrinfo hints, *res;
1156 struct sockaddr_in6 sin6;
1158 char host[NI_MAXHOST];
1159 char serv[NI_MAXSERV];
1161 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1163 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1164 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1167 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1168 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1169 if test "x$enable_ipv6" = "xyes" ; then
1170 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1174 AC_ARG_ENABLE([ipv6],
1175 AS_HELP_STRING([--enable-ipv6=no/yes],
1176 [Enable support for resolving IPv6 addresses.]),
1177 [enable_ipv6=$enableval],[enable_ipv6=yes])
1178 if test "x$enable_ipv6" = "xyes"; then
1180 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1181 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1182 [[ #include "confdefs.h"
1183 #include <sys/types.h>
1184 #include <sys/socket.h>
1185 #include <netinet/in.h>
1188 [[ struct addrinfo hints;
1189 hints.ai_flags = AI_ADDRCONFIG;
1191 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1197 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1199 AC_CHECK_HEADER([wspiapi.h],
1200 [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1202 dnl **********************************
1203 dnl Weather calendar backend support
1204 dnl **********************************
1205 AC_MSG_CHECKING([if we should build the weather calendar backend])
1206 AC_ARG_ENABLE([weather],
1207 [AS_HELP_STRING([--enable-weather],
1208 [Build the weather calendar backend (default=yes)])],
1209 [use_gweather=$enableval], [use_gweather=yes])
1211 AC_MSG_RESULT([$use_gweather])
1212 if test "x$use_gweather" = "xyes"; then
1213 PKG_CHECK_MODULES([LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1214 [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.])])
1216 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1218 dnl ******************************
1220 dnl ******************************
1221 AC_ARG_ENABLE([nntp],
1222 AS_HELP_STRING([--enable-nntp],
1223 [Build Usenet news (NNTP) backend]),
1224 [enable_nntp=$enableval],[enable_nntp=yes])
1225 if test "x$enable_nntp" = "xyes"; then
1226 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1231 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1233 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1235 dnl ******************************
1237 dnl ******************************
1238 AC_ARG_ENABLE([dot-locking],
1239 AS_HELP_STRING([--enable-dot-locking=yes/no],
1240 [Enable support for locking mail files with dot locking]),
1241 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1243 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1244 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1250 AC_ARG_ENABLE([file-locking],
1251 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1252 [Enable support for locking mail files with file locking]),
1253 [],[enable_file_locking=fcntl])
1255 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1256 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1259 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1260 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1267 dnl ******************************
1268 dnl sendmail operation
1269 dnl ******************************
1270 AC_MSG_CHECKING([for SunOS broken spool format])
1271 if test "x$host_os" = "xsunos" ; then
1272 with_broken_spool="yes"
1275 AC_ARG_WITH([broken-spool],
1276 AS_HELP_STRING([--with-broken-spool=yes/no],
1277 [Using SunOS/Solaris sendmail which has a broken spool format]),
1278 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1280 if test "x$with_broken_spool" = "xyes"; then
1281 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1284 AC_MSG_RESULT([$with_broken_spool])
1289 EVO_KRB5_SUPPORT(no)
1291 dnl ******************************
1293 dnl ******************************
1296 dnl ******************************
1298 dnl ******************************
1299 if test "x$os_win32" != "xyes"; then
1301 case $with_openldap in
1306 case $with_static_ldap in
1308 msg_ldap="$with_openldap (static)"
1311 msg_ldap="$with_openldap (dynamic)"
1316 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1317 if test "x$with_openldap" = "xno" ; then
1318 EVO_SUNLDAP_CHECK(no)
1319 case $with_sunldap in
1324 case $with_static_sunldap in
1326 msg_ldap="$with_sunldap (static)"
1329 msg_ldap="$with_sunldap (dynamic)"
1336 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1338 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1340 dnl Win32 LDAP support
1341 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1342 LDAP_LIBS="-lwldap32"
1343 AC_SUBST(LDAP_CFLAGS)
1345 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1346 AM_CONDITIONAL(ENABLE_LDAP, true)
1347 AM_CONDITIONAL(SUNLDAP, false)
1351 dnl ******************************
1352 dnl GObject marshalling
1353 dnl ******************************
1356 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1357 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1358 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1360 dnl ******************************
1361 dnl Utility macro to set compiler flags for a specific lib.
1362 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1363 dnl ******************************
1364 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1365 PKG_CHECK_MODULES([$1], [$2])
1366 $1_CFLAGS="[$]$1_CFLAGS $3 "
1367 $1_LIBS="[$]$1_LIBS $4 "
1370 dnl ******************************
1372 dnl ******************************
1373 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1375 if test "x$enable_maintainer_mode" = "xyes" ; then
1376 EVO_SET_COMPILE_FLAGS(FACTORY_GTK, "gtk+-3.0")
1377 AC_SUBST(FACTORY_GTK_CFLAGS)
1378 AC_SUBST(FACTORY_GTK_LIBS)
1381 dnl ******************************
1382 dnl libedataserver flags
1383 dnl ******************************
1384 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libxml-2.0 libsoup-2.4 $mozilla_nspr"
1386 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1387 AC_SUBST(E_DATA_SERVER_CFLAGS)
1388 AC_SUBST(E_DATA_SERVER_LIBS)
1390 dnl ******************************
1391 dnl libebackend flags
1392 dnl ******************************
1393 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libsoup-2.4 libxml-2.0"
1395 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1396 AC_SUBST(E_BACKEND_CFLAGS)
1397 AC_SUBST(E_BACKEND_LIBS)
1399 dnl ******************************
1400 dnl evolution-addressbook flags
1401 dnl ******************************
1402 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 libsoup-2.4 libsecret-1"
1404 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1405 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1406 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1408 dnl ******************************
1409 dnl evolution-calendar flags
1410 dnl ******************************
1411 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libsoup-2.4 libxml-2.0 libsecret-1"
1414 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1415 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1416 dnl to differentiate between <libical/ical.h> and <ical.h>
1417 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1418 dnl libical is fixed, we have to work-around the buggy CFlags.
1420 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1421 LIBICAL_EXTRA_LIBS=""
1422 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1423 AC_SUBST(LIBICAL_EXTRA_LIBS)
1425 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1426 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1427 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1429 dnl ****************************
1430 dnl Check for ical_set_unknown_token_handling_setting function
1431 dnl ****************************
1432 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1433 save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1434 save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1435 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1436 [[#include <libical/ical.h>]],
1437 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1438 [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])
1441 AC_MSG_RESULT([$ac_cv_have_iuth])
1443 dnl ******************************
1445 dnl ******************************
1446 LIBGDATA_REQUIRED=libgdata_minimum_version
1447 AC_SUBST(LIBGDATA_REQUIRED)
1448 AC_ARG_ENABLE([google],
1449 [AS_HELP_STRING([--enable-google],
1450 [enable Google Contacts support (default=yes)])],
1451 [enable_google=$enableval], [enable_google=yes])
1452 AC_MSG_CHECKING([if Google Contacts support is enabled])
1453 AC_MSG_RESULT([$enable_google])
1454 if test "x$enable_google" = xyes; then
1455 EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= libgdata_minimum_version)
1456 AC_SUBST(GDATA_CFLAGS)
1457 AC_SUBST(GDATA_LIBS)
1459 AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if you have the google-1.0 package.])
1461 AM_CONDITIONAL(HAVE_GOOGLE, [test x$enable_google = xyes])
1463 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1464 AC_SUBST(SOUP_CFLAGS)
1467 dnl ******************************
1469 dnl ******************************
1470 SQLITE_REQUIRED=sqlite_minimum_version
1471 AC_SUBST(SQLITE_REQUIRED)
1474 dnl deflateInit is a #define, use deflateEnd instead
1475 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1477 if test "x$zlib_found" = "xfalse"; then
1478 AC_MSG_ERROR([*** zlib is required])
1481 dnl ******************************
1482 dnl Checks for large file support
1483 dnl ******************************
1484 AC_ARG_ENABLE([largefile],
1485 AS_HELP_STRING([--enable-largefile],
1486 [enable support for large files [[default=no]]]),
1487 [],[enable_largefile="yes"])
1489 if test "x$enable_largefile" != "xno"; then
1491 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1492 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1493 [[ #include <sys/types.h>
1494 #include <sys/stat.h>
1497 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1498 )],[ac_cv_largefile64_source="no"],
1499 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1500 [[ #define _LARGEFILE64_SOURCE
1501 #include <sys/types.h>
1502 #include <sys/stat.h>
1505 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1506 [ac_cv_largefile64_source="unknown"])])
1509 enable_largefile="no"
1511 if test "x$ac_cv_largefile64_source" = "xyes"; then
1512 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1513 enable_largefile="yes"
1514 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1515 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1518 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1519 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1520 enable_largefile="yes"
1523 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1524 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1525 enable_largefile="yes"
1528 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1532 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1534 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)
1535 AC_SUBST(CAMEL_CFLAGS)
1536 AC_SUBST(CAMEL_LIBS)
1538 dnl ******************************
1539 dnl Special directories
1540 dnl ******************************
1542 dnl If you add something here, consider whether or not you also
1543 dnl need to add it to one or more .pc.in files (for Connector,
1546 privdatadir='${datadir}'/evolution-data-server
1547 AC_SUBST(privdatadir)
1549 privincludedir='${includedir}'/evolution-data-server
1550 AC_SUBST(privincludedir)
1552 privlibdir='${libdir}'/evolution-data-server
1553 AC_SUBST(privlibdir)
1555 imagesdir='${datadir}'/pixmaps/evolution-data-server
1558 moduledir='${privlibdir}'/registry-modules
1561 ebook_backenddir='${privlibdir}'/addressbook-backends
1562 AC_SUBST(ebook_backenddir)
1564 ecal_backenddir='${privlibdir}'/calendar-backends
1565 AC_SUBST(ecal_backenddir)
1567 ro_sourcesdir='${privdatadir}'/ro-sources
1568 AC_SUBST(ro_sourcesdir)
1570 rw_sourcesdir='${privdatadir}'/rw-sources
1571 AC_SUBST(rw_sourcesdir)
1573 if test "x$use_gweather" = "xyes"; then
1574 weatherdatadir="$privdatadir/weather"
1575 AC_SUBST(weatherdatadir)
1578 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1579 camel_providerdir='${privlibdir}'/camel-providers
1580 AC_SUBST(camel_providerdir)
1582 dnl *******************
1583 dnl D-BUS service stuff
1584 dnl *******************
1585 m4_pattern_allow([AM_V_GEN])
1586 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)|" -e "s|\@USER_PROMPTER_DBUS_SERVICE_NAME\@|$(USER_PROMPTER_DBUS_SERVICE_NAME)|" $< > $@'
1587 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1589 dnl ******************************
1591 dnl ******************************
1595 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1596 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1597 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1599 dnl ******************************
1601 dnl ******************************
1602 AC_PATH_PROG(GPERF, gperf, [no])
1603 if test "x$GPERF" = "xno"; then
1604 AC_MSG_ERROR([You need gperf to build evolution-data-server])
1607 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1609 dnl ******************************
1611 dnl ******************************
1612 AC_ARG_ENABLE(vala-bindings,
1613 AC_HELP_STRING([--enable-vala-bindings],
1614 [build the EXPERIMENTAL Vala bindings]),
1615 enable_vala_bindings=$enableval,
1616 enable_vala_bindings=no)
1618 if test x$enable_vala_bindings = xyes; then
1619 if test "x$INTROSPECTION_SCANNER" = x; then
1620 AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1623 AM_PROG_VALAC([0.13.0])
1626 AC_PATH_PROG(VALAC, valac, valac)
1630 AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1632 if test "x$VAPIGEN" = "xfalse"; then
1633 AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1639 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1642 dnl ******************************
1644 dnl ******************************
1646 export privincludedir
1651 evolution-data-server-zip
1652 evolution-data-server.pc
1653 addressbook/Makefile
1654 addressbook/libebook/Makefile
1655 addressbook/libebook/libebook.pc
1656 addressbook/libedata-book/Makefile
1657 addressbook/libedata-book/libedata-book.pc
1658 addressbook/libegdbus/Makefile
1659 addressbook/backends/Makefile
1660 addressbook/backends/file/Makefile
1661 addressbook/backends/ldap/Makefile
1662 addressbook/backends/google/Makefile
1663 addressbook/backends/google/tests/Makefile
1664 addressbook/backends/webdav/Makefile
1667 calendar/libecal/Makefile
1668 calendar/libecal/libecal.pc
1669 calendar/libedata-cal/Makefile
1670 calendar/libedata-cal/libedata-cal.pc
1671 calendar/libegdbus/Makefile
1672 calendar/backends/Makefile
1673 calendar/backends/caldav/Makefile
1674 calendar/backends/file/Makefile
1675 calendar/backends/http/Makefile
1676 calendar/backends/contacts/Makefile
1677 calendar/backends/weather/Makefile
1679 camel/providers/Makefile
1680 camel/providers/imapx/Makefile
1681 camel/providers/local/Makefile
1682 camel/providers/nntp/Makefile
1683 camel/providers/pop3/Makefile
1684 camel/providers/sendmail/Makefile
1685 camel/providers/smtp/Makefile
1686 camel/tests/Makefile
1687 camel/tests/folder/Makefile
1688 camel/tests/lib/Makefile
1689 camel/tests/message/Makefile
1690 camel/tests/mime-filter/Makefile
1691 camel/tests/misc/Makefile
1692 camel/tests/smime/Makefile
1695 libebackend/Makefile
1696 libebackend/libebackend.pc
1697 libedataserver/Makefile
1698 libedataserver/eds-version.h
1699 libedataserver/libedataserver.pc
1701 modules/cache-reaper/Makefile
1702 modules/gnome-online-accounts/Makefile
1703 modules/google-backend/Makefile
1704 modules/owncloud-backend/Makefile
1705 modules/ubuntu-online-accounts/Makefile
1706 modules/ubuntu-online-accounts/calendar.service-type.in
1707 modules/ubuntu-online-accounts/contacts.service-type.in
1708 modules/ubuntu-online-accounts/evolution-data-server.application.in
1709 modules/ubuntu-online-accounts/google-calendar.service.in
1710 modules/ubuntu-online-accounts/google-contacts.service.in
1711 modules/ubuntu-online-accounts/google-gmail.service.in
1712 modules/ubuntu-online-accounts/mail.service-type.in
1713 modules/ubuntu-online-accounts/yahoo-calendar.service.in
1714 modules/ubuntu-online-accounts/yahoo-mail.service.in
1715 modules/trust-prompt/Makefile
1716 modules/yahoo-backend/Makefile
1719 services/evolution-addressbook-factory/Makefile
1720 services/evolution-calendar-factory/Makefile
1721 services/evolution-source-registry/Makefile
1722 services/evolution-user-prompter/Makefile
1724 tests/libebook/Makefile
1725 tests/libebook/client/Makefile
1726 tests/libebook/vcard/Makefile
1727 tests/libecal/Makefile
1728 tests/libecal/client/Makefile
1729 tests/libedata-cal/Makefile
1730 tests/libedataserver/Makefile
1731 tests/test-server-utils/Makefile
1732 tests/test-server-utils/services/Makefile
1733 tests/test-server-utils/services/org.gnome.evolution.dataserver.AddressBook.service
1734 tests/test-server-utils/services/org.gnome.evolution.dataserver.Calendar.service
1735 tests/test-server-utils/services/org.gnome.evolution.dataserver.Sources.service
1737 docs/reference/Makefile
1738 docs/reference/addressbook/Makefile
1739 docs/reference/addressbook/libebook/Makefile
1740 docs/reference/addressbook/libedata-book/Makefile
1741 docs/reference/calendar/Makefile
1742 docs/reference/calendar/libecal/Makefile
1743 docs/reference/calendar/libedata-cal/Makefile
1744 docs/reference/camel/Makefile
1745 docs/reference/libedataserver/Makefile
1746 docs/reference/libebackend/Makefile
1747 docs/reference/private/Makefile
1754 evolution-data-server has been configured as follows:
1755 Weather calendar: $use_gweather
1756 Mail Directory: $system_mail_dir, $system_mail_perm
1757 LDAP support: $msg_ldap
1758 NNTP support: $msg_nntp
1759 Kerberos 5: $msg_krb5
1760 SMIME support: $msg_smime
1761 IPv6 support: $msg_ipv6
1762 Phone number support: $msg_phonenumber
1763 Dot Locking: $msg_dot
1764 File Locking: $msg_file
1765 Large files: $enable_largefile
1766 Gtk Doc: $enable_gtk_doc
1767 Introspection: $enable_introspection
1768 Vala bindings: $enable_vala_bindings
1769 GNOME Online Accounts $enable_goa
1770 Ubuntu Online Accounts $enable_uoa
1771 Google Contacts $enable_google
1773 Code coverage (gcov): $enable_code_coverage
1774 Strict building: $enable_strict