2 dnl Evolution-Data-Server version
3 m4_define([eds_major_version], [3])
4 m4_define([eds_minor_version], [11])
5 m4_define([eds_micro_version], [1])
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.12])
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.36])
39 m4_define([glib_encoded_version], [GLIB_VERSION_2_36])
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.8])
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.Sources2"
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=18
110 LIBEDATASERVER_REVISION=0
117 LIBEDATACAL_CURRENT=23
118 LIBEDATACAL_REVISION=0
121 LIBEDATABOOK_CURRENT=20
122 LIBEDATABOOK_REVISION=0
129 LIBEBOOK_CONTACTS_CURRENT=0
130 LIBEBOOK_CONTACTS_REVISION=0
131 LIBEBOOK_CONTACTS_AGE=0
137 LIBEBACKEND_CURRENT=7
138 LIBEBACKEND_REVISION=0
141 AC_SUBST(EDS_MAJOR_VERSION)
142 AC_SUBST(EDS_MINOR_VERSION)
143 AC_SUBST(EDS_MICRO_VERSION)
144 AC_SUBST(LIBEDATASERVER_CURRENT)
145 AC_SUBST(LIBEDATASERVER_REVISION)
146 AC_SUBST(LIBEDATASERVER_AGE)
147 AC_SUBST(LIBECAL_CURRENT)
148 AC_SUBST(LIBECAL_REVISION)
149 AC_SUBST(LIBECAL_AGE)
150 AC_SUBST(LIBEDATACAL_CURRENT)
151 AC_SUBST(LIBEDATACAL_REVISION)
152 AC_SUBST(LIBEDATACAL_AGE)
153 AC_SUBST(LIBEBOOK_CURRENT)
154 AC_SUBST(LIBEBOOK_REVISION)
155 AC_SUBST(LIBEBOOK_AGE)
156 AC_SUBST(LIBEBOOK_CONTACTS_CURRENT)
157 AC_SUBST(LIBEBOOK_CONTACTS_REVISION)
158 AC_SUBST(LIBEBOOK_CONTACTS_AGE)
159 AC_SUBST(LIBEDATABOOK_CURRENT)
160 AC_SUBST(LIBEDATABOOK_REVISION)
161 AC_SUBST(LIBEDATABOOK_AGE)
162 AC_SUBST(LIBCAMEL_CURRENT)
163 AC_SUBST(LIBCAMEL_REVISION)
164 AC_SUBST(LIBCAMEL_AGE)
165 AC_SUBST(LIBEBACKEND_CURRENT)
166 AC_SUBST(LIBEBACKEND_REVISION)
167 AC_SUBST(LIBEBACKEND_AGE)
169 dnl **************************************
170 dnl Put the ACLOCAL flags in the Makefile
171 dnl **************************************
172 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
174 dnl *********************************************
175 dnl Figure out early if we'll need a C++ compiler
176 dnl *********************************************
181 dnl ******************************
182 dnl Compiler Warning Flags
183 dnl ******************************
184 proposed_warning_flags="-Wall -Wextra
185 -Wdeprecated-declarations
186 -Werror-implicit-function-declaration
187 -Wformat-security -Winit-self
188 -Wmissing-declarations -Wmissing-include-dirs
189 -Wmissing-noreturn -Wpointer-arith
190 -Wredundant-decls -Wundef -Wwrite-strings"
192 proposed_c_warning_flags="$proposed_warning_flags
193 -Wdeclaration-after-statement
194 -Wno-missing-field-initializers
196 -Wno-unused-parameter
199 proposed_cxx_warning_flags="$proposed_warning_flags
202 AS_COMPILER_FLAGS(WARNING_FLAGS, [$proposed_c_warning_flags])
203 AC_SUBST(WARNING_FLAGS)
205 dnl Other useful compiler warnings for test builds only.
206 dnl These may produce warnings we have no control over,
207 dnl or false positives we don't always want to see.
209 dnl -Wformat-nonliteral
210 dnl -Wmissing-format-attribute
212 dnl -Wstrict-aliasing=2
214 AM_CFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
217 if test "x$evo_with_cxx" = xyes; then
221 AS_COMPILER_FLAGS(CXX_WARNING_FLAGS, [$proposed_cxx_warning_flags])
222 AC_SUBST(CXX_WARNING_FLAGS)
223 AM_CXXFLAGS="$CXX_WARNING_FLAGS"
224 AC_SUBST(AM_CXXFLAGS)
227 dnl Autoconf requires those automake conditionals to be defined when
228 dnl generating the config files, but apparently it forgets to initialize
229 dnl them dnl if AC_PROG_CXX never gets called. Therefore we do it manually.
230 am__fastdepCXX_TRUE='#'
231 am__fastdepCXX_FALSE=
234 dnl Permits linking of C++ based libraries using the C linker if needed.
235 AC_SUBST([predeps_CXX])
236 AC_SUBST([postdeps_CXX])
238 dnl *******************************
239 dnl Check for --enable-strict
240 dnl *******************************
241 AC_ARG_ENABLE([strict],
242 [AS_HELP_STRING([--enable-strict],
243 [enable strict building, like without deprecated symbols (default=auto); auto enables strict building only if .git subdirectory exists])],
244 [enable_strict=$enableval], [enable_strict=auto])
246 AC_MSG_CHECKING([if strict building is enabled])
247 if test "x$enable_strict" = xauto; then
248 dnl Be strict when compiling with .git subdirectory
249 if test -d .git ; then
255 AC_MSG_RESULT([$enable_strict])
259 if test "x$enable_strict" = xyes; then
260 AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
263 dnl Warn about API usage that violates our minimum requirements.
264 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
265 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
266 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
268 dnl These will suppress warnings about newly-deprecated symbols. Ideally
269 dnl these settings should match our minimum requirements and we will clean
270 dnl up any new deprecation warnings after bumping our minimum requirements.
271 dnl But if the warnings get to be overwhelming, use fixed versions instead.
272 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
273 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"
274 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
276 AC_SUBST(AM_CPPFLAGS)
278 dnl ******************************
279 dnl Initialize maintainer mode
280 dnl ******************************
281 AM_MAINTAINER_MODE([enable])
283 if test "x$enable_maintainer_mode" = "xyes" ; then
284 AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
295 dnl For gen-western-table.py
298 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
299 dnl behavior that -- according to the C99 standard -- is supposed to be
300 dnl undefined. We may still have aliasing abuses lying around that rely
301 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
302 dnl optimization until we can find and fix all the abuses.
303 dnl (AC_PROG_CC must run first to set the GCC variable.)
304 dnl XXX This really belongs in AM_CFLAGS.
305 if test "x${GCC}" = "xyes"; then
306 CFLAGS="$CFLAGS -fno-strict-aliasing"
309 dnl ******************************
311 dnl ******************************
312 IT_PROG_INTLTOOL([0.35.5])
314 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
315 AC_SUBST(GETTEXT_PACKAGE)
316 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
318 localedir='$(prefix)/$(DATADIRNAME)/locale'
321 dnl ******************************
322 dnl Initialize libtool
323 dnl ******************************
325 LT_INIT(disable-static win32-dll)
329 dnl This relies on $SED, which is defined in ltmain.sh, which
330 dnl is invoked by LT_INIT (at least I think that's how it works).
333 dnl ******************************
335 dnl ******************************
336 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
338 dnl The private D-Bus documentation is for developers only.
339 AC_ARG_WITH([private-docs],
340 AS_HELP_STRING([--with-private-docs],
341 [Build documentation for private libraries ]
342 [(requires --enable-gtk-doc) [default=no]],),
343 [with_private_docs="$withval"],[with_private_docs="no"])
344 AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
346 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
349 dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
352 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
356 dnl ******************************
358 dnl ******************************
359 AC_MSG_CHECKING([for Win32])
363 NO_UNDEFINED='-no-undefined'
364 SOCKET_LIBS='-lws2_32 -ldnsapi'
366 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
367 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
368 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
375 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
382 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
385 AC_MSG_RESULT([$os_win32])
386 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
387 AC_SUBST(NO_UNDEFINED)
388 AC_SUBST(SOCKET_LIBS)
389 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
391 dnl **************************************
392 dnl Check for posix compatible sys/wait.h
393 dnl **************************************
396 dnl ************************************
397 dnl Check for posix compatible alloca()
398 dnl ************************************
401 dnl ******************************
402 dnl Checks for functions
403 dnl ******************************
404 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
406 dnl ***********************************
407 dnl Check for base dependencies early.
408 dnl ***********************************
409 PKG_CHECK_MODULES(GNOME_PLATFORM,
410 [gio-2.0 >= glib_minimum_version
411 gmodule-2.0 >= glib_minimum_version
412 libxml-2.0 >= libxml_minimum_version
413 libsoup-2.4 >= soup_minimum_version])
415 if test x$os_win32 = xno; then
416 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
419 dnl ******************************
420 dnl Check for libphonenumber
421 dnl ******************************
423 EVO_PHONENUMBER_SUPPORT
425 dnl *************************
427 dnl *************************
429 [AS_HELP_STRING([--enable-gtk],
430 [enable GTK+ (default=yes)])],
431 [enable_gtk=$enableval], [enable_gtk=yes])
432 AC_MSG_CHECKING([if GTK+ support is enabled])
433 AC_MSG_RESULT([$enable_gtk])
434 if test "x$enable_gtk" = xyes; then
436 [GTK], [gtk+-3.0 >= gdk_minimum_version],,
439 gtk+-3.0 not found (or version < gdk_minimum_version)
441 If you want to disable GTK+ support,
442 please append --disable-gtk to configure.
447 [GCR], [gcr-3 >= gcr_minimum_version],,
450 gcr-3.0 not found (or version < gcr_minimum_version)
452 If you want to disable gcr-3.0's GTK+ widgets,
453 please append --disable-gtk to configure.
457 AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
459 AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
461 dnl *******************************
462 dnl Check for GNOME Online Accounts
463 dnl *******************************
465 [AS_HELP_STRING([--enable-goa],
466 [enable GNOME Online Accounts support (default=yes)])],
467 [enable_goa=$enableval], [enable_goa=yes])
468 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
469 AC_MSG_RESULT([$enable_goa])
470 if test "x$enable_goa" = xyes; then
472 [GOA], [goa-1.0 >= goa_minimum_version],,
475 goa-1.0 not found (or version < goa_minimum_version)
477 If you want to disable GNOME Online Accounts support,
478 please append --disable-goa to configure.
482 AC_DEFINE(HAVE_GOA, 1, [Define to 1 if you have the goa-1.0 package.])
484 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
486 dnl ********************************
487 dnl Check for Ubuntu Online Accounts
488 dnl ********************************
490 [AS_HELP_STRING([--enable-uoa],
491 [enable Ubuntu Online Accounts support (default=yes)])],
492 [enable_uoa=$enableval], [enable_uoa=yes])
493 AC_MSG_CHECKING([if Ubuntu Online Accounts support is enabled])
494 AC_MSG_RESULT([$enable_uoa])
495 if test "x$enable_uoa" = xyes; then
498 [libaccounts-glib >= libaccounts_glib_minimum_version],,
501 libaccounts-glib not found (or version < libaccounts_glib_minimum_version)
503 If you want to disable Ubuntu Online Accounts support,
504 please append --disable-uoa to configure.
510 [libsignon-glib >= libsignon_glib_minimum_version],,
513 libsignon-glib not found (or version < libsignon_glib_minimum_version)
515 If you want to disable Ubuntu Online Accounts support,
516 please append --disable-uoa to configure.
521 [JSON_GLIB], [json-glib-1.0],,
524 json-glib-1.0 not found
526 If you want to disable Ubuntu Online Accounts support,
527 please append --disable-uoa to configure.
535 librest-0.7 not found
537 If you want to disable Ubuntu Online Accounts support,
538 please append --disable-uoa to configure.
542 AC_DEFINE(HAVE_UOA, 1, [Have libaccounts-glib])
544 AM_CONDITIONAL(HAVE_UOA, [test x$enable_uoa = xyes])
546 dnl ***********************************
547 dnl Check for GNOME Keyring.
548 dnl ***********************************
549 if test x$os_win32 = xno; then
550 PKG_CHECK_MODULES(LIBSECRET,
551 [libsecret-unstable >= libsecret_minimum_version])
553 AC_SUBST(LIBSECRET_CFLAGS)
554 AC_SUBST(LIBSECRET_LIBS)
556 dnl **********************************************************
557 dnl gcr-base is needed for secure password exchange over D-Bus
558 dnl **********************************************************
559 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
560 AC_SUBST(GCR_BASE_CFLAGS)
561 AC_SUBST(GCR_BASE_LIBS)
563 LIBICAL_REQUIRED=libical_minimum_version
564 AC_SUBST(LIBICAL_REQUIRED)
566 dnl ******************************
568 dnl ******************************
569 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
571 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
572 [AC_MSG_ERROR([No regex library found])])])
575 dnl ******************************
577 dnl ******************************
579 AS_HELP_STRING([--with-libdb=PREFIX],
580 [Prefix where libdb is installed]),
581 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
583 DB_CFLAGS="-I$libdb_prefix/include"
584 DB_LIBS="-L$libdb_prefix/lib -ldb"
586 AC_MSG_CHECKING([Berkeley DB])
587 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
588 save_libs=$LIBS; LIBS="$DB_LIBS"
589 AC_LINK_IFELSE([AC_LANG_PROGRAM(
591 [[db_create(NULL, NULL, 0)]])],
592 [AC_MSG_RESULT([yes])],
593 [AC_MSG_ERROR([Cannot find libdb])])
599 dnl ******************************
601 dnl ******************************
603 AC_PATH_PROG(DB_LOAD, [db_load])
604 if test -z "$DB_LOAD"; then
605 AC_MSG_WARN([db_load not found, some unit tests will not be run.])
610 AM_CONDITIONAL(HAVE_DB_LOAD, test x"$have_db_load" = "xyes")
612 dnl ******************************
614 dnl ******************************
618 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
619 AC_LINK_IFELSE([AC_LANG_PROGRAM(
626 cd = iconv_open ("UTF-8", "ISO-8859-1");
628 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
630 if test "x$ac_cv_libiconv" = "xyes"; then
632 if test "x$os_win32" = "xyes"; then
633 dnl Don't pointlessly auto-export the global symbols
634 dnl from a potentially static libiconv.a
635 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
640 AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
643 if test "x$have_iconv" = "xyes"; then
644 if test "x$ac_cv_libiconv" = "xno"; then
645 AC_CHECK_FUNCS(gnu_get_libc_version)
647 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
648 AC_RUN_IFELSE([AC_LANG_SOURCE([[
652 #ifdef HAVE_GNU_GET_LIBC_VERSION
653 #include <gnu/libc-version.h>
656 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
657 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
658 char *transbuf = malloc (10), *trans = transbuf;
660 size_t jp_len = strlen (jp), utf8_len = 10;
661 size_t utf8_real_len = strlen (utf8);
663 #ifdef HAVE_GNU_GET_LIBC_VERSION
664 /* glibc 2.1.2's iconv is broken in hard to test ways. */
665 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
669 cd = iconv_open ("UTF-8", "ISO-2022-JP");
670 if (cd == (iconv_t) -1)
672 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
674 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
678 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
681 if test "x$have_iconv" = "xno"; then
682 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
686 CFLAGS="$CFLAGS -I$srcdir"
688 AC_MSG_CHECKING([preferred charset name formats for system iconv])
689 AC_RUN_IFELSE([AC_LANG_SOURCE([[
691 #include "iconv-detect.c"
693 [AC_MSG_RESULT([found])],
694 [AC_MSG_RESULT([not found])
696 *** The iconv-detect program was unable to determine the
697 *** preferred charset name formats recognized by your
698 *** iconv library. It is suggested that you install a
699 *** working iconv library such as the one found at
700 *** ftp://ftp.gnu.org/pub/gnu/libiconv
702 [if test "x$os_win32" = xyes; then
703 AC_MSG_RESULT([using known win32 result])
704 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
705 echo >>iconv-detect.h
706 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
707 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
708 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
710 AC_MSG_RESULT([unknown])
712 *** We can't determine the preferred charset name formats
713 *** recognized by your iconv library. You are
714 *** cross-compiling and supposed to know what you are doing.
715 *** Please construct the iconv-detect.h file manually.
720 CFLAGS="$save_CFLAGS"
723 AC_ARG_ENABLE([backtraces],
724 [AS_HELP_STRING([--enable-backtraces],
725 [enable backtraces for camel_pointer_tracker (default=no)])],
726 [enable_backtraces=$enableval], [enable_backtraces=no])
728 if test "x$enable_backtraces" = xyes; then
729 dnl ****************************
730 dnl Check for backtrace_symbols function and dwfl from elfutils
731 dnl ****************************
732 AC_MSG_CHECKING([libc backtrace_symbols function])
733 AC_LINK_IFELSE([AC_LANG_PROGRAM(
734 [[#include <execinfo.h>]],
735 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
736 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
737 AC_MSG_RESULT([$ac_cv_have_bsf])
739 if test "x$ac_cv_have_bsf" = xyes; then
742 AC_MSG_CHECKING([elfutils/libdwfl])
743 AC_LINK_IFELSE([AC_LANG_PROGRAM(
744 [[#include <elfutils/libdwfl.h>]],
748 Dwarf_Addr module_low_addr;
751 dwfl_standard_find_debuginfo;
752 dwfl_linux_proc_find_elf;
754 dwfl_linux_proc_report (NULL, 1);
755 dwfl_report_end (NULL, NULL, NULL);
757 dwfl_module_addrname (NULL, NULL);
758 dwfl_module_getsrc (NULL, NULL);
759 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
760 DWARF_CB_ABORT; DWARF_CB_OK;
761 dwfl_getmodules (NULL, NULL, NULL, 0);
763 [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
764 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
768 if test "x$ac_cv_have_elfdwfl" = xyes; then
770 AC_SUBST(LIBDWFL_LIBS)
775 dnl ******************************
776 dnl Check for nl_langinfo features
777 dnl ******************************
778 EVO_CHECK_LANGINFO([CODESET])
779 EVO_CHECK_LANGINFO([_NL_ADDRESS_COUNTRY_AB2])
781 dnl *******************************************************
782 dnl Check to see if strftime supports the use of %l and %k
783 dnl *******************************************************
784 AC_MSG_CHECKING([for %l and %k support in strftime])
785 AC_RUN_IFELSE([AC_LANG_SOURCE(
786 [[ #include <stdlib.h>
789 int main(int argc, char **argv) {
795 timeinfo=localtime(&rawtime);
797 strftime(buf, 10, "%lx%k", timeinfo);
799 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
806 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
807 AC_MSG_RESULT([$ac_cv_lkstrftime])
809 dnl ********************************************************************************
810 dnl security extension support (SSL and S/MIME)
812 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
813 dnl needed by Camel (SSL and S/MIME).
815 dnl The Evolution security extensions are only built if these libraries are found
816 dnl ********************************************************************************
819 AC_ARG_ENABLE([smime],
820 AS_HELP_STRING([--enable-smime],
821 [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
822 [enable_smime="$enableval"],[enable_smime="yes"])
824 AC_ARG_WITH([nspr-includes],
825 AS_HELP_STRING([--with-nspr-includes],
826 [Prefix of Mozilla nspr4 includes.]),
827 [with_nspr_includes="$withval"])
829 AC_ARG_WITH([nspr-libs],
830 AS_HELP_STRING([--with-nspr-libs],
831 [Prefix of Mozilla nspr4 libs.]),
832 [with_nspr_libs="$withval"])
834 AC_ARG_WITH([nss-includes],
835 AS_HELP_STRING([--with-nss-includes],
836 [Prefix of Mozilla nss3 includes.]),
837 [with_nss_includes="$withval"])
839 AC_ARG_WITH([nss-libs],
840 AS_HELP_STRING([--with-nss-libs],
841 [Prefix of Mozilla nss3 libs.]),
842 [with_nss_libs="$withval"])
844 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
850 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
851 if test "x${check_manually}" = "xno"; then
852 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
853 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
854 for pc in $mozilla_nspr_pcs; do
855 if $PKG_CONFIG --exists $pc; then
862 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
863 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
864 for pc in $mozilla_nss_pcs; do
865 if $PKG_CONFIG --exists $pc; then
872 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
873 if test "x$enable_smime" = "xyes"; then
874 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
877 MANUAL_NSPR_CFLAGS=""
888 if test "x${check_manually}" = "xyes"; then
889 dnl ******************
891 dnl ******************
892 AC_MSG_CHECKING([for Mozilla nspr4 includes])
893 CPPFLAGS_save="$CPPFLAGS"
894 if test -n "$with_nspr_includes"; then
895 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
898 AC_CHECK_HEADERS(nspr.h prio.h,
899 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
900 CPPFLAGS="$CPPFLAGS_save"
902 if test "x${moz_nspr_includes}" = "xyes"; then
903 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
905 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
907 AC_MSG_RESULT([$moz_nspr_includes])
909 AC_MSG_CHECKING([for Mozilla nspr libraries])
910 CFLAGS_save="$CFLAGS"
911 LDFLAGS_save="$LDFLAGS"
913 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
915 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
917 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
918 if test -n "${with_nspr_libs}"; then
919 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
924 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
925 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
927 CFLAGS="$CFLAGS_save"
928 LDFLAGS="$LDFLAGS_save"
931 if test "x${moz_nspr_libs}" = "xyes"; then
932 if test -n "${with_nspr_libs}"; then
933 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
935 MANUAL_NSPR_LIBS="$nsprlibs"
938 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
940 AC_MSG_RESULT([$moz_nspr_libs])
942 dnl *****************
944 dnl *****************
945 AC_MSG_CHECKING([for Mozilla nss3 includes])
946 CPPFLAGS_save="$CPPFLAGS"
947 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
949 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
950 [moz_nss_includes="yes"],[moz_nss_includes="no"])
951 CPPFLAGS="$CPPFLAGS_save"
953 if test "x${moz_nss_includes}" = "xyes"; then
954 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
956 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
958 AC_MSG_RESULT($moz_nss_includes)
960 AC_MSG_CHECKING([for Mozilla nss libraries])
961 LDFLAGS_save="$LDFLAGS"
963 nsslibs="-lssl3 -lsmime3 -lnss3"
965 LIBS="$nsslibs $nsprlibs"
966 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
967 if test -n "${with_nss_libs}"; then
968 LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
970 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
973 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
974 [moz_nss_libs="yes"],[moz_nss_libs="no"])
975 LDFLAGS="$LDFLAGS_save"
978 if test "x${moz_nss_libs}" = "xyes"; then
979 if test "x${enable_smime}" = "xyes"; then
980 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
983 if test -n "${with_nss_libs}"; then
984 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
986 MANUAL_NSS_LIBS="$nsslibs"
989 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
991 AC_MSG_RESULT([$moz_nss_libs])
993 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
994 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
997 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
999 dnl For pkgconfig files.
1000 AC_SUBST(mozilla_nss)
1001 AC_SUBST(mozilla_nspr)
1003 AC_SUBST(MANUAL_NSPR_CFLAGS)
1004 AC_SUBST(MANUAL_NSPR_LIBS)
1005 AC_SUBST(MANUAL_NSS_CFLAGS)
1006 AC_SUBST(MANUAL_NSS_LIBS)
1008 dnl ******************************
1009 dnl system mail stuff
1010 dnl ******************************
1011 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
1012 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
1014 AC_MSG_CHECKING([system mail directory])
1015 if test -d /var/mail -a '!' -h /var/mail ; then
1016 system_mail_dir="/var/mail"
1018 system_mail_dir="/var/spool/mail"
1020 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
1022 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
1024 CAMEL_LOCK_HELPER_USER=""
1025 CAMEL_LOCK_HELPER_GROUP=""
1026 system_mail_perm="world writable"
1029 CAMEL_LOCK_HELPER_USER=""
1030 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
1031 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
1034 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
1035 CAMEL_LOCK_HELPER_GROUP=""
1036 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
1039 CAMEL_LOCK_HELPER_USER=""
1040 CAMEL_LOCK_HELPER_GROUP=""
1041 system_mail_perm="???"
1045 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
1046 AC_SUBST(CAMEL_LOCK_HELPER_USER)
1047 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
1049 dnl ******************************
1051 dnl ******************************
1052 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
1053 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1054 [[ #include <time.h> ]],
1059 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
1060 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
1061 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
1063 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
1064 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1065 [[ #include <time.h> ]],
1067 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
1068 if test "x$ac_cv_var_timezone" = "xyes"; then
1069 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
1070 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
1071 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1072 [[ #include <time.h> ]],
1074 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
1075 if test "x$ac_cv_var_altzone" = "xyes"; then
1076 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
1079 AC_MSG_ERROR([unable to find a way to determine timezone])
1083 dnl ******************************
1084 dnl ctime_r prototype
1085 dnl ******************************
1086 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
1088 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1089 [[ #include <time.h> ]],
1092 ctime_r (&date, buf, 100); ]]
1093 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
1096 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
1097 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
1100 dnl ******************************
1101 dnl gethostbyname_r prototype
1102 dnl ******************************
1103 AC_CHECK_FUNCS(gethostbyname_r,[
1104 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
1106 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1108 #include "confdefs.h"
1109 #include <sys/types.h>
1110 #include <sys/socket.h>
1111 #include <netinet/in.h>
1113 #define BUFSIZE (sizeof(struct hostent)+10)
1116 struct hostent hent;
1117 char buffer[BUFSIZE];
1118 int bufsize=BUFSIZE;
1120 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
1122 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
1125 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
1126 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
1129 dnl ******************************
1130 dnl gethostbyaddr_r prototype
1131 dnl ******************************
1132 AC_CHECK_FUNCS(gethostbyaddr_r,[
1133 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
1135 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1137 #include "confdefs.h"
1138 #include <sys/types.h>
1139 #include <sys/socket.h>
1140 #include <netinet/in.h>
1142 #define BUFSIZE (sizeof(struct hostent)+10)
1145 struct hostent hent;
1146 char buffer[BUFSIZE];
1147 int bufsize=BUFSIZE;
1149 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1150 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1153 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1154 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1157 dnl ******************************
1158 dnl stat(v)fs location/type
1159 dnl ******************************
1160 AC_CHECK_HEADER([sys/statvfs.h],
1161 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1162 [[ #if HAVE_SYS_STATVFS_H
1163 #include <sys/statvfs.h>
1166 AC_CHECK_FUNCS(statvfs)
1168 AC_CHECK_HEADER([sys/param.h],
1169 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1170 [[ #if HAVE_SYS_PARAM_H
1171 #include <sys/param.h>
1174 AC_CHECK_HEADER([sys/mount.h],
1175 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1176 [[ #if HAVE_SYS_MOUNT_H
1177 #include <sys/mount.h>
1180 AC_CHECK_FUNCS(statfs)
1182 dnl ******************************
1183 dnl IPv6 support and getaddrinfo calls
1184 dnl ******************************
1185 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1187 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1188 [[ #include "confdefs.h"
1189 #include <sys/types.h>
1190 #include <sys/socket.h>
1191 #include <netinet/in.h>
1195 [[ #ifndef NI_MAXHOST
1196 #define NI_MAXHOST 1025
1200 #define NI_MAXSERV 32
1203 struct addrinfo hints, *res;
1204 struct sockaddr_in6 sin6;
1206 char host[NI_MAXHOST];
1207 char serv[NI_MAXSERV];
1209 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1211 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1212 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1215 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1216 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1217 if test "x$enable_ipv6" = "xyes" ; then
1218 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1222 AC_ARG_ENABLE([ipv6],
1223 AS_HELP_STRING([--enable-ipv6=no/yes],
1224 [Enable support for resolving IPv6 addresses.]),
1225 [enable_ipv6=$enableval],[enable_ipv6=yes])
1226 if test "x$enable_ipv6" = "xyes"; then
1228 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1229 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1230 [[ #include "confdefs.h"
1231 #include <sys/types.h>
1232 #include <sys/socket.h>
1233 #include <netinet/in.h>
1236 [[ struct addrinfo hints;
1237 hints.ai_flags = AI_ADDRCONFIG;
1239 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1245 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1247 AC_CHECK_HEADER([wspiapi.h],
1248 [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1250 dnl **********************************
1251 dnl Weather calendar backend support
1252 dnl **********************************
1253 AC_MSG_CHECKING([if we should build the weather calendar backend])
1254 AC_ARG_ENABLE([weather],
1255 [AS_HELP_STRING([--enable-weather],
1256 [Build the weather calendar backend (default=yes)])],
1257 [use_gweather=$enableval], [use_gweather=yes])
1259 AC_MSG_RESULT([$use_gweather])
1260 if test "x$use_gweather" = "xyes"; then
1262 [LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1265 gweather-3.0 not found (or version < gweather_minimum_version)
1267 If you want to disable weather calendar support,
1268 please append --disable-weather to configure.
1272 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1274 dnl ******************************
1276 dnl ******************************
1277 AC_ARG_ENABLE([nntp],
1278 AS_HELP_STRING([--enable-nntp],
1279 [Build Usenet news (NNTP) backend]),
1280 [enable_nntp=$enableval],[enable_nntp=yes])
1281 if test "x$enable_nntp" = "xyes"; then
1282 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1287 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1289 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1291 dnl ******************************
1293 dnl ******************************
1294 AC_ARG_ENABLE([dot-locking],
1295 AS_HELP_STRING([--enable-dot-locking=yes/no],
1296 [Enable support for locking mail files with dot locking]),
1297 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1299 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1300 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1306 AC_ARG_ENABLE([file-locking],
1307 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1308 [Enable support for locking mail files with file locking]),
1309 [],[enable_file_locking=fcntl])
1311 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1312 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1315 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1316 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1323 dnl ******************************
1324 dnl sendmail operation
1325 dnl ******************************
1326 AC_MSG_CHECKING([for SunOS broken spool format])
1327 if test "x$host_os" = "xsunos" ; then
1328 with_broken_spool="yes"
1331 AC_ARG_WITH([broken-spool],
1332 AS_HELP_STRING([--with-broken-spool=yes/no],
1333 [Using SunOS/Solaris sendmail which has a broken spool format]),
1334 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1336 if test "x$with_broken_spool" = "xyes"; then
1337 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1340 AC_MSG_RESULT([$with_broken_spool])
1345 EVO_KRB5_SUPPORT(no)
1347 dnl ******************************
1349 dnl ******************************
1352 dnl ******************************
1354 dnl ******************************
1355 if test "x$os_win32" != "xyes"; then
1357 case $with_openldap in
1362 case $with_static_ldap in
1364 msg_ldap="$with_openldap (static)"
1367 msg_ldap="$with_openldap (dynamic)"
1372 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1373 if test "x$with_openldap" = "xno" ; then
1374 EVO_SUNLDAP_CHECK(no)
1375 case $with_sunldap in
1380 case $with_static_sunldap in
1382 msg_ldap="$with_sunldap (static)"
1385 msg_ldap="$with_sunldap (dynamic)"
1392 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1394 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1396 dnl Win32 LDAP support
1397 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1398 LDAP_LIBS="-lwldap32"
1399 AC_SUBST(LDAP_CFLAGS)
1401 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1402 AM_CONDITIONAL(ENABLE_LDAP, true)
1403 AM_CONDITIONAL(SUNLDAP, false)
1407 dnl ******************************
1408 dnl Utility macro to set compiler flags for a specific lib.
1409 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1410 dnl ******************************
1411 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1412 PKG_CHECK_MODULES([$1], [$2])
1413 $1_CFLAGS="[$]$1_CFLAGS $3 "
1414 $1_LIBS="[$]$1_LIBS $4 "
1417 dnl ******************************
1419 dnl ******************************
1420 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1422 if test "x$enable_maintainer_mode" = "xyes" ; then
1423 EVO_SET_COMPILE_FLAGS(FACTORY_GTK, "gtk+-3.0")
1424 AC_SUBST(FACTORY_GTK_CFLAGS)
1425 AC_SUBST(FACTORY_GTK_LIBS)
1428 dnl ******************************
1429 dnl libedataserver flags
1430 dnl ******************************
1431 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libxml-2.0 libsoup-2.4 $mozilla_nspr"
1433 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1434 AC_SUBST(E_DATA_SERVER_CFLAGS)
1435 AC_SUBST(E_DATA_SERVER_LIBS)
1437 dnl ******************************
1438 dnl libebackend flags
1439 dnl ******************************
1440 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libsoup-2.4 libxml-2.0"
1442 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1443 AC_SUBST(E_BACKEND_CFLAGS)
1444 AC_SUBST(E_BACKEND_LIBS)
1446 dnl ******************************
1447 dnl evolution-addressbook flags
1448 dnl ******************************
1449 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 libsoup-2.4 libsecret-1"
1451 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1452 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1453 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1455 dnl ******************************
1456 dnl evolution-calendar flags
1457 dnl ******************************
1458 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libsoup-2.4 libxml-2.0 libsecret-1"
1461 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1462 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1463 dnl to differentiate between <libical/ical.h> and <ical.h>
1464 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1465 dnl libical is fixed, we have to work-around the buggy CFlags.
1467 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1468 LIBICAL_EXTRA_LIBS=""
1469 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1470 AC_SUBST(LIBICAL_EXTRA_LIBS)
1472 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1473 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1474 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1476 dnl ****************************
1477 dnl Check for ical_set_unknown_token_handling_setting function
1478 dnl ****************************
1479 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1480 save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1481 save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1482 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1483 [[#include <libical/ical.h>]],
1484 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1485 [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])
1488 AC_MSG_RESULT([$ac_cv_have_iuth])
1490 dnl ******************************
1492 dnl ******************************
1493 LIBGDATA_REQUIRED=libgdata_minimum_version
1494 AC_SUBST(LIBGDATA_REQUIRED)
1495 AC_ARG_ENABLE([google],
1496 [AS_HELP_STRING([--enable-google],
1497 [enable Google Contacts support (default=yes)])],
1498 [enable_google=$enableval], [enable_google=yes])
1499 AC_MSG_CHECKING([if Google Contacts support is enabled])
1500 AC_MSG_RESULT([$enable_google])
1501 if test "x$enable_google" = xyes; then
1502 EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= libgdata_minimum_version)
1503 AC_SUBST(GDATA_CFLAGS)
1504 AC_SUBST(GDATA_LIBS)
1506 AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if you have the google-1.0 package.])
1508 AM_CONDITIONAL(HAVE_GOOGLE, [test x$enable_google = xyes])
1510 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1511 AC_SUBST(SOUP_CFLAGS)
1514 dnl ******************************
1516 dnl ******************************
1517 SQLITE_REQUIRED=sqlite_minimum_version
1518 AC_SUBST(SQLITE_REQUIRED)
1521 dnl deflateInit is a #define, use deflateEnd instead
1522 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1524 if test "x$zlib_found" = "xfalse"; then
1525 AC_MSG_ERROR([*** zlib is required])
1528 dnl ******************************
1529 dnl Checks for large file support
1530 dnl ******************************
1531 AC_ARG_ENABLE([largefile],
1532 AS_HELP_STRING([--enable-largefile],
1533 [enable support for large files [[default=yes]]]),
1534 [],[enable_largefile="yes"])
1536 if test "x$enable_largefile" != "xno"; then
1538 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1539 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1540 [[ #include <sys/types.h>
1541 #include <sys/stat.h>
1544 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1545 )],[ac_cv_largefile64_source="no"],
1546 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1547 [[ #define _LARGEFILE64_SOURCE
1548 #include <sys/types.h>
1549 #include <sys/stat.h>
1552 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1553 [ac_cv_largefile64_source="unknown"])])
1556 enable_largefile="no"
1558 if test "x$ac_cv_largefile64_source" = "xyes"; then
1559 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1560 enable_largefile="yes"
1561 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1562 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1565 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1566 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1567 enable_largefile="yes"
1570 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1571 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1572 enable_largefile="yes"
1575 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1579 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1581 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)
1582 AC_SUBST(CAMEL_CFLAGS)
1583 AC_SUBST(CAMEL_LIBS)
1585 dnl ******************************
1586 dnl Special directories
1587 dnl ******************************
1589 dnl If you add something here, consider whether or not you also
1590 dnl need to add it to one or more .pc.in files (for Connector,
1593 privdatadir='${datadir}'/evolution-data-server
1594 AC_SUBST(privdatadir)
1596 privincludedir='${includedir}'/evolution-data-server
1597 AC_SUBST(privincludedir)
1599 privlibdir='${libdir}'/evolution-data-server
1600 AC_SUBST(privlibdir)
1602 imagesdir='${datadir}'/pixmaps/evolution-data-server
1605 moduledir='${privlibdir}'/registry-modules
1608 ebook_backenddir='${privlibdir}'/addressbook-backends
1609 AC_SUBST(ebook_backenddir)
1611 ecal_backenddir='${privlibdir}'/calendar-backends
1612 AC_SUBST(ecal_backenddir)
1614 ro_sourcesdir='${privdatadir}'/ro-sources
1615 AC_SUBST(ro_sourcesdir)
1617 rw_sourcesdir='${privdatadir}'/rw-sources
1618 AC_SUBST(rw_sourcesdir)
1620 if test "x$use_gweather" = "xyes"; then
1621 weatherdatadir="$privdatadir/weather"
1622 AC_SUBST(weatherdatadir)
1625 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1626 camel_providerdir='${privlibdir}'/camel-providers
1627 AC_SUBST(camel_providerdir)
1629 dnl *******************
1630 dnl D-BUS service stuff
1631 dnl *******************
1632 m4_pattern_allow([AM_V_GEN])
1633 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)|" $< > $@'
1634 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1636 dnl ******************************
1638 dnl ******************************
1642 dnl ******************************
1644 dnl ******************************
1645 AC_PATH_PROG(GPERF, gperf, [no])
1646 if test "x$GPERF" = "xno"; then
1647 AC_MSG_ERROR([You need gperf to build evolution-data-server])
1650 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1652 dnl ******************************
1654 dnl ******************************
1655 AC_ARG_ENABLE(vala-bindings,
1656 AC_HELP_STRING([--enable-vala-bindings],
1657 [build the EXPERIMENTAL Vala bindings]),
1658 enable_vala_bindings=$enableval,
1659 enable_vala_bindings=no)
1661 if test x$enable_vala_bindings = xyes; then
1662 if test "x$INTROSPECTION_SCANNER" = x; then
1663 AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1666 AM_PROG_VALAC([0.13.0])
1669 AC_PATH_PROG(VALAC, valac, valac)
1673 AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1675 if test "x$VAPIGEN" = "xfalse"; then
1676 AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1682 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1685 dnl ******************************
1687 dnl ******************************
1689 export privincludedir
1694 evolution-data-server-zip
1695 evolution-data-server.pc
1696 addressbook/Makefile
1697 addressbook/libebook/Makefile
1698 addressbook/libebook/libebook.pc
1699 addressbook/libebook-contacts/Makefile
1700 addressbook/libebook-contacts/libebook-contacts.pc
1701 addressbook/libedata-book/Makefile
1702 addressbook/libedata-book/libedata-book.pc
1703 addressbook/libegdbus/Makefile
1704 addressbook/backends/Makefile
1705 addressbook/backends/file/Makefile
1706 addressbook/backends/ldap/Makefile
1707 addressbook/backends/google/Makefile
1708 addressbook/backends/google/tests/Makefile
1709 addressbook/backends/webdav/Makefile
1712 calendar/libecal/Makefile
1713 calendar/libecal/libecal.pc
1714 calendar/libedata-cal/Makefile
1715 calendar/libedata-cal/libedata-cal.pc
1716 calendar/libegdbus/Makefile
1717 calendar/backends/Makefile
1718 calendar/backends/caldav/Makefile
1719 calendar/backends/file/Makefile
1720 calendar/backends/http/Makefile
1721 calendar/backends/contacts/Makefile
1722 calendar/backends/weather/Makefile
1724 camel/providers/Makefile
1725 camel/providers/imapx/Makefile
1726 camel/providers/local/Makefile
1727 camel/providers/nntp/Makefile
1728 camel/providers/pop3/Makefile
1729 camel/providers/sendmail/Makefile
1730 camel/providers/smtp/Makefile
1731 camel/tests/Makefile
1732 camel/tests/folder/Makefile
1733 camel/tests/lib/Makefile
1734 camel/tests/message/Makefile
1735 camel/tests/mime-filter/Makefile
1736 camel/tests/misc/Makefile
1737 camel/tests/smime/Makefile
1740 libebackend/Makefile
1741 libebackend/libebackend.pc
1742 libedataserver/Makefile
1743 libedataserver/eds-version.h
1744 libedataserver/libedataserver.pc
1746 modules/cache-reaper/Makefile
1747 modules/gnome-online-accounts/Makefile
1748 modules/google-backend/Makefile
1749 modules/outlook-backend/Makefile
1750 modules/owncloud-backend/Makefile
1751 modules/ubuntu-online-accounts/Makefile
1752 modules/ubuntu-online-accounts/calendar.service-type.in
1753 modules/ubuntu-online-accounts/contacts.service-type.in
1754 modules/ubuntu-online-accounts/evolution-data-server.application.in
1755 modules/ubuntu-online-accounts/evolution-data-server-uoa.desktop.in
1756 modules/ubuntu-online-accounts/google-calendar.service.in
1757 modules/ubuntu-online-accounts/google-contacts.service.in
1758 modules/ubuntu-online-accounts/google-gmail.service.in
1759 modules/ubuntu-online-accounts/mail.service-type.in
1760 modules/ubuntu-online-accounts/yahoo-calendar.service.in
1761 modules/ubuntu-online-accounts/yahoo-mail.service.in
1762 modules/trust-prompt/Makefile
1763 modules/yahoo-backend/Makefile
1766 services/evolution-addressbook-factory/Makefile
1767 services/evolution-calendar-factory/Makefile
1768 services/evolution-source-registry/Makefile
1769 services/evolution-user-prompter/Makefile
1771 tests/libebook/Makefile
1772 tests/libebook-contacts/Makefile
1773 tests/libebook/client/Makefile
1774 tests/libebook/vcard/Makefile
1775 tests/book-migration/Makefile
1776 tests/book-migration/db/Makefile
1777 tests/libecal/Makefile
1778 tests/libecal/client/Makefile
1779 tests/libedata-cal/Makefile
1780 tests/libedataserver/Makefile
1781 tests/test-server-utils/Makefile
1782 tests/test-server-utils/services/Makefile
1783 tests/test-server-utils/services/org.gnome.evolution.dataserver.AddressBook.service
1784 tests/test-server-utils/services/org.gnome.evolution.dataserver.Calendar.service
1785 tests/test-server-utils/services/org.gnome.evolution.dataserver.Sources.service
1787 docs/reference/Makefile
1788 docs/reference/addressbook/Makefile
1789 docs/reference/addressbook/libebook/Makefile
1790 docs/reference/addressbook/libebook-contacts/Makefile
1791 docs/reference/addressbook/libedata-book/Makefile
1792 docs/reference/calendar/Makefile
1793 docs/reference/calendar/libecal/Makefile
1794 docs/reference/calendar/libedata-cal/Makefile
1795 docs/reference/camel/Makefile
1796 docs/reference/libedataserver/Makefile
1797 docs/reference/libebackend/Makefile
1798 docs/reference/private/Makefile
1805 evolution-data-server has been configured as follows:
1806 Weather calendar: $use_gweather
1807 Mail Directory: $system_mail_dir, $system_mail_perm
1808 LDAP support: $msg_ldap
1809 NNTP support: $msg_nntp
1810 Kerberos 5: $msg_krb5
1811 SMIME support: $msg_smime
1812 IPv6 support: $msg_ipv6
1813 Phone number support: $msg_phonenumber
1814 Dot Locking: $msg_dot
1815 File Locking: $msg_file
1816 Large files: $enable_largefile
1817 Gtk Doc: $enable_gtk_doc
1818 Introspection: $enable_introspection
1819 Vala bindings: $enable_vala_bindings
1820 GNOME Online Accounts $enable_goa
1821 Ubuntu Online Accounts $enable_uoa
1822 Google Contacts $enable_google
1824 Code coverage (gcov): $enable_code_coverage
1825 Strict building: $enable_strict