2 dnl Evolution-Data-Server version
3 m4_define([eds_major_version], [3])
4 m4_define([eds_minor_version], [1])
5 m4_define([eds_micro_version], [5])
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.2])
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 -Wall -Wno-portability -Werror foreign])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_SRCDIR(README)
27 AC_CONFIG_HEADERS(config.h)
29 dnl This is for the autoconf tests only - it set's the language we use
32 dnl Automake 1.11 - Silent Build Rules
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
35 dnl Required Package Versions
36 m4_define([glib_minimum_version], [2.28])
37 m4_define([gtk_minimum_version], [3.0])
38 m4_define([gconf_minimum_version], [2.0.0]) dnl XXX Just a Guess
39 m4_define([gnome_keyring_minimum_version], [2.20.1])
40 m4_define([goa_minimum_version], [3.1.1])
41 m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
42 m4_define([libsoup_minimum_version], [2.31.2])
43 m4_define([libgdata_minimum_version], [0.7.0])
44 m4_define([oauth_minimum_version], [0.9.4])
45 m4_define([sqlite_minimum_version], [3.5])
46 m4_define([libical_minimum_version], [0.43])
47 m4_define([gweather_minimum_version], [2.90.0])
49 AC_SUBST([BASE_VERSION],[base_version])
50 AC_SUBST([API_VERSION],[api_version])
51 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
52 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
54 EDS_MAJOR_VERSION=eds_major_version
55 EDS_MINOR_VERSION=eds_minor_version
56 EDS_MICRO_VERSION=eds_micro_version
58 dnl ******************************
60 dnl ******************************
61 ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook1"
62 CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar1"
65 ADDRESS_BOOK_DBUS_SERVICE_NAME,
66 ["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
67 [D-Bus service name for the address book factory])
70 CALENDAR_DBUS_SERVICE_NAME,
71 ["$CALENDAR_DBUS_SERVICE_NAME"],
72 [D-Bus service name for the calendar factory])
74 AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
75 AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
77 dnl ******************************
78 dnl Libtool versioning
79 dnl ******************************
80 LIBEDATASERVER_CURRENT=15
81 LIBEDATASERVER_REVISION=0
84 LIBEDATASERVERUI_CURRENT=1
85 LIBEDATASERVERUI_REVISION=0
86 LIBEDATASERVERUI_AGE=0
92 LIBEDATACAL_CURRENT=13
93 LIBEDATACAL_REVISION=0
96 LIBEDATABOOK_CURRENT=11
97 LIBEDATABOOK_REVISION=0
104 LIBEGROUPWISE_CURRENT=13
105 LIBEGROUPWISE_REVISION=1
112 LIBEBACKEND_CURRENT=1
113 LIBEBACKEND_REVISION=0
116 AC_SUBST(EDS_MAJOR_VERSION)
117 AC_SUBST(EDS_MINOR_VERSION)
118 AC_SUBST(EDS_MICRO_VERSION)
119 AC_SUBST(LIBEDATASERVER_CURRENT)
120 AC_SUBST(LIBEDATASERVER_REVISION)
121 AC_SUBST(LIBEDATASERVER_AGE)
122 AC_SUBST(LIBEDATASERVERUI_CURRENT)
123 AC_SUBST(LIBEDATASERVERUI_REVISION)
124 AC_SUBST(LIBEDATASERVERUI_AGE)
125 AC_SUBST(LIBECAL_CURRENT)
126 AC_SUBST(LIBECAL_REVISION)
127 AC_SUBST(LIBECAL_AGE)
128 AC_SUBST(LIBEDATACAL_CURRENT)
129 AC_SUBST(LIBEDATACAL_REVISION)
130 AC_SUBST(LIBEDATACAL_AGE)
131 AC_SUBST(LIBEBOOK_CURRENT)
132 AC_SUBST(LIBEBOOK_REVISION)
133 AC_SUBST(LIBEBOOK_AGE)
134 AC_SUBST(LIBEDATABOOK_CURRENT)
135 AC_SUBST(LIBEDATABOOK_REVISION)
136 AC_SUBST(LIBEDATABOOK_AGE)
137 AC_SUBST(LIBEGROUPWISE_CURRENT)
138 AC_SUBST(LIBEGROUPWISE_REVISION)
139 AC_SUBST(LIBEGROUPWISE_AGE)
140 AC_SUBST(LIBCAMEL_CURRENT)
141 AC_SUBST(LIBCAMEL_REVISION)
142 AC_SUBST(LIBCAMEL_AGE)
143 AC_SUBST(LIBEBACKEND_CURRENT)
144 AC_SUBST(LIBEBACKEND_REVISION)
145 AC_SUBST(LIBEBACKEND_AGE)
147 dnl **************************************
148 dnl Put the ACLOCAL flags in the Makefile
149 dnl **************************************
150 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
152 dnl ******************************
153 dnl Compiler Warning Flags
154 dnl ******************************
155 AS_COMPILER_FLAGS(WARNING_FLAGS,
156 "-DPANGO_DISABLE_DEPRECATED
157 -DGDK_PIXBUF_DISABLE_DEPRECATED
158 -DG_DISABLE_SINGLE_INCLUDES
159 -DGTK_DISABLE_SINGLE_INCLUDES
162 -Wno-missing-field-initializers
164 -Wno-unused-parameter
165 -Wdeclaration-after-statement
166 -Werror-implicit-function-declaration
167 -Wformat-security -Winit-self
168 -Wmissing-declarations -Wmissing-include-dirs
169 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
170 -Wredundant-decls -Wundef -Wwrite-strings")
171 AC_SUBST(WARNING_FLAGS)
173 dnl More depracation from EBook/ECal:
174 dnl -DE_BOOK_DISABLE_DEPRECATED
175 dnl -DE_CAL_DISABLE_DEPRECATED
177 dnl Other useful compiler warnings for test builds only.
178 dnl These may produce warnings we have no control over,
179 dnl or false positives we don't always want to see.
181 dnl -Wformat-nonliteral
182 dnl -Wmissing-format-attribute
184 dnl -Wstrict-aliasing=2
186 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
187 AC_SUBST(AM_CPPFLAGS)
190 dnl define disable deprecated for EBook and ECal .am files
191 case "$WARNING_FLAGS" in
192 *E_BOOK_DISABLE_DEPRECATED*)
193 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 1 == 1 ])
196 AM_CONDITIONAL(HAVE_E_BOOK_DISABLE_DEPRECATED, [ test 0 == 1 ])
200 case "$WARNING_FLAGS" in
201 *E_CAL_DISABLE_DEPRECATED*)
202 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 1 == 1 ])
205 AM_CONDITIONAL(HAVE_E_CAL_DISABLE_DEPRECATED, [ test 0 == 1 ])
209 dnl ******************************
210 dnl Initialize maintainer mode
211 dnl ******************************
214 if test "x$enable_maintainer_mode" = "xyes" ; then
215 AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
229 AC_MSG_ERROR([You need bison to build evolution-data-server])
233 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
234 dnl behavior that -- according to the C99 standard -- is supposed to be
235 dnl undefined. We may still have aliasing abuses lying around that rely
236 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
237 dnl optimization until we can find and fix all the abuses.
238 dnl (AC_PROG_CC must run first to set the GCC variable.)
239 dnl XXX This really belongs in AM_CFLAGS.
240 if test "x${GCC}" = "xyes"; then
241 CFLAGS="$CFLAGS -fno-strict-aliasing"
244 dnl ******************************
245 dnl Test whether jw is installed
246 dnl ******************************
247 AC_PATH_PROG(JW,jw,no)
248 if test "x$JW" = "xno"; then
253 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
256 dnl ******************************
258 dnl ******************************
259 IT_PROG_INTLTOOL([0.35.5])
261 AM_GNU_GETTEXT_VERSION([0.17])
262 AM_GNU_GETTEXT([external])
264 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
265 AC_SUBST(GETTEXT_PACKAGE)
266 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
268 localedir='$(prefix)/$(DATADIRNAME)/locale'
271 dnl ******************************
272 dnl Initialize libtool
273 dnl ******************************
275 LT_INIT(disable-static win32-dll)
279 dnl ******************************
281 dnl ******************************
284 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
287 dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
290 LDFLAGS="$LDFLAGS -Wl,--no-undefined"
294 dnl ******************************
296 dnl ******************************
297 AC_MSG_CHECKING([for Win32])
301 NO_UNDEFINED='-no-undefined'
302 SOCKET_LIBS='-lws2_32 -ldnsapi'
304 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
305 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
306 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
313 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
320 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
323 AC_MSG_RESULT([$os_win32])
324 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
325 AC_SUBST(NO_UNDEFINED)
326 AC_SUBST(SOCKET_LIBS)
327 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
329 dnl **************************************
330 dnl Check for posix compatible sys/wait.h
331 dnl **************************************
334 dnl ************************************
335 dnl Check for posix compatible alloca()
336 dnl ************************************
339 dnl ******************************
340 dnl Checks for functions
341 dnl ******************************
342 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
344 dnl ***********************************
345 dnl Check for base dependencies early.
346 dnl ***********************************
347 PKG_CHECK_MODULES(GNOME_PLATFORM,
348 [gio-2.0 >= glib_minimum_version
349 gtk+-3.0 >= gtk_minimum_version
350 gconf-2.0 >= gconf_minimum_version
351 libxml-2.0 >= libxml_minimum_version
352 libsoup-2.4 >= libsoup_minimum_version
353 libgdata >= libgdata_minimum_version])
355 if `$PKG_CONFIG --atleast-version=0.9.1 libgdata`; then
356 AC_DEFINE(HAVE_LIBGDATA_0_9, 1, [libgdata is 0.9.1 or higher])
359 dnl *******************************
360 dnl Check for GNOME Online Accounts
361 dnl *******************************
363 [AS_HELP_STRING([--enable-goa],
364 [enable GNOME Online Accounts support (default=yes)])],
365 [enable_goa=$enableval], [enable_goa=yes])
366 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
367 AC_MSG_RESULT([$enable_goa])
368 if test "x$enable_goa" = xyes; then
369 PKG_CHECK_MODULES([GOA], [goa-1.0 >= goa_minimum_version],,
370 [AC_MSG_ERROR([goa-1.0 not found (or version < goa_minimum_version),
371 If you want to disable GNOME Online Accounts support,
372 please append --disable-goa to configure.])])
374 PKG_CHECK_MODULES([OAUTH], [oauth >= oauth_minimum_version],,
375 [AC_MSG_ERROR([oauth not found (or version < oauth_minimum_version),
376 If you want to disable GNOME Online Accounts support,
377 please append --disable-goa to configure.])])
379 if `$PKG_CONFIG --atleast-version=0.9.1 libgdata`; then
380 AC_DEFINE(HAVE_GOA,1,[Have goa-1.0 and libgdata >= 0.9.1])
383 libgdata >= 0.9.1 is required for GNOME Online Accounts support.
384 If you want to disable GNOME Online Accounts support, please
385 append --disable-goa to configure.])
388 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
390 if test x$os_win32 = xno; then
391 dnl ***********************************
392 dnl Check for GNOME Keyring.
393 dnl ***********************************
394 PKG_CHECK_MODULES(GNOME_KEYRING,
395 [gnome-keyring-1 >= gnome_keyring_minimum_version])
399 LIBICAL_REQUIRED=libical_minimum_version
400 AC_SUBST(LIBICAL_REQUIRED)
402 dnl ******************************
404 dnl ******************************
405 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
407 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
408 [AC_MSG_ERROR([No regex library found])])])
411 dnl ******************************
413 dnl ******************************
415 AS_HELP_STRING([--with-libdb=PREFIX],
416 [Prefix where libdb is installed]),
417 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
419 DB_CFLAGS="-I$libdb_prefix/include"
420 DB_LIBS="-L$libdb_prefix/lib -ldb"
422 AC_MSG_CHECKING([Berkeley DB])
423 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
424 save_libs=$LIBS; LIBS="$DB_LIBS"
425 AC_LINK_IFELSE([AC_LANG_PROGRAM(
427 [[db_create(NULL, NULL, 0)]])],
428 [AC_MSG_RESULT([yes])],
429 [AC_MSG_ERROR([Cannot find libdb])])
435 dnl ******************************
437 dnl ******************************
441 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
442 AC_LINK_IFELSE([AC_LANG_PROGRAM(
449 cd = iconv_open ("UTF-8", "ISO-8859-1");
451 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
453 if test "x$ac_cv_libiconv" = "xyes"; then
455 if test "x$os_win32" = "xyes"; then
456 dnl Don't pointlessly auto-export the global symbols
457 dnl from a potentially static libiconv.a
458 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
463 AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
466 if test "x$have_iconv" = "xyes"; then
467 if test "x$ac_cv_libiconv" = "xno"; then
468 AC_CHECK_FUNCS(gnu_get_libc_version)
470 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
471 AC_RUN_IFELSE([AC_LANG_SOURCE([[
475 #ifdef HAVE_GNU_GET_LIBC_VERSION
476 #include <gnu/libc-version.h>
479 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
480 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
481 char *transbuf = malloc (10), *trans = transbuf;
483 size_t jp_len = strlen (jp), utf8_len = 10;
484 size_t utf8_real_len = strlen (utf8);
486 #ifdef HAVE_GNU_GET_LIBC_VERSION
487 /* glibc 2.1.2's iconv is broken in hard to test ways. */
488 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
492 cd = iconv_open ("UTF-8", "ISO-2022-JP");
493 if (cd == (iconv_t) -1)
495 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
497 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
501 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
504 if test "x$have_iconv" = "xno"; then
505 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
509 CFLAGS="$CFLAGS -I$srcdir"
511 AC_MSG_CHECKING([preferred charset name formats for system iconv])
512 AC_RUN_IFELSE([AC_LANG_SOURCE([[
514 #include "iconv-detect.c"
516 [AC_MSG_RESULT([found])],
517 [AC_MSG_RESULT([not found])
519 *** The iconv-detect program was unable to determine the
520 *** preferred charset name formats recognized by your
521 *** iconv library. It is suggested that you install a
522 *** working iconv library such as the one found at
523 *** ftp://ftp.gnu.org/pub/gnu/libiconv
525 [if test "x$os_win32" = xyes; then
526 AC_MSG_RESULT([using known win32 result])
527 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
528 echo >>iconv-detect.h
529 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
530 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
531 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
533 AC_MSG_RESULT([unknown])
535 *** We can't determine the preferred charset name formats
536 *** recognized by your iconv library. You are
537 *** cross-compiling and supposed to know what you are doing.
538 *** Please construct the iconv-detect.h file manually.
543 CFLAGS="$save_CFLAGS"
546 AC_ARG_ENABLE([backtraces],
547 [AS_HELP_STRING([--enable-backtraces],
548 [enable backtraces for e_pointer_tracker (default=no)])],
549 [enable_backtraces=$enableval], [enable_backtraces=no])
551 if test "x$enable_backtraces" = xyes; then
552 dnl ****************************
553 dnl Check for backtrace_symbols function and dwfl from elfutils
554 dnl ****************************
555 AC_MSG_CHECKING([libc backtrace_symbols function])
556 AC_LINK_IFELSE([AC_LANG_PROGRAM(
557 [[#include <execinfo.h>]],
558 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
559 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
560 AC_MSG_RESULT([$ac_cv_have_bsf])
562 if test "x$ac_cv_have_bsf" = xyes; then
565 AC_MSG_CHECKING([elfutils/libdwfl])
566 AC_LINK_IFELSE([AC_LANG_PROGRAM(
567 [[#include <elfutils/libdwfl.h>]],
571 Dwarf_Addr module_low_addr;
574 dwfl_standard_find_debuginfo;
575 dwfl_linux_proc_find_elf;
577 dwfl_linux_proc_report (NULL, 1);
578 dwfl_report_end (NULL, NULL, NULL);
580 dwfl_module_addrname (NULL, NULL);
581 dwfl_module_getsrc (NULL, NULL);
582 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
583 DWARF_CB_ABORT; DWARF_CB_OK;
584 dwfl_getmodules (NULL, NULL, NULL, 0);
586 [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
587 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
591 if test "x$ac_cv_have_elfdwfl" = xyes; then
593 AC_SUBST(LIBDWFL_LIBS)
598 dnl **********************************
599 dnl Check for nl_langinfo and CODESET
600 dnl **********************************
601 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
602 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
603 [[#include <langinfo.h>]],
604 [[char *codeset = nl_langinfo (CODESET);]]
605 )],[ac_cv_langinfo_codeset=yes],[ac_cv_langinfo_codeset=no])
606 if test "x$ac_cv_langinfo_codeset" = "xyes"; then
607 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
609 AC_MSG_RESULT([$ac_cv_langinfo_codeset])
611 dnl *******************************************************
612 dnl Check to see if strftime supports the use of %l and %k
613 dnl *******************************************************
614 AC_MSG_CHECKING([for %l and %k support in strftime])
615 AC_RUN_IFELSE([AC_LANG_SOURCE(
616 [[ #include <stdlib.h>
619 int main(int argc, char **argv) {
625 timeinfo=localtime(&rawtime);
627 strftime(buf, 10, "%lx%k", timeinfo);
629 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
636 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
637 AC_MSG_RESULT([$ac_cv_lkstrftime])
639 dnl ********************************************************************************
640 dnl security extension support (SSL and S/MIME)
642 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
643 dnl needed by Camel (SSL and S/MIME).
645 dnl The Evolution security extensions are only built if these libraries are found
646 dnl ********************************************************************************
651 AS_HELP_STRING([--enable-ssl],
652 [Enable SSL support through Mozilla nss @<:@default=yes@:>@]),
653 [enable_ssl="$enableval"],[enable_ssl="yes"])
655 AC_ARG_ENABLE([smime],
656 AS_HELP_STRING([--enable-smime],
657 [Enable SMIME support through Mozilla nss @<:@default=yes,requires --enable-ssl@:>@ ]),
658 [enable_smime="$enableval"],[enable_smime="yes"])
660 AC_ARG_WITH([nspr-includes],
661 AS_HELP_STRING([--with-nspr-includes],
662 [Prefix of Mozilla nspr4 includes.]),
663 [with_nspr_includes="$withval"])
665 AC_ARG_WITH([nspr-libs],
666 AS_HELP_STRING([--with-nspr-libs],
667 [Prefix of Mozilla nspr4 libs.]),
668 [with_nspr_libs="$withval"])
670 AC_ARG_WITH([nss-includes],
671 AS_HELP_STRING([--with-nss-includes],
672 [Prefix of Mozilla nss3 includes.]),
673 [with_nss_includes="$withval"])
675 AC_ARG_WITH([nss-libs],
676 AS_HELP_STRING([--with-nss-libs],
677 [Prefix of Mozilla nss3 libs.]),
678 [with_nss_libs="$withval"])
680 if test "x${enable_ssl}" = "xyes"; then
681 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
687 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
688 if test "x${check_manually}" = "xno"; then
689 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
690 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
691 for pc in $mozilla_nspr_pcs; do
692 if $PKG_CONFIG --exists $pc; then
699 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
700 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
701 for pc in $mozilla_nss_pcs; do
702 if $PKG_CONFIG --exists $pc; then
709 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
711 if test "x$enable_smime" = "xyes"; then
712 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
715 AC_DEFINE(CAMEL_HAVE_NSS,1,[Define if you have NSS])
716 AC_DEFINE(CAMEL_HAVE_SSL,1,[Define if you have a supported SSL library])
717 MANUAL_NSPR_CFLAGS=""
728 if test "x${check_manually}" = "xyes"; then
729 dnl ******************
731 dnl ******************
732 AC_MSG_CHECKING([for Mozilla nspr4 includes])
733 CPPFLAGS_save="$CPPFLAGS"
734 if test -n "$with_nspr_includes"; then
735 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
738 AC_CHECK_HEADERS(nspr.h prio.h,
739 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
740 CPPFLAGS="$CPPFLAGS_save"
742 if test "x${moz_nspr_includes}" = "xyes"; then
743 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
745 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
747 AC_MSG_RESULT([$moz_nspr_includes])
749 AC_MSG_CHECKING([for Mozilla nspr libraries])
750 CFLAGS_save="$CFLAGS"
751 LDFLAGS_save="$LDFLAGS"
753 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
755 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
757 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
758 if test -n "${with_nspr_libs}"; then
759 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
764 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
765 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
767 CFLAGS="$CFLAGS_save"
768 LDFLAGS="$LDFLAGS_save"
771 if test "x${moz_nspr_libs}" = "xyes"; then
772 if test -n "${with_nspr_libs}"; then
773 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
775 MANUAL_NSPR_LIBS="$nsprlibs"
778 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
780 AC_MSG_RESULT([$moz_nspr_libs])
782 dnl *****************
784 dnl *****************
785 AC_MSG_CHECKING([for Mozilla nss3 includes])
786 CPPFLAGS_save="$CPPFLAGS"
787 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
789 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
790 [moz_nss_includes="yes"],[moz_nss_includes="no"])
791 CPPFLAGS="$CPPFLAGS_save"
793 if test "x${moz_nss_includes}" = "xyes"; then
794 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
796 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
798 AC_MSG_RESULT($moz_nss_includes)
800 AC_MSG_CHECKING([for Mozilla nss libraries])
801 LDFLAGS_save="$LDFLAGS"
803 nsslibs="-lssl3 -lsmime3 -lnss3"
805 LIBS="$nsslibs $nsprlibs"
806 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
807 if test -n "${with_nss_libs}"; then
808 LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
810 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
813 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
814 [moz_nss_libs="yes"],[moz_nss_libs="no"])
815 LDFLAGS="$LDFLAGS_save"
818 if test "x${moz_nss_libs}" = "xyes"; then
819 AC_DEFINE(CAMEL_HAVE_NSS)
820 AC_DEFINE(CAMEL_HAVE_SSL)
822 if test "x${enable_smime}" = "xyes"; then
823 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
826 if test -n "${with_nss_libs}"; then
827 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
829 MANUAL_NSS_LIBS="$nsslibs"
832 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
834 AC_MSG_RESULT([$moz_nss_libs])
836 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
837 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
841 dnl These flags are used in camel.pc.in.
842 if test "x${msg_ssl}" = "xyes"; then
843 CAMEL_SSL_DEFINES="-DCAMEL_HAVE_NSS -DCAMEL_HAVE_SSL"
848 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
850 dnl For pkgconfig files.
851 AC_SUBST(mozilla_nss)
852 AC_SUBST(mozilla_nspr)
854 AC_SUBST(CAMEL_SSL_DEFINES)
855 AC_SUBST(MANUAL_NSPR_CFLAGS)
856 AC_SUBST(MANUAL_NSPR_LIBS)
857 AC_SUBST(MANUAL_NSS_CFLAGS)
858 AC_SUBST(MANUAL_NSS_LIBS)
860 dnl ******************************
861 dnl system mail stuff
862 dnl ******************************
863 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
864 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
866 AC_MSG_CHECKING([system mail directory])
867 if test -d /var/mail -a '!' -h /var/mail ; then
868 system_mail_dir="/var/mail"
870 system_mail_dir="/var/spool/mail"
872 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
874 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
876 CAMEL_LOCK_HELPER_USER=""
877 CAMEL_LOCK_HELPER_GROUP=""
878 system_mail_perm="world writable"
881 CAMEL_LOCK_HELPER_USER=""
882 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
883 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
886 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
887 CAMEL_LOCK_HELPER_GROUP=""
888 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
891 CAMEL_LOCK_HELPER_USER=""
892 CAMEL_LOCK_HELPER_GROUP=""
893 system_mail_perm="???"
897 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
898 AC_SUBST(CAMEL_LOCK_HELPER_USER)
899 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
901 dnl ******************************
903 dnl ******************************
904 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
905 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
906 [[ #include <time.h> ]],
911 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
912 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
913 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
915 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
916 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
917 [[ #include <time.h> ]],
919 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
920 if test "x$ac_cv_var_timezone" = "xyes"; then
921 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
922 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
923 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
924 [[ #include <time.h> ]],
926 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
927 if test "x$ac_cv_var_altzone" = "xyes"; then
928 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
931 AC_MSG_ERROR([unable to find a way to determine timezone])
935 dnl ******************************
936 dnl ctime_r prototype
937 dnl ******************************
938 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
940 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
941 [[ #include <time.h> ]],
944 ctime_r (&date, buf, 100); ]]
945 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
948 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
949 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
952 dnl ******************************
953 dnl gethostbyname_r prototype
954 dnl ******************************
955 AC_CHECK_FUNCS(gethostbyname_r,[
956 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
958 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
960 #include "confdefs.h"
961 #include <sys/types.h>
962 #include <sys/socket.h>
963 #include <netinet/in.h>
965 #define BUFSIZE (sizeof(struct hostent)+10)
969 char buffer[BUFSIZE];
972 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
974 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
977 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
978 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
981 dnl ******************************
982 dnl gethostbyaddr_r prototype
983 dnl ******************************
984 AC_CHECK_FUNCS(gethostbyaddr_r,[
985 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
987 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
989 #include "confdefs.h"
990 #include <sys/types.h>
991 #include <sys/socket.h>
992 #include <netinet/in.h>
994 #define BUFSIZE (sizeof(struct hostent)+10)
998 char buffer[BUFSIZE];
1001 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1002 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1005 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1006 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1009 dnl ******************************
1010 dnl stat(v)fs location/type
1011 dnl ******************************
1012 AC_CHECK_HEADER([sys/statvfs.h],
1013 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1014 [[ #if HAVE_SYS_STATVFS_H
1015 #include <sys/statvfs.h>
1018 AC_CHECK_FUNCS(statvfs)
1020 AC_CHECK_HEADER([sys/param.h],
1021 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1022 [[ #if HAVE_SYS_PARAM_H
1023 #include <sys/param.h>
1026 AC_CHECK_HEADER([sys/mount.h],
1027 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1028 [[ #if HAVE_SYS_MOUNT_H
1029 #include <sys/mount.h>
1032 AC_CHECK_FUNCS(statfs)
1034 dnl ******************************
1035 dnl IPv6 support and getaddrinfo calls
1036 dnl ******************************
1037 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1039 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1040 [[ #include "confdefs.h"
1041 #include <sys/types.h>
1042 #include <sys/socket.h>
1043 #include <netinet/in.h>
1047 [[ #ifndef NI_MAXHOST
1048 #define NI_MAXHOST 1025
1052 #define NI_MAXSERV 32
1055 struct addrinfo hints, *res;
1056 struct sockaddr_in6 sin6;
1058 char host[NI_MAXHOST];
1059 char serv[NI_MAXSERV];
1061 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1063 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1064 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1067 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1068 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1069 if test "x$enable_ipv6" = "xyes" ; then
1070 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1074 AC_ARG_ENABLE([ipv6],
1075 AS_HELP_STRING([--enable-ipv6=no/yes],
1076 [Enable support for resolving IPv6 addresses.]),
1077 [enable_ipv6=$enableval],[enable_ipv6=yes])
1078 if test "x$enable_ipv6" = "xyes"; then
1080 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1081 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1082 [[ #include "confdefs.h"
1083 #include <sys/types.h>
1084 #include <sys/socket.h>
1085 #include <netinet/in.h>
1088 [[ struct addrinfo hints;
1089 hints.ai_flags = AI_ADDRCONFIG;
1091 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1097 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1099 AC_CHECK_HEADER([wspiapi.h],
1100 [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1102 dnl ******************************
1103 dnl Calendar support
1104 dnl ******************************
1105 AC_MSG_CHECKING([if we should build the calendar])
1106 AC_ARG_ENABLE([calendar],
1107 AS_HELP_STRING([--enable-calendar=yes/no],
1108 [Enable the calendar components (default yes)]),
1109 [enable_calendar=$enableval], [enable_calendar=yes])
1111 if test "x${enable_calendar}" != "xno"; then
1112 AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
1114 AM_CONDITIONAL(ENABLE_CALENDAR, [test x$enable_calendar = xyes])
1115 AC_MSG_RESULT([$enable_calendar])
1116 msg_calendar=$enable_calendar
1118 dnl **********************************
1119 dnl Weather calendar backend support
1120 dnl **********************************
1121 AC_MSG_CHECKING([if we should build the weather calendar backend])
1122 AC_ARG_ENABLE([weather],
1123 [AS_HELP_STRING([--enable-weather],
1124 [Build the weather calendar backend (default=yes)])],
1125 [use_gweather=$enableval], [use_gweather=yes])
1126 if test "$enable_calendar" = "no"; then
1127 use_gweather="no (calendar support is disabled)"
1130 AC_MSG_RESULT([$use_gweather])
1131 if test "x$use_gweather" = "xyes"; then
1132 PKG_CHECK_MODULES([LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1133 [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.])])
1135 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1137 dnl ******************************
1139 dnl ******************************
1140 AC_ARG_ENABLE([nntp],
1141 AS_HELP_STRING([--enable-nntp],
1142 [Build Usenet news (NNTP) backend]),
1143 [enable_nntp=$enableval],[enable_nntp=yes])
1144 if test "x$enable_nntp" = "xyes"; then
1145 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1150 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1152 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1154 dnl ******************************
1156 dnl ******************************
1157 AC_ARG_ENABLE([dot-locking],
1158 AS_HELP_STRING([--enable-dot-locking=yes/no],
1159 [Enable support for locking mail files with dot locking]),
1160 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1162 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1163 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1169 AC_ARG_ENABLE([file-locking],
1170 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1171 [Enable support for locking mail files with file locking]),
1172 [],[enable_file_locking=fcntl])
1174 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1175 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1178 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1179 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1186 dnl ******************************
1187 dnl sendmail operation
1188 dnl ******************************
1189 AC_MSG_CHECKING([for SunOS broken spool format])
1190 if test "x$host_os" = "xsunos" ; then
1191 with_broken_spool="yes"
1194 AC_ARG_WITH([broken-spool],
1195 AS_HELP_STRING([--with-broken-spool=yes/no],
1196 [Using SunOS/Solaris sendmail which has a broken spool format]),
1197 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1199 if test "x$with_broken_spool" = "xyes"; then
1200 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1203 AC_MSG_RESULT([$with_broken_spool])
1205 dnl ******************************
1206 dnl DBus call timeout
1207 dnl ******************************
1209 AC_ARG_WITH([dbus-call-timeout],
1210 AS_HELP_STRING([--with-dbus-call-timeout=miliseconds],
1211 [Default timeout used when invoking g_dbus_proxy_call() family functions in EBook and ECal library (default=-1)]),
1212 [ac_cv_dbus_call_timeout=$withval],[ac_cv_dbus_call_timeout=-1])
1214 DEFAULT_EDS_DBUS_TIMEOUT=$ac_cv_dbus_call_timeout
1215 AC_SUBST(DEFAULT_EDS_DBUS_TIMEOUT)
1220 EVO_KRB5_SUPPORT(no)
1222 dnl ******************************
1224 dnl ******************************
1227 dnl ******************************
1229 dnl ******************************
1230 if test "x$os_win32" != "xyes"; then
1232 case $with_openldap in
1237 case $with_static_ldap in
1239 msg_ldap="$with_openldap (static)"
1242 msg_ldap="$with_openldap (dynamic)"
1247 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1248 if test "x$with_openldap" = "xno" ; then
1249 EVO_SUNLDAP_CHECK(no)
1250 case $with_sunldap in
1255 case $with_static_sunldap in
1257 msg_ldap="$with_sunldap (static)"
1260 msg_ldap="$with_sunldap (dynamic)"
1267 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1269 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1271 dnl Win32 LDAP support
1272 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1273 LDAP_LIBS="-lwldap32"
1274 AC_SUBST(LDAP_CFLAGS)
1276 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1277 AM_CONDITIONAL(ENABLE_LDAP, true)
1278 AM_CONDITIONAL(SUNLDAP, false)
1282 dnl ******************************
1283 dnl GObject marshalling
1284 dnl ******************************
1287 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1288 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1289 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1291 dnl ******************************
1292 dnl Utility macro to set compiler flags for a specific lib.
1293 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1294 dnl ******************************
1295 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1296 PKG_CHECK_MODULES([$1], [$2])
1297 $1_CFLAGS="[$]$1_CFLAGS $3 "
1298 $1_LIBS="[$]$1_LIBS $4 "
1301 dnl ******************************
1303 dnl ******************************
1304 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1306 dnl ******************************
1307 dnl libedataserver flags
1308 dnl ******************************
1309 E_DATA_SERVER_DEPS="gio-2.0 libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1311 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1312 AC_SUBST(E_DATA_SERVER_CFLAGS)
1313 AC_SUBST(E_DATA_SERVER_LIBS)
1315 dnl ******************************
1316 dnl libedataserverui
1317 dnl ******************************
1318 E_DATA_SERVER_UI_DEPS="gtk+-3.0 libxml-2.0 gconf-2.0"
1320 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, , )
1321 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1322 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1324 if test "x$enable_maintainer_mode" = "xyes" ; then
1325 FACTORY_GTK_CFLAGS=$E_DATA_SERVER_UI_CFLAGS
1326 FACTORY_GTK_LIBS=$E_DATA_SERVER_UI_LIBS
1327 AC_SUBST(FACTORY_GTK_CFLAGS)
1328 AC_SUBST(FACTORY_GTK_LIBS)
1331 E_BACKEND_DEPS="gio-2.0 libxml-2.0 gconf-2.0"
1333 dnl ******************************
1334 dnl libebackend flags
1335 dnl ******************************
1336 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1337 AC_SUBST(E_BACKEND_CFLAGS)
1338 AC_SUBST(E_BACKEND_LIBS)
1340 dnl ******************************
1341 dnl evolution-addressbook flags
1342 dnl ******************************
1343 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 gconf-2.0"
1345 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1346 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1347 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1349 dnl ******************************
1350 dnl evolution-calendar flags
1351 dnl ******************************
1352 if test "x${enable_calendar}" = "xyes"; then
1353 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libxml-2.0 gconf-2.0"
1356 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1357 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1358 dnl to differentiate between <libical/ical.h> and <ical.h>
1359 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1360 dnl libical is fixed, we have to work-around the buggy CFlags.
1362 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1363 LIBICAL_EXTRA_LIBS=""
1364 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1365 AC_SUBST(LIBICAL_EXTRA_LIBS)
1367 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1368 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1369 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1371 dnl ****************************
1372 dnl Check for ical_set_unknown_token_handling_setting function
1373 dnl ****************************
1374 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1375 save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1376 save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1377 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1378 [[#include <libical/ical.h>]],
1379 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1380 [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])
1383 AC_MSG_RESULT([$ac_cv_have_iuth])
1387 dnl ******************************
1389 dnl ******************************
1390 LIBGDATA_REQUIRED=libgdata_minimum_version
1391 AC_SUBST(LIBGDATA_REQUIRED)
1393 EVO_SET_COMPILE_FLAGS(GDATA, libgdata)
1394 AC_SUBST(GDATA_CFLAGS)
1395 AC_SUBST(GDATA_LIBS)
1397 dnl ******************************
1399 dnl ******************************
1400 LIBSOUP_REQUIRED=libsoup_minimum_version
1401 AC_SUBST(LIBSOUP_REQUIRED)
1403 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1404 AC_SUBST(SOUP_CFLAGS)
1407 dnl ******************************
1409 dnl ******************************
1410 SQLITE_REQUIRED=sqlite_minimum_version
1411 AC_SUBST(SQLITE_REQUIRED)
1414 dnl deflateInit is a #define, use deflateEnd instead
1415 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1417 if test "x$zlib_found" = "xfalse"; then
1418 AC_MSG_ERROR([*** zlib is required])
1421 dnl ******************************
1422 dnl Checks for large file support
1423 dnl ******************************
1424 AC_ARG_ENABLE([largefile],
1425 AS_HELP_STRING([--enable-largefile],
1426 [enable support for large files [[default=no]]]),
1427 [],[enable_largefile="yes"])
1429 if test "x$enable_largefile" != "xno"; then
1431 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1432 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1433 [[ #include <sys/types.h>
1434 #include <sys/stat.h>
1437 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1438 )],[ac_cv_largefile64_source="no"],
1439 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1440 [[ #define _LARGEFILE64_SOURCE
1441 #include <sys/types.h>
1442 #include <sys/stat.h>
1445 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1446 [ac_cv_largefile64_source="unknown"])])
1449 enable_largefile="no"
1451 if test "x$ac_cv_largefile64_source" = "xyes"; then
1452 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1453 enable_largefile="yes"
1454 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1455 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1458 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1459 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1460 enable_largefile="yes"
1463 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1464 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1465 enable_largefile="yes"
1468 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1472 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1474 EVO_SET_COMPILE_FLAGS(CAMEL, gio-2.0 $mozilla_nss sqlite3 >= sqlite_minimum_version, $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS, -lz $KRB5_LIBS $MANUAL_NSS_LIBS)
1475 AC_SUBST(CAMEL_CFLAGS)
1476 AC_SUBST(CAMEL_LIBS)
1477 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1478 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1480 dnl ******************************
1481 dnl Special directories
1482 dnl ******************************
1484 dnl If you add something here, consider whether or not you also
1485 dnl need to add it to one or more .pc.in files (for Connector,
1488 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1489 AC_SUBST(privdatadir)
1491 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1492 AC_SUBST(privincludedir)
1494 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1495 AC_SUBST(privlibdir)
1497 imagesdir='${datadir}'/pixmaps/evolution-data-server
1500 ebook_backenddir='${libdir}'/evolution-data-server/addressbook-backends
1501 AC_SUBST(ebook_backenddir)
1503 ecal_backenddir='${libdir}'/evolution-data-server/calendar-backends
1504 AC_SUBST(ecal_backenddir)
1506 if test "x$use_gweather" = "xyes"; then
1507 weatherdatadir="$privdatadir/weather"
1508 AC_SUBST(weatherdatadir)
1511 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1512 camel_providerdir='${libdir}'/evolution-data-server/camel-providers
1513 AC_SUBST(camel_providerdir)
1515 dnl *******************
1516 dnl D-BUS service stuff
1517 dnl *******************
1518 EVO_SUBST_SERVICE_RULE='%.service: %.service.in Makefile ; 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)|" $< > $@'
1519 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1521 dnl ******************************
1523 dnl ******************************
1524 AC_PATH_PROG(GCONFTOOL, gconftool-2, [no])
1527 dnl ******************************
1529 dnl ******************************
1530 AC_PATH_PROG(GPERF, gperf, [no])
1531 if test "x$GPERF" = "xno"; then
1532 AC_MSG_ERROR([You need gperf to build evolution-data-server])
1535 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1537 dnl ******************************
1539 dnl ******************************
1540 AC_ARG_ENABLE(vala-bindings,
1541 AC_HELP_STRING([--enable-vala-bindings],
1542 [build the EXPERIMENTAL Vala bindings]),
1543 enable_vala_bindings=$enableval,
1544 enable_vala_bindings=no)
1546 if test x$enable_vala_bindings = xyes; then
1547 if test "x$INTROSPECTION_SCANNER" = x; then
1548 AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1551 AM_PROG_VALAC([0.13.0])
1554 AC_PATH_PROG(VALAC, valac, valac)
1558 AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1560 if test "x$VAPIGEN" = "xfalse"; then
1561 AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1567 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1570 dnl ******************************
1572 dnl ******************************
1574 export privincludedir
1579 evolution-data-server-zip
1580 evolution-data-server.pc
1581 addressbook/Makefile
1582 addressbook/libebook/Makefile
1583 addressbook/libebook/libebook.pc
1584 addressbook/libedata-book/Makefile
1585 addressbook/libedata-book/libedata-book.pc
1586 addressbook/libegdbus/Makefile
1587 addressbook/backends/Makefile
1588 addressbook/backends/file/Makefile
1589 addressbook/backends/vcf/Makefile
1590 addressbook/backends/ldap/Makefile
1591 addressbook/backends/google/Makefile
1592 addressbook/backends/webdav/Makefile
1595 calendar/libecal/Makefile
1596 calendar/libecal/libecal.pc
1597 calendar/libedata-cal/Makefile
1598 calendar/libedata-cal/libedata-cal.pc
1599 calendar/libegdbus/Makefile
1600 calendar/backends/Makefile
1601 calendar/backends/caldav/Makefile
1602 calendar/backends/file/Makefile
1603 calendar/backends/http/Makefile
1604 calendar/backends/contacts/Makefile
1605 calendar/backends/weather/Makefile
1607 camel/providers/Makefile
1608 camel/providers/imap/Makefile
1609 camel/providers/imapx/Makefile
1610 camel/providers/local/Makefile
1611 camel/providers/nntp/Makefile
1612 camel/providers/pop3/Makefile
1613 camel/providers/sendmail/Makefile
1614 camel/providers/smtp/Makefile
1615 camel/tests/Makefile
1616 camel/tests/folder/Makefile
1617 camel/tests/lib/Makefile
1618 camel/tests/message/Makefile
1619 camel/tests/mime-filter/Makefile
1620 camel/tests/misc/Makefile
1621 camel/tests/smime/Makefile
1623 camel/camel-provider.pc
1624 libebackend/Makefile
1625 libebackend/libebackend.pc
1626 libedataserver/Makefile
1627 libedataserver/eds-version.h
1628 libedataserver/libedataserver.pc
1629 libedataserverui/Makefile
1630 libedataserverui/libedataserverui.pc
1632 tests/libebook/Makefile
1633 tests/libebook/client/Makefile
1634 tests/libebook/vcard/Makefile
1635 tests/libecal/Makefile
1636 tests/libecal/client/Makefile
1637 tests/libedata-cal/Makefile
1638 tests/libedataserver/Makefile
1639 tests/libedataserverui/Makefile
1641 docs/reference/Makefile
1642 docs/reference/addressbook/Makefile
1643 docs/reference/addressbook/libebook/Makefile
1644 docs/reference/addressbook/libedata-book/Makefile
1645 docs/reference/calendar/Makefile
1646 docs/reference/calendar/libecal/Makefile
1647 docs/reference/calendar/libedata-cal/Makefile
1648 docs/reference/camel/Makefile
1649 docs/reference/libedataserver/Makefile
1650 docs/reference/libedataserverui/Makefile
1651 docs/reference/libebackend/Makefile
1658 evolution-data-server has been configured as follows:
1659 Calendar: $msg_calendar
1660 Weather calendar: $use_gweather
1661 Mail Directory: $system_mail_dir, $system_mail_perm
1662 LDAP support: $msg_ldap
1663 NNTP support: $msg_nntp
1664 Kerberos 5: $msg_krb5
1665 SSL support: $msg_ssl
1666 SMIME support: $msg_smime
1667 IPv6 support: $msg_ipv6
1668 Dot Locking: $msg_dot
1669 File Locking: $msg_file
1670 Large files: $enable_largefile
1671 Gtk Doc: $enable_gtk_doc
1672 Introspection: $enable_introspection
1673 Vala bindings: $enable_vala_bindings
1674 GNOME Online Accounts $enable_goa