1 # Process this file with autoconf to produce a configure script.
4 # Evolution-Data-Server version */
5 m4_define([eds_major_version], [2])
6 m4_define([eds_minor_version], [27])
7 m4_define([eds_micro_version], [4])
9 m4_define([eds_version],
10 [eds_major_version.eds_minor_version.eds_micro_version])
12 # This is for API/version tracking for things like Bonobo server files.
13 # This should always be the major/minor of the stable version or stable
14 # version to be. (XXX The API version is no longer meaningful.)
15 m4_define([base_version], [2.28])
16 m4_define([api_version], [1.2])
18 AC_INIT(evolution-data-server, [eds_version], http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server)
19 AM_INIT_AUTOMAKE([gnu 1.9])
20 AC_CONFIG_SRCDIR(README)
21 AC_CONFIG_HEADERS(config.h)
23 # Required Package Versions
24 m4_define([glib_minimum_version], [2.16.1])
25 m4_define([gtk_minimum_version], [2.14.0])
26 m4_define([ORBit_minimum_version], [2.9.8])
27 m4_define([libbonobo_minimum_version], [2.20.3])
28 m4_define([gconf_minimum_version], [2.0.0]) # XXX Just a Guess
29 m4_define([libglade_minimum_version], [2.0.0]) # XXX Just a Guess
30 m4_define([libxml_minimum_version], [2.0.0]) # XXX Just a Guess
31 m4_define([libsoup_minimum_version], [2.3.0])
32 m4_define([gnome_keyring_minimum_version], [2.20.1])
33 m4_define([sqlite_minimum_version], [3.5])
34 m4_define([gweather_minimum_version], [2.25.4])
35 m4_define([libical_minimum_version], [0.43])
37 AC_SUBST([BASE_VERSION],[base_version])
38 AC_SUBST([API_VERSION],[api_version])
39 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
40 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
42 EDS_MAJOR_VERSION=eds_major_version
43 EDS_MINOR_VERSION=eds_minor_version
44 EDS_MICRO_VERSION=eds_micro_version
47 LIBEDATASERVER_CURRENT=11
48 LIBEDATASERVER_REVISION=1
51 LIBEDATASERVERUI_CURRENT=9
52 LIBEDATASERVERUI_REVISION=1
53 LIBEDATASERVERUI_AGE=1
60 LIBEDATACAL_REVISION=2
63 LIBEDATABOOK_CURRENT=6
64 LIBEDATABOOK_REVISION=1
71 LIBEGROUPWISE_CURRENT=13
72 LIBEGROUPWISE_REVISION=1
79 LIBEXCHANGE_STORAGE_CURRENT=3
80 LIBEXCHANGE_STORAGE_REVISION=0
81 LIBEXCHANGE_STORAGE_AGE=0
87 LIBGDATA_GOOGLE_CURRENT=1
88 LIBGDATA_GOOGLE_REVISION=0
92 LIBEBACKEND_REVISION=1
95 AC_SUBST(EDS_MAJOR_VERSION)
96 AC_SUBST(EDS_MINOR_VERSION)
97 AC_SUBST(EDS_MICRO_VERSION)
98 AC_SUBST(LIBEDATASERVER_CURRENT)
99 AC_SUBST(LIBEDATASERVER_REVISION)
100 AC_SUBST(LIBEDATASERVER_AGE)
101 AC_SUBST(LIBEDATASERVERUI_CURRENT)
102 AC_SUBST(LIBEDATASERVERUI_REVISION)
103 AC_SUBST(LIBEDATASERVERUI_AGE)
104 AC_SUBST(LIBECAL_CURRENT)
105 AC_SUBST(LIBECAL_REVISION)
106 AC_SUBST(LIBECAL_AGE)
107 AC_SUBST(LIBEDATACAL_CURRENT)
108 AC_SUBST(LIBEDATACAL_REVISION)
109 AC_SUBST(LIBEDATACAL_AGE)
110 AC_SUBST(LIBEBOOK_CURRENT)
111 AC_SUBST(LIBEBOOK_REVISION)
112 AC_SUBST(LIBEBOOK_AGE)
113 AC_SUBST(LIBEDATABOOK_CURRENT)
114 AC_SUBST(LIBEDATABOOK_REVISION)
115 AC_SUBST(LIBEDATABOOK_AGE)
116 AC_SUBST(LIBEGROUPWISE_CURRENT)
117 AC_SUBST(LIBEGROUPWISE_REVISION)
118 AC_SUBST(LIBEGROUPWISE_AGE)
119 AC_SUBST(LIBCAMEL_CURRENT)
120 AC_SUBST(LIBCAMEL_REVISION)
121 AC_SUBST(LIBCAMEL_AGE)
122 AC_SUBST(LIBEXCHANGE_STORAGE_CURRENT)
123 AC_SUBST(LIBEXCHANGE_STORAGE_REVISION)
124 AC_SUBST(LIBEXCHANGE_STORAGE_AGE)
125 AC_SUBST(LIBGDATA_CURRENT)
126 AC_SUBST(LIBGDATA_REVISION)
127 AC_SUBST(LIBGDATA_AGE)
128 AC_SUBST(LIBGDATA_GOOGLE_CURRENT)
129 AC_SUBST(LIBGDATA_GOOGLE_REVISION)
130 AC_SUBST(LIBGDATA_GOOGLE_AGE)
131 AC_SUBST(LIBEBACKEND_CURRENT)
132 AC_SUBST(LIBEBACKEND_REVISION)
133 AC_SUBST(LIBEBACKEND_AGE)
135 dnl Put the ACLOCAL flags in the Makefile
136 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
138 # Compiler Warning Flags
140 AS_COMPILER_FLAGS(WARNING_FLAGS,
141 "-DG_DISABLE_DEPRECATED
142 -DPANGO_DISABLE_DEPRECATED
143 -DGDK_DISABLE_DEPRECATED
144 -DGDK_PIXBUF_DISABLE_DEPRECATED
146 -Wno-missing-field-initializers
148 -Wno-unused-parameter
149 -Wdeclaration-after-statement
150 -Werror-implicit-function-declaration
151 -Wformat-security -Winit-self
152 -Wmissing-declarations -Wmissing-include-dirs
153 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
154 -Wredundant-decls -Wundef -Wwrite-strings")
155 AC_SUBST(WARNING_FLAGS)
157 # Other useful compiler warnings for test builds only.
158 # These may produce warnings we have no control over.
160 # -Wformat-nonliteral
161 # -Wmissing-format-attribute
164 CFLAGS="$CFLAGS $WARNING_FLAGS"
166 dnl Initialize maintainer mode
177 AC_MSG_ERROR(You need bison to build evolution-data-server)
185 dnl Test whether jw is installed
186 AC_PATH_PROG(JW,jw,no)
187 if test x$JW = xno; then
192 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
196 IT_PROG_INTLTOOL([0.35.5])
200 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
201 AC_SUBST(GETTEXT_PACKAGE)
202 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
204 localedir='$(prefix)/$(DATADIRNAME)/locale'
207 dnl Initialize libtool
215 dnl ******************************
217 dnl ******************************
219 AC_MSG_CHECKING([for Win32])
223 NO_UNDEFINED='-no-undefined'
224 SOCKET_LIBS='-lws2_32 -ldnsapi'
227 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
228 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
229 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
235 SOFTOKN3_LIB='-lsoftokn3'
236 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
239 AC_MSG_RESULT([$os_win32])
240 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
241 AC_SUBST(NO_UNDEFINED)
242 AC_SUBST(SOCKET_LIBS)
243 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
245 AC_CHECK_HEADERS(pthread.h semaphore.h sys/wait.h)
246 AC_CHECK_FUNCS(fsync strptime strtok_r)
249 AC_CHECK_HEADERS(alloca.h)
251 # Check for base dependencies early.
252 PKG_CHECK_MODULES(GNOME_PLATFORM,
253 [glib-2.0 >= glib_minimum_version
254 gtk+-2.0 >= gtk_minimum_version
255 ORBit-2.0 >= ORBit_minimum_version
256 libbonobo-2.0 >= libbonobo_minimum_version
257 gconf-2.0 >= gconf_minimum_version
258 libglade-2.0 >= libglade_minimum_version
259 libxml-2.0 >= libxml_minimum_version
260 libsoup-2.4 >= libsoup_minimum_version])
262 LIBICAL_REQUIRED=libical_minimum_version
263 AC_SUBST(LIBICAL_REQUIRED)
265 dnl **************************************************
267 dnl **************************************************
268 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
270 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
271 [AC_MSG_ERROR([No regex library found])])])
274 dnl **************************************************
276 dnl **************************************************
279 AC_HELP_STRING( [--with-libdb],
280 [Prefix where libdb is installed]),
281 dynamic_libdb=yes, dynamic_libdb=no)
283 if test "x${dynamic_libdb}" = "xyes"; then
284 DB_CFLAGS="-I$withval/include"
285 DB_LIBS="-L$withval/lib -ldb"
287 AC_MSG_CHECKING([Berkeley DB])
288 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
289 save_libs=$LIBS; LIBS="$DB_LIBS"
291 [AC_LANG_PROGRAM([[#include <db.h>]],
292 [db_create(NULL, NULL, 0)])],
294 AC_MSG_ERROR(cannot find libdb))
298 msg_libdb="dynamically linked"
300 DB_CFLAGS="-I\$(top_builddir)/libdb/dist"
301 DB_LIBS="\$(top_builddir)/libdb/dist/libdb-4.1.la"
302 if test $os_win32 = yes; then
303 # Don't pointlessly auto-export the global symbols
304 # from the static libdb
305 DB_LIBS="$DB_LIBS -Wl,--exclude-libs=libdb-4.1.a"
307 AC_MSG_NOTICE(Using local libdb)
308 msg_libdb="statically linked to local copy"
310 AM_CONDITIONAL(WITH_LIBDB, test "x$dynamic_libdb" != "xno")
315 dnl ******************************
317 dnl ******************************
319 AC_ARG_WITH(libiconv,
320 AC_HELP_STRING( [--with-libiconv],
321 [Prefix where libiconv is installed]))
322 if test -d "$withval"; then
323 ICONV_CFLAGS="-I$withval/include"
324 ICONV_LIBS="-L$withval/lib"
327 save_CFLAGS="$CFLAGS"
329 CFLAGS="$CFLAGS $ICONV_CFLAGS"
330 LIBS="$LIBS $ICONV_LIBS -liconv"
331 AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([
333 #include <stdlib.h>],[
335 int main (int argc, char **argv)
338 cd = iconv_open ("UTF-8", "ISO-8859-1");
341 ], ac_cv_libiconv=yes, ac_cv_libiconv=no))
342 if test $ac_cv_libiconv = yes; then
343 ICONV_LIBS="$ICONV_LIBS -liconv"
344 if test $os_win32 = yes; then
345 # Don't pointlessly auto-export the global symbols
346 # from a potentially static libiconv.a
347 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
351 CFLAGS="$save_CFLAGS"
353 AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
356 if test $have_iconv = yes; then
357 if test $ac_cv_libiconv = no; then
358 AC_CHECK_FUNCS(gnu_get_libc_version)
360 AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([
364 #ifdef HAVE_GNU_GET_LIBC_VERSION
365 #include <gnu/libc-version.h>
368 int main (int argc, char **argv)
370 char *from = "Some Text \xA4";
371 char *utf8 = "Some Text \xC2\xA4";
372 char *transbuf = malloc (20), *trans = transbuf;
374 size_t from_len = strlen (from), utf8_len = 20;
375 size_t utf8_real_len = strlen (utf8);
377 #ifdef HAVE_GNU_GET_LIBC_VERSION
378 /* glibc 2.1.2's iconv is broken in hard to test ways. */
379 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
383 cd = iconv_open ("UTF-8", "ISO-8859-1");
384 if (cd == (iconv_t) -1)
386 if (iconv (cd, &from, &from_len, &trans, &utf8_len) == -1 || from_len != 0)
388 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
392 }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], ac_cv_libiconv_utf8=HOPEFULLY))
395 if test "$have_iconv" = no; then
396 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
398 AC_SUBST(ICONV_CFLAGS)
401 CFLAGS="$CFLAGS -I$srcdir"
403 AC_MSG_CHECKING(preferred charset formats for system iconv)
406 #include "iconv-detect.c"
410 AC_MSG_RESULT(not found)
412 *** The iconv-detect program was unable to determine the
413 *** preferred charset formats recognized by your system
414 *** iconv library. It is suggested that you install a
415 *** working iconv library such as the one found at
416 *** ftp://ftp.gnu.org/pub/gnu/libiconv
419 if test x$os_win32 = xyes; then
420 AC_MSG_RESULT(using cached win32 result)
421 echo "/* This is an auto-generated header, DO NOT EDIT! */" > iconv-detect.h
422 echo "" >>iconv-detect.h
423 echo "#define ICONV_ISO_D_FORMAT \"iso-%d-%d\"" >>iconv-detect.h
424 echo "#define ICONV_ISO_S_FORMAT \"iso-%d-%s\"" >>iconv-detect.h
425 echo "#define ICONV_10646 \"UCS-4BE\"" >>iconv-detect.h
427 AC_MSG_RESULT(unknown)
429 *** The iconv-detect program was unable to determine the
430 *** preferred charset formats recognized by your system
431 *** iconv library. You are crosscompiling and supposed
432 *** to know what you are doing. (:-)
437 CFLAGS="$save_CFLAGS"
440 dnl Check for nl_langinfo and CODESET
441 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
442 AC_TRY_COMPILE([#include <langinfo.h>],
443 [char *codeset = nl_langinfo (CODESET);],
444 [ac_cv_langinfo_codeset=yes],
445 [ac_cv_langinfo_codeset=no])
446 if test x$ac_cv_langinfo_codeset = xyes; then
447 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
449 AC_MSG_RESULT($ac_cv_langinfo_codeset)
451 dnl Check to see if strftime supports the use of %l and %k
453 AC_MSG_CHECKING(for %l and %k support in strftime)
459 int main(int argc, char **argv)
466 timeinfo=localtime(&rawtime);
468 strftime(buf, 10, "%lx%k", timeinfo);
470 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
475 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
477 ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no,[
478 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
481 AC_MSG_RESULT($ac_cv_lkstrftime)
483 dnl ********************************************************************************
484 dnl security extension support (SSL and S/MIME)
486 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
487 dnl needed by Camel (SSL and S/MIME).
489 dnl The Evolution security extensions are only built if these libraries are found
490 dnl ********************************************************************************
494 dnl these 2 enable's are inverses of each other
496 AC_HELP_STRING( [--enable-nss=@<:@yes/no/static@:>@],
497 [Attempt to use Mozilla libnss for SSL support.]),
498 enable_nss="$enableval", enable_nss="yes")
501 AC_HELP_STRING( [--enable-smime=@<:@yes/no@:>@],
502 [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
503 enable_smime="$enableval", enable_smime="yes")
505 AC_ARG_ENABLE(gnome-keyring,
506 AC_HELP_STRING( [--enable-gnome-keyring=@<:@yes/no@:>@],
507 [Attempt to use Gnome Keyring for storing passwords]),
508 enable_gnome_keyring="$enableval", enable_gnome_keyring="no")
510 AC_ARG_WITH(nspr-includes,
511 AC_HELP_STRING( [--with-nspr-includes=PREFIX],
512 [Location of Mozilla nspr4 includes.]),
513 with_nspr_includes="$withval")
515 AC_ARG_WITH(nspr-libs,
516 AC_HELP_STRING( [--with-nspr-libs=PREFIX],
517 [Location of Mozilla nspr4 libs.]),
518 with_nspr_libs="$withval")
520 AC_ARG_WITH(nss-includes,
521 AC_HELP_STRING( [--with-nss-includes=PREFIX],
522 [Location of Mozilla nss3 includes.]),
523 with_nss_includes="$withval")
525 AC_ARG_WITH(nss-libs,
526 AC_HELP_STRING( [--with-nss-libs=PREFIX],
527 [Location of Mozilla nss3 libs.]),
528 with_nss_libs="$withval")
530 if test "x${enable_gnome_keyring}" = "xyes"; then
531 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= gnome_keyring_minimum_version, with_gnome_keyring="yes", with_gnome_keyring="no");
532 if test "x$with_gnome_keyring" = "xyes"; then
533 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Gnome Keyring available])
534 GNOME_KEYRING_REQUIREMENT="gnome-keyring-1"
536 GNOME_KEYRING_REQUIREMENT=""
540 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
541 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}" || test "x${enable_nss}" = "xstatic"; then
547 if test "x${check_manually}" = "xno"; then
548 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
549 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
550 for pc in $mozilla_nspr_pcs; do
551 if $PKG_CONFIG --exists $pc; then
558 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
559 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
560 for pc in $mozilla_nss_pcs; do
561 if $PKG_CONFIG --exists $pc; then
568 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
569 msg_ssl="yes (Mozilla NSS)"
570 if test "x$enable_smime" = "xyes"; then
571 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
572 msg_smime="yes (Mozilla NSS)"
574 AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
575 AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
576 MANUAL_NSPR_CFLAGS=""
587 if test "x${check_manually}" = "xyes"; then
588 have_nspr_includes="no"
589 if test "x${with_nspr_includes}" != "xno"; then
590 CPPFLAGS_save="$CPPFLAGS"
592 AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
595 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
596 AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
597 CPPFLAGS="$CPPFLAGS_save"
599 if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
600 have_nspr_includes="yes"
601 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
604 AC_MSG_CHECKING(for Mozilla nspr4 includes)
609 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
610 CFLAGS_save="$CFLAGS"
611 LDFLAGS_save="$LDFLAGS"
613 if test "$enable_nss" = "static"; then
614 if test -z "${with_nspr_libs}"; then
615 AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
616 [Please specify the path to libnspr4.a]
617 [Example: --with-nspr-libs=/usr/lib])
619 nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
622 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
625 AC_CACHE_CHECK([for Mozilla nspr libraries], ac_cv_moz_nspr_libs,
628 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
630 if test "x${with_nspr_libs}" != "x"; then
632 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
638 AC_TRY_LINK_FUNC(PR_Init, ac_cv_moz_nspr_libs="yes", ac_cv_moz_nspr_libs="no")
639 CFLAGS="$CFLAGS_save"
640 LDFLAGS="$LDFLAGS_save"
643 if test "x$ac_cv_moz_nspr_libs" != "xno"; then
645 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
647 MANUAL_NSPR_CLFAGS=""
650 AC_MSG_CHECKING(for Mozilla nspr4 libraries)
654 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
655 CPPFLAGS_save="$CPPFLAGS"
657 AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
660 if test "x${with_nspr_includes}" != "x"; then
661 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
663 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
666 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
667 [ have_nss_includes="yes" ],
668 [ have_nss_includes="no" ])
670 CPPFLAGS="$CPPFLAGS_save"
672 if test "x${have_nss_includes}" = "xyes"; then
673 have_nss_includes="yes"
674 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
676 MANUAL_NSPR_CFLAGS=""
680 AC_MSG_CHECKING(for Mozilla nss3 includes)
684 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
685 LDFLAGS_save="$LDFLAGS"
687 if test "$enable_nss" = "static"; then
688 if test -z "${with_nss_libs}"; then
689 AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
690 [Please specify the path to libnss3.a]
691 [Example: --with-nspr-libs=/usr/lib/mozilla])
693 nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
696 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
701 nsslibs="-lssl3 -lsmime3 -lnss3"
704 AC_CACHE_CHECK([for Mozilla nss libraries], ac_cv_moz_nss_libs,
707 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
708 LIBS="$nsslibs $nsprlibs"
709 AC_TRY_LINK_FUNC(NSS_Init, ac_cv_moz_nss_libs="yes", ac_cv_moz_nss_libs="no")
710 if test "$ac_cv_moz_nss_libs" = no; then
711 nsslibs="-lssl3 -lsmime3 -lnss3"
712 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
713 AC_TRY_LINK_FUNC(NSS_Init, ac_cv_moz_nss_libs="yes", ac_cv_moz_nss_libs="no")
715 LDFLAGS="$LDFLAGS_save"
718 if test "$ac_cv_moz_nss_libs" != no; then
721 if test "$enable_nss" = "static"; then
722 msg_ssl="yes (Mozilla NSS:static)"
724 msg_ssl="yes (Mozilla NSS)"
726 if test "$enable_smime" = "yes"; then
727 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
728 msg_smime="yes (Mozilla NSS)"
730 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
733 MANUAL_NSPR_CFLAGS=""
737 AC_MSG_CHECKING(for Mozilla nss libraries)
741 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
742 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
746 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
748 AC_SUBST(MANUAL_NSPR_CFLAGS)
749 AC_SUBST(MANUAL_NSPR_LIBS)
750 AC_SUBST(MANUAL_NSS_CFLAGS)
751 AC_SUBST(MANUAL_NSS_LIBS)
753 if test $os_win32 != yes; then
755 dnl check for socklen_t (in Unix98)
756 AC_MSG_CHECKING(for socklen_t)
757 AC_TRY_COMPILE([#include <sys/types.h>
758 #include <sys/socket.h>
760 ],[],[AC_MSG_RESULT(yes)],[
761 AC_TRY_COMPILE([#include <sys/types.h>
762 #include <sys/socket.h>
763 int accept (int, struct sockaddr *, size_t *);
765 AC_MSG_RESULT(size_t)
766 AC_DEFINE(socklen_t,size_t,[Define to appropriate type if socklen_t is not defined])], [
768 AC_DEFINE(socklen_t,int)])])
773 dnl system mail stuff
775 AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
776 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
778 AC_MSG_CHECKING(system mail directory)
779 if test -d /var/mail -a '!' -h /var/mail ; then
780 system_mail_dir=/var/mail
782 system_mail_dir=/var/spool/mail
784 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
786 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
788 CAMEL_LOCK_HELPER_USER=""
789 CAMEL_LOCK_HELPER_GROUP=""
790 system_mail_perm="world writable"
794 CAMEL_LOCK_HELPER_USER=""
795 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
796 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
800 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
801 CAMEL_LOCK_HELPER_GROUP=""
802 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
806 CAMEL_LOCK_HELPER_USER=""
807 CAMEL_LOCK_HELPER_GROUP=""
808 system_mail_perm="???"
812 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
813 AC_SUBST(CAMEL_LOCK_HELPER_USER)
814 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
820 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
826 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
827 if test $ac_cv_struct_tm_gmtoff = yes; then
828 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
830 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
835 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
836 if test $ac_cv_var_timezone = yes; then
837 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
838 AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone,
843 ], ac_cv_var_altzone=yes, ac_cv_var_altzone=no))
844 if test $ac_cv_var_altzone = yes; then
845 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
848 AC_ERROR(unable to find a way to determine timezone)
853 dnl **************************************************
854 dnl ctime_r prototype
855 dnl **************************************************
857 AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args,
864 ctime_r (&date, buf, 100);
866 ac_cv_ctime_r_three_args=yes
868 ac_cv_ctime_r_three_args=no
872 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
873 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
876 dnl **************************************************
877 dnl gethostbyname_r prototype
878 dnl **************************************************
880 AC_CHECK_FUNCS(gethostbyname_r,[
881 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args,
884 #include "confdefs.h"
885 #include <sys/types.h>
886 #include <sys/socket.h>
887 #include <netinet/in.h>
890 #define BUFSIZE (sizeof(struct hostent)+10)
893 char buffer[BUFSIZE];
897 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
899 ac_cv_gethostbyname_r_five_args=yes
901 ac_cv_gethostbyname_r_five_args=no
905 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
906 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
909 dnl **************************************************
910 dnl gethostbyaddr_r prototype
911 dnl **************************************************
913 AC_CHECK_FUNCS(gethostbyaddr_r,[
914 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args,
917 #include "confdefs.h"
918 #include <sys/types.h>
919 #include <sys/socket.h>
920 #include <netinet/in.h>
923 #define BUFSIZE (sizeof(struct hostent)+10)
926 char buffer[BUFSIZE];
930 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno);
932 ac_cv_gethostbyaddr_r_seven_args=yes
934 ac_cv_gethostbyaddr_r_seven_args=no
938 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
939 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
942 dnl **************************************************
943 dnl stat(v)fs location/type
944 dnl **************************************************
946 AC_CHECK_HEADERS(sys/statvfs.h)
947 AC_CHECK_FUNCS(statvfs)
948 AC_CHECK_HEADERS(sys/param.h)
949 AC_CHECK_HEADERS(sys/mount.h)
950 AC_CHECK_FUNCS(statfs)
952 dnl **************************************************
953 dnl * IPv6 support and getaddrinfo calls
954 dnl **************************************************
955 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], ac_cv_have_addrinfo,
958 #include "confdefs.h"
959 #include <sys/types.h>
960 #include <sys/socket.h>
961 #include <netinet/in.h>
967 #define NI_MAXHOST 1025
971 #define NI_MAXSERV 32
974 struct addrinfo hints, *res;
975 struct sockaddr_in6 sin6;
977 char host[NI_MAXHOST];
978 char serv[NI_MAXSERV];
980 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
982 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0);
984 ac_cv_have_addrinfo=yes
986 ac_cv_have_addrinfo=no
990 if test x"$ac_cv_have_addrinfo" = "xno" ; then
991 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
992 if test x"$enable_ipv6" = "xyes" ; then
993 AC_ERROR(system doesn't support necessary interfaces for ipv6 support)
998 AC_HELP_STRING( [--enable-ipv6=@<:@no/yes@:>@],
999 [Enable support for resolving IPv6 addresses.]),
1001 if test x"$enable_ipv6" = "xyes"; then
1003 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1005 #include "confdefs.h"
1006 #include <sys/types.h>
1007 #include <sys/socket.h>
1008 #include <netinet/in.h>
1012 struct addrinfo hints;
1014 hints.ai_flags = AI_ADDRCONFIG;
1016 AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])
1023 AM_CONDITIONAL(ENABLE_IPv6, test "x$enable_ipv6" = "xyes")
1025 dnl **************************************************
1026 dnl Calendar support
1027 dnl **************************************************
1028 AC_MSG_CHECKING(if we should build the calendar)
1029 AC_ARG_ENABLE(calendar,
1030 AC_HELP_STRING( [--enable-calendar=@<:@yes/no@:>@],
1031 [Enable the calendar components (default yes)]),
1032 enable_calendar="$enableval", enable_calendar="yes")
1034 if test "x${enable_calendar}" != "xno"; then
1035 AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
1037 AM_CONDITIONAL(ENABLE_CALENDAR, test x$enable_calendar = xyes)
1038 AC_MSG_RESULT($enable_calendar)
1039 msg_calendar=$enable_calendar
1041 dnl **************************************************
1042 dnl Weather calendar backend support
1043 dnl **************************************************
1044 AC_MSG_CHECKING(if we should build the weather calendar backend)
1045 AC_ARG_WITH([weather],
1046 [AC_HELP_STRING([--with-weather], [Build the weather calendar backend (default=yes)])],
1047 [use_gweather=$withval],
1049 if test $enable_calendar = no; then
1050 use_gweather="no (calendar support is disabled)"
1052 AC_MSG_RESULT($use_gweather)
1054 if test $use_gweather = yes; then
1055 PKG_CHECK_MODULES([LIBGWEATHER],
1056 [gweather >= gweather_minimum_version],
1058 [AC_MSG_ERROR([The weather calendar backend requires GWeather >= gweather_minimum_version. Alternatively, you may specify --without-weather as a configure option to avoid building the backend.])])
1061 AM_CONDITIONAL(ENABLE_WEATHER, test $use_gweather = yes)
1063 dnl **************************************************
1065 dnl **************************************************
1067 AC_HELP_STRING( [--enable-nntp=@<:@no/yes@:>@],
1068 [Build Usenet news (NNTP) backend]),
1071 if test "x$enable_nntp" = "xyes"; then
1072 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1077 AM_CONDITIONAL(ENABLE_NNTP, test x$enable_nntp = xyes)
1079 dnl **************************************************
1080 dnl New IMAP code support.
1081 dnl **************************************************
1082 AC_ARG_ENABLE(imapp,
1083 AC_HELP_STRING( [--enable-imapp=@<:@no/yes@:>@],
1084 [Attempt to compile alternative, incomplete, very unsupported IMAPv4r1 code]),
1087 if test "x$enable_imapp" = "xyes"; then
1088 AC_DEFINE(ENABLE_IMAPP,1,[Really don't try this at home])
1093 AM_CONDITIONAL(ENABLE_IMAPP, test x$enable_imapp = xyes)
1095 dnl **************************************************
1096 dnl IMAP4rev1 code support.
1097 dnl **************************************************
1098 AC_ARG_ENABLE(imap4,
1099 AC_HELP_STRING( [--enable-imap4=@<:@no/yes@:>@],
1100 [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
1103 if test "x$enable_imap4" = "xyes"; then
1104 AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
1109 AM_CONDITIONAL(ENABLE_IMAP4, test x$enable_imap4 = xyes)
1111 dnl **************************************************
1113 dnl **************************************************
1115 AC_HELP_STRING( [--enable-hula=@<:@no/yes@:>@],
1116 [Enable support for the now-defunct Hula project]),
1119 if test "x$enable_hula" = "xyes"; then
1120 AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1125 AM_CONDITIONAL(ENABLE_HULA, test x$enable_hula = xyes)
1127 dnl **************************************************
1129 dnl **************************************************
1131 AC_ARG_ENABLE(dot-locking,
1132 AC_HELP_STRING( [--enable-dot-locking=@<:@yes/no@:>@],
1133 [Enable support for locking mail files with dot locking]),
1134 ,enable_dot_locking=yes)
1136 if test $os_win32 != yes -a "x$enable_dot_locking" = "xyes"; then
1137 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1143 AC_ARG_ENABLE(file-locking,
1144 AC_HELP_STRING( [--enable-file-locking=@<:@fcntl/flock/no@:>@],
1145 [Enable support for locking mail files with file locking]),
1146 ,enable_file_locking=fcntl)
1148 if test $os_win32 != yes -a "x$enable_file_locking" = "xfcntl"; then
1149 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1152 if test $os_win32 != yes -a "x$enable_file_locking" = "xflock"; then
1153 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1160 dnl **************************************************
1161 dnl * sendmail operation
1162 dnl **************************************************
1164 AC_MSG_CHECKING(for SunOS broken spool format)
1165 if test "x$host_os" = "xsunos" ; then
1166 with_broken_spool="yes"
1169 AC_ARG_WITH(broken-spool,
1170 AC_HELP_STRING( [--with-broken-spool=@<:@yes/no@:>@],
1171 [Using SunOS/Solaris sendmail which has a broken spool format]),
1172 ,with_broken_spool=${with_broken_spool:=no})
1174 if test "x$with_broken_spool" = "xyes"; then
1175 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1178 AC_MSG_RESULT($with_broken_spool)
1184 AC_HELP_STRING( [--with-krb5=DIR],
1185 [Location of Kerberos 5 install dir]),
1186 with_krb5="$withval", with_krb5="no")
1188 AC_ARG_WITH(krb5-libs,
1189 AC_HELP_STRING( [--with-krb5-libs=DIR],
1190 [Location of Kerberos 5 libraries]),
1191 with_krb5_libs="$withval", with_krb5_libs="$with_krb5/lib")
1193 AC_ARG_WITH(krb5-includes,
1194 AC_HELP_STRING( [--with-krb5-includes=DIR],
1195 [Location of Kerberos 5 headers]),
1196 with_krb5_includes="$withval", with_krb5_includes="")
1199 AC_HELP_STRING( [--with-krb4=DIR],
1200 [Location of Kerberos 4 install dir]),
1201 with_krb4="$withval", with_krb4="no")
1203 AC_ARG_WITH(krb4-libs,
1204 AC_HELP_STRING( [--with-krb4-libs=DIR],
1205 [Location of Kerberos 4 libraries]),
1206 with_krb4_libs="$withval", with_krb4_libs="$with_krb4/lib")
1208 AC_ARG_WITH(krb4-includes,
1209 AC_HELP_STRING( [--with-krb4-includes=DIR],
1210 [Location of Kerberos 4 headers]),
1211 with_krb4_includes="$withval", with_krb4_includes="")
1214 if test "x${with_krb5}" != "xno"; then
1217 mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
1218 heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
1219 sunlibs="-lkrb5 -lgss"
1220 AC_CACHE_CHECK([for Kerberos 5], ac_cv_lib_kerberos5,
1222 LIBS="$LIBS -L$with_krb5_libs $mitlibs"
1223 AC_TRY_LINK([#include <krb5.h>],krb5_init_context, ac_cv_lib_kerberos5="$mitlibs",
1225 LIBS="$LIBS_save -L$with_krb5_libs $heimlibs"
1226 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$heimlibs",
1228 LIBS="$LIBS_save -L$with_krb5_libs $sunlibs"
1229 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$sunlibs", ac_cv_lib_kerberos5="no")
1234 if test "$ac_cv_lib_kerberos5" != "no"; then
1235 AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
1236 if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then
1237 AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
1238 if test -z "$with_krb5_includes"; then
1239 KRB5_CFLAGS="-I$with_krb5/include"
1241 KRB5_CFLAGS="-I$with_krb5_includes"
1243 msg_krb5="yes (MIT)"
1245 if test "$ac_cv_lib_kerberos5" = "$heimlibs"; then
1246 AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
1247 if test -z "$with_krb5_includes"; then
1248 KRB5_CFLAGS="-I$with_krb5/include/heimdal"
1250 KRB5_CFLAGS="-I$with_krb5_includes"
1252 msg_krb5="yes (Heimdal)"
1254 AC_DEFINE(HAVE_SUN_KRB5,1,[Define if you have Sun Kerberosv5])
1255 if test -z "$with_krb5_includes"; then
1256 KRB5_CFLAGS="-I$with_krb5/include/kerberosv5"
1258 KRB5_CFLAGS="-I$with_krb5_includes"
1260 msg_krb5="yes (Sun)"
1263 KRB5_LDFLAGS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1264 AC_MSG_RESULT(msg_krb5)
1266 dnl AC_MSG_CHECKING([for Kerberos 5])
1268 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1271 AC_MSG_WARN([krb5 support disabled])
1274 AM_CONDITIONAL(ENABLE_KRB5, test x$with_krb5 != xno)
1276 AC_CHECK_HEADER([et/com_err.h],[AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have et/comm_err.h])])
1277 AC_CHECK_HEADER([com_err.h],[AC_DEFINE([HAVE_COM_ERR_H], 1, [Have comm_err.h])])
1280 if test "x${with_krb4}" != "xno"; then
1281 LDFLAGS_save="$LDFLAGS"
1282 AC_CACHE_CHECK(for Kerberos 4, ac_cv_lib_kerberos4,
1284 ac_cv_lib_kerberos4="no"
1286 mitcompatlibs="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
1287 # Look for MIT krb5 compat krb4
1288 LDFLAGS="$LDFLAGS -L$with_krb4_libs $mitcompatlibs"
1289 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="$mitcompatlibs")
1291 if test "$ac_cv_lib_kerberos4" = "no"; then
1293 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb -lcrypto -lcom_err -lroken"
1294 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -lcrypto -lcom_err -lroken")
1296 if test "$ac_cv_lib_kerberos4" = "no"; then
1297 # Look for old MIT krb4
1298 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb"
1299 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb",
1301 LDFLAGS="$LDFLAGS -ldes"
1302 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -ldes")
1306 LDFLAGS="$LDFLAGS_save"
1307 if test "$ac_cv_lib_kerberos4" != "no"; then
1308 AC_DEFINE(HAVE_KRB4,1,[Define if you have Krb4])
1311 if test -z "$with_krb4_includes"; then
1312 if test -f "$with_krb4/include/krb.h" -o -f "$with_krb4/include/port-sockets.h"; then
1313 KRB4_CFLAGS="-I$with_krb4/include"
1315 if test -d "$with_krb4/include/kerberosIV"; then
1316 KRB4_CFLAGS="$KRB4_CFLAGS -I$with_krb4/include/kerberosIV"
1319 KRB4_CFLAGS="-I$with_krb4_includes"
1321 KRB4_LDFLAGS="-L$with_krb4_libs $ac_cv_lib_kerberos4"
1323 CFLAGS_save="$CFLAGS"
1324 CFLAGS="$CFLAGS $KRB4_CFLAGS"
1325 AC_TRY_COMPILE([#include "krb.h"
1327 ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO,1,[Need krb_sendauth proto])],)
1328 CFLAGS="$CFLAGS_save"
1331 AC_MSG_CHECKING(for Kerberos 4)
1332 AC_MSG_RESULT(${with_krb4})
1335 AC_SUBST(KRB5_CFLAGS)
1336 AC_SUBST(KRB5_LDFLAGS)
1337 AC_SUBST(KRB4_CFLAGS)
1338 AC_SUBST(KRB4_LDFLAGS)
1345 dnl **************************************************
1347 dnl **************************************************
1348 AC_ARG_WITH(e2k-debug,
1349 AC_HELP_STRING( [--with-e2k-debug],
1355 AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1359 dnl **************************************************
1361 dnl **************************************************
1362 if test "$os_win32" != yes; then
1364 case $with_openldap in
1369 case $with_static_ldap in
1371 msg_ldap="$with_openldap (static)"
1374 msg_ldap="$with_openldap (dynamic)"
1379 dnl **************************************************
1380 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1381 dnl **************************************************
1382 if test "$with_openldap" = no ; then
1383 EVO_SUNLDAP_CHECK(no)
1384 case $with_sunldap in
1389 case $with_static_sunldap in
1391 msg_ldap="$with_sunldap (static)"
1394 msg_ldap="$with_sunldap (dynamic)"
1401 AM_CONDITIONAL(SUNLDAP, test "$with_sunldap" != no)
1403 SAVE_CFLAGS="$CFLAGS"
1405 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1406 CFLAGS="$CFLAGS $LDAP_CFLAGS"
1407 LIBS="$LIBS $LDAP_LIBS"
1408 AC_CHECK_FUNCS(ldap_ntlm_bind)
1409 CFLAGS="$SAVE_CFLAGS"
1411 dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1414 if test "$msg_ldap" != "no" ; then
1415 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1418 dnl The user wanted to build with openldap, but his openldap did not have NTLM
1419 dnl support. Make him aware of this with a warning message at the end.
1424 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1425 LDAP_LIBS="-lwldap32"
1426 AC_SUBST(LDAP_CFLAGS)
1428 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1429 AM_CONDITIONAL(ENABLE_LDAP, true)
1430 AM_CONDITIONAL(SUNLDAP, false)
1436 LIBBONOBO_REQUIRED=libbonobo_minimum_version
1437 AC_SUBST(LIBBONOBO_REQUIRED)
1439 ORBIT_REQUIRED=ORBit_minimum_version
1440 AC_SUBST(ORBIT_REQUIRED)
1442 dnl *******************
1443 dnl GObject marshalling
1444 dnl *******************
1447 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1448 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1449 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1451 dnl **************************************************
1452 dnl * Posix thread support
1453 dnl **************************************************
1455 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1456 dnl GNOME_PTHREAD_CHECK
1458 dnl if test "x$PTHREAD_LIB" = "x" ; then
1459 dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1463 dnl Notice that this is a hack, and we wont be able to use this forever, but
1464 dnl at least for some time
1469 THREADS_LIBS="$PTHREAD_LIB"
1470 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1472 AC_SUBST(THREADS_LIBS)
1473 AC_SUBST(THREADS_CFLAGS)
1474 AC_DEFINE(ENABLE_THREADS,1,[Required])
1476 PKG_CHECK_MODULES(ORBIT, ORBit-2.0 >= ORBit_minimum_version)
1477 test x$ORBIT_IDL = x && ORBIT_IDL=`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`
1478 AC_SUBST(ORBIT_CFLAGS)
1479 AC_SUBST(ORBIT_LIBS)
1482 AC_MSG_CHECKING(for CORBA include paths)
1483 IDL_INCLUDES="-I"`pkg-config --variable=idldir libbonobo-2.0`" -I"`pkg-config --variable=idldir bonobo-activation-2.0`
1484 AC_MSG_RESULT($IDL_INCLUDES)
1485 AC_SUBST(IDL_INCLUDES)
1487 dnl Utility macro to set compiler flags for a specific lib.
1488 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1489 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1490 PKG_CHECK_MODULES([$1], [$2])
1491 $1_CFLAGS="[$]$1_CFLAGS $3 "
1492 $1_LIBS="[$]$1_LIBS $4 "
1495 dnl ****************************************
1496 dnl Flags for the various libraries we build
1497 dnl ****************************************
1499 dnl --- libedataserver, libedataserverui, libebackend flags
1501 E_DATA_SERVER_DEPS="libxml-2.0 libbonobo-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1503 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
1504 AC_SUBST(E_DATA_SERVER_CFLAGS)
1505 AC_SUBST(E_DATA_SERVER_LIBS)
1507 E_DATA_SERVER_UI_DEPS="gtk+-2.0 libglade-2.0 gobject-2.0 gthread-2.0 gconf-2.0 $GNOME_KEYRING_REQUIREMENT"
1509 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
1510 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1511 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1513 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0"
1515 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1516 AC_SUBST(E_BACKEND_CFLAGS)
1517 AC_SUBST(E_BACKEND_LIBS)
1519 dnl --- evolution-addressbook flags
1521 EVOLUTION_ADDRESSBOOK_DEPS="libxml-2.0 libbonobo-2.0 gobject-2.0 gthread-2.0 gconf-2.0"
1523 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1524 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1525 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1527 dnl --- evolution-calendar flags
1528 if test "x${enable_calendar}" = "xyes"; then
1529 EVOLUTION_CALENDAR_DEPS="libical >= libical_minimum_version libxml-2.0 libbonobo-2.0 gio-2.0 gobject-2.0 gthread-2.0 gconf-2.0"
1532 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1533 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1534 dnl to differentiate between <libical/ical.h> and <ical.h>
1535 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1536 dnl libical is fixed, we have to work-around the buggy CFlags.
1538 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1539 LIBICAL_EXTRA_LIBS=""
1540 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1541 AC_SUBST(LIBICAL_EXTRA_LIBS)
1543 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1544 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1545 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1548 dnl --- factory flags
1550 E_FACTORY_DEPS="$mozilla_nspr"
1551 if test "x${enable_calendar}" = "xyes"; then
1552 E_FACTORY_DEPS="$E_FACTORY_DEPS libical"
1554 EVO_SET_COMPILE_FLAGS(E_FACTORY, $E_FACTORY_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS $LIBICAL_EXTRA_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS $LIBICAL_EXTRA_LIBS)
1555 AC_SUBST(E_FACTORY_CFLAGS)
1556 AC_SUBST(E_FACTORY_LIBS)
1558 dnl --- Google flags
1559 GDATA_DEPS="libsoup-2.4 libxml-2.0"
1560 EVO_SET_COMPILE_FLAGS(GDATA, $GDATA_DEPS)
1561 AC_SUBST(GDATA_CFLAGS)
1562 AC_SUBST(GDATA_LIBS)
1564 dnl --- Groupwise flags
1565 LIBSOUP_REQUIRED=libsoup_minimum_version
1566 AC_SUBST(LIBSOUP_REQUIRED)
1568 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1569 AC_SUBST(SOUP_CFLAGS)
1573 SQLITE_REQUIRED=sqlite_minimum_version
1574 AC_SUBST(SQLITE_REQUIRED)
1577 dnl deflateInit is a #define, use deflateEnd instead
1578 AC_CHECK_LIB(z, deflateEnd,
1579 [ AC_CHECK_HEADER(zlib.h, zlib_found=true) ])
1580 if test "x$zlib_found" = "xfalse"; then
1581 AC_MSG_ERROR([*** zlib is required])
1584 dnl *************************************
1585 dnl *** Checks for large file support ***
1586 dnl *************************************
1587 AC_ARG_ENABLE(largefile,
1588 AC_HELP_STRING([--enable-largefile],
1589 [enable support for large files [[default=no]]]),,
1590 enable_largefile="no")
1591 if test "x$enable_largefile" != "xno"; then
1593 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], ac_cv_largefile64_source,
1596 #include <sys/types.h>
1597 #include <sys/stat.h>
1600 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
1602 ac_cv_largefile64_source="no"
1605 #define _LARGEFILE64_SOURCE
1606 #include <sys/types.h>
1607 #include <sys/stat.h>
1610 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
1612 ac_cv_largefile64_source="yes"
1614 ac_cv_largefile64_source="unknown"
1619 enable_largefile="no"
1621 if test "x$ac_cv_largefile64_source" = "xyes"; then
1622 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1623 enable_largefile="yes"
1624 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1625 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1628 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1629 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1630 enable_largefile="yes"
1633 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1634 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1635 enable_largefile="yes"
1638 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1642 AM_CONDITIONAL(ENABLE_LARGEFILE, test "x$enable_largefile" = "xyes")
1644 EVO_SET_COMPILE_FLAGS(CAMEL, $mozilla_nss gio-2.0 sqlite3 >= sqlite_minimum_version gthread-2.0,
1645 $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS,
1646 -lz $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS)
1647 AC_SUBST(CAMEL_CFLAGS)
1648 AC_SUBST(CAMEL_LIBS)
1649 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1650 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1652 dnl *******************
1653 dnl Special directories
1654 dnl *******************
1656 dnl --- If you add something here, consider whether or not you also
1657 dnl --- need to add it to one or more .pc.in files (for Connector,
1660 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1661 AC_SUBST(privdatadir)
1663 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1664 AC_SUBST(privincludedir)
1666 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1667 AC_SUBST(privlibdir)
1669 idldir='${datadir}'/idl/evolution-data-server-$API_VERSION
1672 imagesdir='${datadir}'/pixmaps/evolution-data-server
1675 serverdir="$libdir/bonobo/servers"
1678 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1679 AC_SUBST(extensiondir)
1681 gladedir="$privdatadir/glade"
1684 if test $use_gweather = yes; then
1685 weatherdatadir="$privdatadir/weather"
1686 AC_SUBST(weatherdatadir)
1689 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1690 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
1691 AC_SUBST(camel_providerdir)
1693 dnl ************************
1694 dnl IDL/Component Versioning
1695 dnl ************************
1697 INTERFACE_VERSION="$BASE_VERSION"
1698 AC_SUBST(INTERFACE_VERSION)
1699 AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)])
1701 EVO_SUBST_SERVER_RULE='%.server.in: %.server.in.in ; sed -e "s|\@BINDIR\@|$(bindir)|" -e "s|\@LIBEXECDIR_IN_SERVER_FILE\@|$(LIBEXECDIR_IN_SERVER_FILE)|" -e "s|\@COMPONENTDIR\@|$(componentdir)|" -e "s|\@IMPORTERSDIR\@|$(importersdir)|" -e "s|\@EXEEXT\@|$(EXEEXT)|" -e "s|\@VERSION\@|$(BASE_VERSION)|" -e "s|\@API_VERSION\@|$(API_VERSION)|" -e "s|\@INTERFACE_VERSION\@|$(INTERFACE_VERSION)|" $< > $@'
1702 EVO_NAME_SERVER_RULE='%_$(API_VERSION).server: %.server ; mv $< $@'
1703 AC_SUBST(EVO_SUBST_SERVER_RULE)
1704 AC_SUBST(EVO_NAME_SERVER_RULE)
1709 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1717 dnl ******************************
1719 dnl ******************************
1722 export privincludedir
1725 if test $dynamic_libdb = no; then
1726 AC_CONFIG_SUBDIRS(libdb/dist)
1730 evolution-data-server-zip
1731 evolution-data-server.pc
1732 addressbook/Makefile
1733 addressbook/idl/Makefile
1734 addressbook/libebook/Makefile
1735 addressbook/libebook/libebook.pc
1736 addressbook/libedata-book/Makefile
1737 addressbook/libedata-book/libedata-book.pc
1738 addressbook/backends/Makefile
1739 addressbook/backends/file/Makefile
1740 addressbook/backends/vcf/Makefile
1741 addressbook/backends/ldap/Makefile
1742 addressbook/backends/google/Makefile
1743 addressbook/backends/groupwise/Makefile
1744 addressbook/backends/webdav/Makefile
1745 addressbook/tests/Makefile
1746 addressbook/tests/ebook/Makefile
1747 addressbook/tests/vcard/Makefile
1750 calendar/idl/Makefile
1751 calendar/libecal/Makefile
1752 calendar/libecal/libecal.pc
1753 calendar/libedata-cal/Makefile
1754 calendar/libedata-cal/libedata-cal.pc
1755 calendar/backends/Makefile
1756 calendar/backends/caldav/Makefile
1757 calendar/backends/file/Makefile
1758 calendar/backends/groupwise/Makefile
1759 calendar/backends/http/Makefile
1760 calendar/backends/contacts/Makefile
1761 calendar/backends/weather/Makefile
1762 calendar/backends/google/Makefile
1763 calendar/tests/Makefile
1764 calendar/tests/ecal/Makefile
1766 camel/providers/Makefile
1767 camel/providers/groupwise/Makefile
1768 camel/providers/hula/Makefile
1769 camel/providers/imap/Makefile
1770 camel/providers/imapp/Makefile
1771 camel/providers/imap4/Makefile
1772 camel/providers/local/Makefile
1773 camel/providers/nntp/Makefile
1774 camel/providers/pop3/Makefile
1775 camel/providers/sendmail/Makefile
1776 camel/providers/smtp/Makefile
1777 camel/tests/Makefile
1778 camel/tests/folder/Makefile
1779 camel/tests/lib/Makefile
1780 camel/tests/message/Makefile
1781 camel/tests/mime-filter/Makefile
1782 camel/tests/misc/Makefile
1783 camel/tests/smime/Makefile
1784 camel/tests/stream/Makefile
1786 camel/camel-provider.pc
1788 libebackend/Makefile
1789 libebackend/libebackend.pc
1790 libedataserver/Makefile
1791 libedataserver/eds-version.h
1792 libedataserver/libedataserver.pc
1793 libedataserverui/Makefile
1794 libedataserverui/libedataserverui.pc
1796 servers/groupwise/Makefile
1797 servers/groupwise/libegroupwise.pc
1798 servers/exchange/Makefile
1799 servers/exchange/xntlm/Makefile
1800 servers/exchange/lib/Makefile
1801 servers/exchange/storage/Makefile
1802 servers/exchange/storage/libexchange-storage.pc
1803 servers/google/Makefile
1804 servers/google/libgdata/Makefile
1805 servers/google/libgdata/libgdata.pc
1806 servers/google/libgdata-google/Makefile
1807 servers/google/libgdata-google/libgdata-google.pc
1811 docs/reference/Makefile
1812 docs/reference/addressbook/Makefile
1813 docs/reference/addressbook/libebook/Makefile
1814 docs/reference/addressbook/libedata-book/Makefile
1815 docs/reference/calendar/Makefile
1816 docs/reference/calendar/libecal/Makefile
1817 docs/reference/calendar/libedata-cal/Makefile
1818 docs/reference/camel/Makefile
1819 docs/reference/libedataserver/Makefile
1820 docs/reference/libedataserverui/Makefile
1821 docs/reference/libebackend/Makefile
1827 # Override the old libtool in libdb/dist with the one from here
1828 cp libtool libdb/dist
1833 evolution-data-server has been configured as follows:
1834 Calendar: $msg_calendar
1835 Weather calendar: $use_gweather
1836 Mail Directory: $system_mail_dir, $system_mail_perm
1837 LDAP support: $msg_ldap"
1838 if test "$msg_nntp" = "yes"; then
1840 NNTP support: $msg_nntp"
1842 if test "$msg_hula" = "yes"; then
1844 Hula support: $msg_hula"
1847 Kerberos 4/5: $msg_krb4/$msg_krb5
1848 Gnome Keyring: $enable_gnome_keyring/$with_gnome_keyring
1849 SSL support: $msg_ssl
1850 SMIME support: $msg_smime
1851 IPv6 support: $msg_ipv6
1852 Berkeley DB: $msg_libdb
1853 Exchange support: $msg_exchange
1854 Dot Locking: $msg_dot
1855 File Locking: $msg_file
1856 Large files: $largefile_support
1857 Gtk Doc: $enable_gtk_doc
1859 if test "$msg_no_ntlm" != "no" ; then
1862 No NTLM support in OpenLDAP; Plaintext password authentication will be
1863 used when connecting to the Exchange Global Catalog server. Consider
1864 installing the evo-openldap package, or building OpenLDAP with the
1865 patch in servers/exchange/docs/openldap-ntlm.diff