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], [3])
9 m4_define([eds_version],
10 [eds_major_version.eds_minor_version.eds_micro_version])
12 AC_INIT(evolution-data-server, [eds_version])
13 AC_CONFIG_SRCDIR(README)
15 # Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
16 # The extra brackets are to foil regex-based scans.
17 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
19 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
21 AM_CONFIG_HEADER(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 dnl *************************************************************************************************
40 dnl This is for api/versioning tracking for things like bonobo .server files
42 dnl This should always be the major/minor of the stable version or stable version to be
43 dnl *************************************************************************************************
46 AC_SUBST(BASE_VERSION)
48 AC_DEFINE_UNQUOTED(BASE_VERSION, "$BASE_VERSION", [Base version (Major.Minor)])
49 AC_DEFINE_UNQUOTED(API_VERSION, "$API_VERSION", [Api version (Major.Minor)])
51 EDS_MAJOR_VERSION=eds_major_version
52 EDS_MINOR_VERSION=eds_minor_version
53 EDS_MICRO_VERSION=eds_micro_version
56 LIBEDATASERVER_CURRENT=11
57 LIBEDATASERVER_REVISION=1
60 LIBEDATASERVERUI_CURRENT=9
61 LIBEDATASERVERUI_REVISION=1
62 LIBEDATASERVERUI_AGE=1
69 LIBEDATACAL_REVISION=2
72 LIBEDATABOOK_CURRENT=6
73 LIBEDATABOOK_REVISION=1
80 LIBEGROUPWISE_CURRENT=13
81 LIBEGROUPWISE_REVISION=1
88 LIBEXCHANGE_STORAGE_CURRENT=3
89 LIBEXCHANGE_STORAGE_REVISION=0
90 LIBEXCHANGE_STORAGE_AGE=0
96 LIBGDATA_GOOGLE_CURRENT=1
97 LIBGDATA_GOOGLE_REVISION=0
100 LIBEBACKEND_CURRENT=0
101 LIBEBACKEND_REVISION=1
104 AC_SUBST(EDS_MAJOR_VERSION)
105 AC_SUBST(EDS_MINOR_VERSION)
106 AC_SUBST(EDS_MICRO_VERSION)
107 AC_SUBST(LIBEDATASERVER_CURRENT)
108 AC_SUBST(LIBEDATASERVER_REVISION)
109 AC_SUBST(LIBEDATASERVER_AGE)
110 AC_SUBST(LIBEDATASERVERUI_CURRENT)
111 AC_SUBST(LIBEDATASERVERUI_REVISION)
112 AC_SUBST(LIBEDATASERVERUI_AGE)
113 AC_SUBST(LIBECAL_CURRENT)
114 AC_SUBST(LIBECAL_REVISION)
115 AC_SUBST(LIBECAL_AGE)
116 AC_SUBST(LIBEDATACAL_CURRENT)
117 AC_SUBST(LIBEDATACAL_REVISION)
118 AC_SUBST(LIBEDATACAL_AGE)
119 AC_SUBST(LIBEBOOK_CURRENT)
120 AC_SUBST(LIBEBOOK_REVISION)
121 AC_SUBST(LIBEBOOK_AGE)
122 AC_SUBST(LIBEDATABOOK_CURRENT)
123 AC_SUBST(LIBEDATABOOK_REVISION)
124 AC_SUBST(LIBEDATABOOK_AGE)
125 AC_SUBST(LIBEGROUPWISE_CURRENT)
126 AC_SUBST(LIBEGROUPWISE_REVISION)
127 AC_SUBST(LIBEGROUPWISE_AGE)
128 AC_SUBST(LIBCAMEL_CURRENT)
129 AC_SUBST(LIBCAMEL_REVISION)
130 AC_SUBST(LIBCAMEL_AGE)
131 AC_SUBST(LIBEXCHANGE_STORAGE_CURRENT)
132 AC_SUBST(LIBEXCHANGE_STORAGE_REVISION)
133 AC_SUBST(LIBEXCHANGE_STORAGE_AGE)
134 AC_SUBST(LIBGDATA_CURRENT)
135 AC_SUBST(LIBGDATA_REVISION)
136 AC_SUBST(LIBGDATA_AGE)
137 AC_SUBST(LIBGDATA_GOOGLE_CURRENT)
138 AC_SUBST(LIBGDATA_GOOGLE_REVISION)
139 AC_SUBST(LIBGDATA_GOOGLE_AGE)
140 AC_SUBST(LIBEBACKEND_CURRENT)
141 AC_SUBST(LIBEBACKEND_REVISION)
142 AC_SUBST(LIBEBACKEND_AGE)
144 dnl Put the ACLOCAL flags in the Makefile
145 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
147 # Compiler Warning Flags
149 AS_COMPILER_FLAGS(WARNING_FLAGS,
150 "-DG_DISABLE_DEPRECATED
151 -DPANGO_DISABLE_DEPRECATED
152 -DGDK_DISABLE_DEPRECATED
153 -DGDK_PIXBUF_DISABLE_DEPRECATED
155 -Wno-missing-field-initializers
157 -Wno-unused-parameter
158 -Wdeclaration-after-statement
159 -Werror-implicit-function-declaration
160 -Wformat-security -Winit-self
161 -Wmissing-declarations -Wmissing-include-dirs
162 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
163 -Wredundant-decls -Wundef -Wwrite-strings")
164 AC_SUBST(WARNING_FLAGS)
166 # Other useful compiler warnings for test builds only.
167 # These may produce warnings we have no control over.
169 # -Wformat-nonliteral
170 # -Wmissing-format-attribute
173 CFLAGS="$CFLAGS $WARNING_FLAGS"
175 dnl Initialize maintainer mode
187 AC_MSG_ERROR(You need bison to build evolution-data-server)
195 dnl Test whether jw is installed
196 AC_PATH_PROG(JW,jw,no)
197 if test x$JW = xno; then
202 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
206 IT_PROG_INTLTOOL([0.35.5])
210 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
211 AC_SUBST(GETTEXT_PACKAGE)
212 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
214 localedir='$(prefix)/$(DATADIRNAME)/locale'
217 dnl Initialize libtool
225 dnl ******************************
227 dnl ******************************
229 AC_MSG_CHECKING([for Win32])
233 NO_UNDEFINED='-no-undefined'
234 SOCKET_LIBS='-lws2_32 -ldnsapi'
237 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
238 AC_CACHE_VAL(have_addrinfo, [have_addrinfo=yes])
239 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
245 SOFTOKN3_LIB='-lsoftokn3'
246 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
249 AC_MSG_RESULT([$os_win32])
250 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
251 AC_SUBST(NO_UNDEFINED)
252 AC_SUBST(SOCKET_LIBS)
253 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
255 AC_CHECK_HEADERS(pthread.h semaphore.h sys/wait.h)
256 AC_CHECK_FUNCS(fsync strptime strtok_r)
259 AC_CHECK_HEADERS(alloca.h)
261 # Check for base dependencies early.
262 PKG_CHECK_MODULES(GNOME_PLATFORM,
263 [glib-2.0 >= glib_minimum_version
264 gtk+-2.0 >= gtk_minimum_version
265 ORBit-2.0 >= ORBit_minimum_version
266 libbonobo-2.0 >= libbonobo_minimum_version
267 gconf-2.0 >= gconf_minimum_version
268 libglade-2.0 >= libglade_minimum_version
269 libxml-2.0 >= libxml_minimum_version
270 libsoup-2.4 >= libsoup_minimum_version])
272 LIBICAL_REQUIRED=libical_minimum_version
273 AC_SUBST(LIBICAL_REQUIRED)
275 dnl **************************************************
277 dnl **************************************************
278 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
280 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
281 [AC_MSG_ERROR([No regex library found])])])
284 dnl **************************************************
286 dnl **************************************************
289 AC_HELP_STRING( [--with-libdb],
290 [Prefix where libdb is installed]),
291 dynamic_libdb=yes, dynamic_libdb=no)
293 if test "x${dynamic_libdb}" = "xyes"; then
294 DB_CFLAGS="-I$withval/include"
295 DB_LIBS="-L$withval/lib -ldb"
297 AC_MSG_CHECKING([Berkeley DB])
298 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
299 save_libs=$LIBS; LIBS="$DB_LIBS"
301 [AC_LANG_PROGRAM([[#include <db.h>]],
302 [db_create(NULL, NULL, 0)])],
304 AC_MSG_ERROR(cannot find libdb))
308 msg_libdb="dynamically linked"
310 DB_CFLAGS="-I\$(top_builddir)/libdb/dist"
311 DB_LIBS="\$(top_builddir)/libdb/dist/libdb-4.1.la"
312 if test $os_win32 = yes; then
313 # Don't pointlessly auto-export the global symbols
314 # from the static libdb
315 DB_LIBS="$DB_LIBS -Wl,--exclude-libs=libdb-4.1.a"
317 AC_MSG_NOTICE(Using local libdb)
318 msg_libdb="statically linked to local copy"
320 AM_CONDITIONAL(WITH_LIBDB, test "x$dynamic_libdb" != "xno")
325 dnl ******************************
327 dnl ******************************
329 AC_ARG_WITH(libiconv,
330 AC_HELP_STRING( [--with-libiconv],
331 [Prefix where libiconv is installed]))
332 if test -d $withval; then
333 ICONV_CFLAGS="-I$withval/include"
334 ICONV_LIBS="-L$withval/lib"
337 save_CFLAGS="$CFLAGS"
339 CFLAGS="$CFLAGS $ICONV_CFLAGS"
340 LIBS="$LIBS $ICONV_LIBS -liconv"
341 AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([
343 #include <stdlib.h>],[
345 int main (int argc, char **argv)
348 cd = iconv_open ("UTF-8", "ISO-8859-1");
351 ], ac_cv_libiconv=yes, ac_cv_libiconv=no))
352 if test $ac_cv_libiconv = yes; then
353 ICONV_LIBS="$ICONV_LIBS -liconv"
354 if test $os_win32 = yes; then
355 # Don't pointlessly auto-export the global symbols
356 # from a potentially static libiconv.a
357 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
361 CFLAGS="$save_CFLAGS"
363 AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
366 if test $have_iconv = yes; then
367 if test $ac_cv_libiconv = no; then
368 AC_CHECK_FUNCS(gnu_get_libc_version)
370 AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([
374 #ifdef HAVE_GNU_GET_LIBC_VERSION
375 #include <gnu/libc-version.h>
378 int main (int argc, char **argv)
380 char *from = "Some Text \xA4";
381 char *utf8 = "Some Text \xC2\xA4";
382 char *transbuf = malloc (20), *trans = transbuf;
384 size_t from_len = strlen (from), utf8_len = 20;
385 size_t utf8_real_len = strlen (utf8);
387 #ifdef HAVE_GNU_GET_LIBC_VERSION
388 /* glibc 2.1.2's iconv is broken in hard to test ways. */
389 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
393 cd = iconv_open ("UTF-8", "ISO-8859-1");
394 if (cd == (iconv_t) -1)
396 if (iconv (cd, &from, &from_len, &trans, &utf8_len) == -1 || from_len != 0)
398 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
402 }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], ac_cv_libiconv_utf8=HOPEFULLY))
405 if test "$have_iconv" = no; then
406 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
408 AC_SUBST(ICONV_CFLAGS)
411 CFLAGS="$CFLAGS -I$srcdir"
413 AC_MSG_CHECKING(preferred charset formats for system iconv)
416 #include "iconv-detect.c"
420 AC_MSG_RESULT(not found)
422 *** The iconv-detect program was unable to determine the
423 *** preferred charset formats recognized by your system
424 *** iconv library. It is suggested that you install a
425 *** working iconv library such as the one found at
426 *** ftp://ftp.gnu.org/pub/gnu/libiconv
429 if test x$os_win32 = xyes; then
430 AC_MSG_RESULT(using cached win32 result)
431 echo "/* This is an auto-generated header, DO NOT EDIT! */" > iconv-detect.h
432 echo "" >>iconv-detect.h
433 echo "#define ICONV_ISO_D_FORMAT \"iso-%d-%d\"" >>iconv-detect.h
434 echo "#define ICONV_ISO_S_FORMAT \"iso-%d-%s\"" >>iconv-detect.h
435 echo "#define ICONV_10646 \"UCS-4BE\"" >>iconv-detect.h
437 AC_MSG_RESULT(unknown)
439 *** The iconv-detect program was unable to determine the
440 *** preferred charset formats recognized by your system
441 *** iconv library. You are crosscompiling and supposed
442 *** to know what you are doing. (:-)
447 CFLAGS="$save_CFLAGS"
450 dnl Check for nl_langinfo and CODESET
451 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
452 AC_TRY_COMPILE([#include <langinfo.h>],
453 [char *codeset = nl_langinfo (CODESET);],
454 [ac_cv_langinfo_codeset=yes],
455 [ac_cv_langinfo_codeset=no])
456 if test x$ac_cv_langinfo_codeset = xyes; then
457 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
459 AC_MSG_RESULT($ac_cv_langinfo_codeset)
461 dnl Check to see if strftime supports the use of %l and %k
463 AC_MSG_CHECKING(for %l and %k support in strftime)
469 int main(int argc, char **argv)
476 timeinfo=localtime(&rawtime);
478 strftime(buf, 10, "%lx%k", timeinfo);
480 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
485 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
487 ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no,[
488 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
491 AC_MSG_RESULT($ac_cv_lkstrftime)
493 dnl ********************************************************************************
494 dnl security extension support (SSL and S/MIME)
496 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
497 dnl needed by Camel (SSL and S/MIME).
499 dnl The Evolution security extensions are only built if these libraries are found
500 dnl ********************************************************************************
504 dnl these 2 enable's are inverses of each other
506 AC_HELP_STRING( [--enable-nss=@<:@yes/no/static@:>@],
507 [Attempt to use Mozilla libnss for SSL support.]),
508 enable_nss="$enableval", enable_nss="yes")
511 AC_HELP_STRING( [--enable-smime=@<:@yes/no@:>@],
512 [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
513 enable_smime="$enableval", enable_smime="yes")
515 AC_ARG_ENABLE(gnome-keyring,
516 AC_HELP_STRING( [--enable-gnome-keyring=@<:@yes/no@:>@],
517 [Attempt to use Gnome Keyring for storing passwords]),
518 enable_gnome_keyring="$enableval", enable_gnome_keyring="no")
520 AC_ARG_WITH(nspr-includes,
521 AC_HELP_STRING( [--with-nspr-includes=PREFIX],
522 [Location of Mozilla nspr4 includes.]),
523 with_nspr_includes="$withval")
525 AC_ARG_WITH(nspr-libs,
526 AC_HELP_STRING( [--with-nspr-libs=PREFIX],
527 [Location of Mozilla nspr4 libs.]),
528 with_nspr_libs="$withval")
530 AC_ARG_WITH(nss-includes,
531 AC_HELP_STRING( [--with-nss-includes=PREFIX],
532 [Location of Mozilla nss3 includes.]),
533 with_nss_includes="$withval")
535 AC_ARG_WITH(nss-libs,
536 AC_HELP_STRING( [--with-nss-libs=PREFIX],
537 [Location of Mozilla nss3 libs.]),
538 with_nss_libs="$withval")
540 if test "x${enable_gnome_keyring}" = "xyes"; then
541 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= gnome_keyring_minimum_version, with_gnome_keyring="yes", with_gnome_keyring="no");
542 if test "x$with_gnome_keyring" = "xyes"; then
543 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Gnome Keyring available])
544 GNOME_KEYRING_REQUIREMENT="gnome-keyring-1"
546 GNOME_KEYRING_REQUIREMENT=""
550 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
551 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
557 if test "x${check_manually}" = "xno"; then
558 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
559 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
560 for pc in $mozilla_nspr_pcs; do
561 if $PKG_CONFIG --exists $pc; then
568 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
569 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
570 for pc in $mozilla_nss_pcs; do
571 if $PKG_CONFIG --exists $pc; then
578 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
579 msg_ssl="yes (Mozilla NSS)"
580 if test "x$enable_smime" = "xyes"; then
581 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
582 msg_smime="yes (Mozilla NSS)"
584 AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
585 AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
586 MANUAL_NSPR_CFLAGS=""
597 if test "x${check_manually}" = "xyes"; then
598 have_nspr_includes="no"
599 if test "x${with_nspr_includes}" != "xno"; then
600 CPPFLAGS_save="$CPPFLAGS"
602 AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
605 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
606 AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
607 CPPFLAGS="$CPPFLAGS_save"
609 if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
610 have_nspr_includes="yes"
611 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
614 AC_MSG_CHECKING(for Mozilla nspr4 includes)
619 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
620 CFLAGS_save="$CFLAGS"
621 LDFLAGS_save="$LDFLAGS"
623 if test "$enable_nss" = "static"; then
624 if test -z "${with_nspr_libs}"; then
625 AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
626 [Please specify the path to libnspr4.a]
627 [Example: --with-nspr-libs=/usr/lib])
629 nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
632 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
635 AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs,
638 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
640 if test "x${with_nspr_libs}" != "x"; then
642 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
648 AC_TRY_LINK_FUNC(PR_Init, moz_nspr_libs="yes", moz_nspr_libs="no")
649 CFLAGS="$CFLAGS_save"
650 LDFLAGS="$LDFLAGS_save"
653 if test "x$moz_nspr_libs" != "xno"; then
655 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
657 MANUAL_NSPR_CLFAGS=""
660 AC_MSG_CHECKING(for Mozilla nspr4 libraries)
664 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
665 CPPFLAGS_save="$CPPFLAGS"
667 AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
670 if test "x${with_nspr_includes}" != "x"; then
671 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
673 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
676 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
677 [ have_nss_includes="yes" ],
678 [ have_nss_includes="no" ])
680 CPPFLAGS="$CPPFLAGS_save"
682 if test "x${have_nss_includes}" = "xyes"; then
683 have_nss_includes="yes"
684 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
686 MANUAL_NSPR_CFLAGS=""
690 AC_MSG_CHECKING(for Mozilla nss3 includes)
694 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
695 LDFLAGS_save="$LDFLAGS"
697 if test "$enable_nss" = "static"; then
698 if test -z "${with_nss_libs}"; then
699 AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
700 [Please specify the path to libnss3.a]
701 [Example: --with-nspr-libs=/usr/lib/mozilla])
703 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"
706 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
711 nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB"
714 AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs,
717 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
718 LIBS="$nsslibs $nsprlibs"
719 AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
720 if test "$moz_nss_libs" = no; then
721 nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB"
722 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
723 AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
725 LDFLAGS="$LDFLAGS_save"
728 if test "$moz_nss_libs" != no; then
731 if test "$enable_nss" = "static"; then
732 msg_ssl="yes (Mozilla NSS:static)"
734 msg_ssl="yes (Mozilla NSS)"
736 if test "$enable_smime" = "yes"; then
737 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
738 msg_smime="yes (Mozilla NSS)"
740 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
743 MANUAL_NSPR_CFLAGS=""
747 AC_MSG_CHECKING(for Mozilla nss libraries)
751 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
752 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
756 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
758 AC_SUBST(MANUAL_NSPR_CFLAGS)
759 AC_SUBST(MANUAL_NSPR_LIBS)
760 AC_SUBST(MANUAL_NSS_CFLAGS)
761 AC_SUBST(MANUAL_NSS_LIBS)
763 if test $os_win32 != yes; then
765 dnl check for socklen_t (in Unix98)
766 AC_MSG_CHECKING(for socklen_t)
767 AC_TRY_COMPILE([#include <sys/types.h>
768 #include <sys/socket.h>
770 ],[],[AC_MSG_RESULT(yes)],[
771 AC_TRY_COMPILE([#include <sys/types.h>
772 #include <sys/socket.h>
773 int accept (int, struct sockaddr *, size_t *);
775 AC_MSG_RESULT(size_t)
776 AC_DEFINE(socklen_t,size_t,[Define to appropriate type if socklen_t is not defined])], [
778 AC_DEFINE(socklen_t,int)])])
783 dnl system mail stuff
785 AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
786 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
788 AC_MSG_CHECKING(system mail directory)
789 if test -d /var/mail -a '!' -h /var/mail ; then
790 system_mail_dir=/var/mail
792 system_mail_dir=/var/spool/mail
794 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
796 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
798 CAMEL_LOCK_HELPER_USER=""
799 CAMEL_LOCK_HELPER_GROUP=""
800 system_mail_perm="world writable"
804 CAMEL_LOCK_HELPER_USER=""
805 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
806 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
810 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
811 CAMEL_LOCK_HELPER_GROUP=""
812 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
816 CAMEL_LOCK_HELPER_USER=""
817 CAMEL_LOCK_HELPER_GROUP=""
818 system_mail_perm="???"
822 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
823 AC_SUBST(CAMEL_LOCK_HELPER_USER)
824 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
830 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
836 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
837 if test $ac_cv_struct_tm_gmtoff = yes; then
838 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
840 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
845 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
846 if test $ac_cv_var_timezone = yes; then
847 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
848 AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone,
853 ], ac_cv_var_altzone=yes, ac_cv_var_altzone=no))
854 if test $ac_cv_var_altzone = yes; then
855 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
858 AC_ERROR(unable to find a way to determine timezone)
863 dnl **************************************************
864 dnl ctime_r prototype
865 dnl **************************************************
867 AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args,
874 ctime_r (&date, buf, 100);
876 ac_cv_ctime_r_three_args=yes
878 ac_cv_ctime_r_three_args=no
882 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
883 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
886 dnl **************************************************
887 dnl gethostbyname_r prototype
888 dnl **************************************************
890 AC_CHECK_FUNCS(gethostbyname_r,[
891 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args,
894 #include "confdefs.h"
895 #include <sys/types.h>
896 #include <sys/socket.h>
897 #include <netinet/in.h>
900 #define BUFSIZE (sizeof(struct hostent)+10)
903 char buffer[BUFSIZE];
907 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
909 ac_cv_gethostbyname_r_five_args=yes
911 ac_cv_gethostbyname_r_five_args=no
915 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
916 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
919 dnl **************************************************
920 dnl gethostbyaddr_r prototype
921 dnl **************************************************
923 AC_CHECK_FUNCS(gethostbyaddr_r,[
924 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args,
927 #include "confdefs.h"
928 #include <sys/types.h>
929 #include <sys/socket.h>
930 #include <netinet/in.h>
933 #define BUFSIZE (sizeof(struct hostent)+10)
936 char buffer[BUFSIZE];
940 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno);
942 ac_cv_gethostbyaddr_r_seven_args=yes
944 ac_cv_gethostbyaddr_r_seven_args=no
948 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
949 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
952 dnl **************************************************
953 dnl stat(v)fs location/type
954 dnl **************************************************
956 AC_CHECK_HEADERS(sys/statvfs.h)
957 AC_CHECK_FUNCS(statvfs)
958 AC_CHECK_HEADERS(sys/param.h)
959 AC_CHECK_HEADERS(sys/mount.h)
960 AC_CHECK_FUNCS(statfs)
962 dnl **************************************************
963 dnl * IPv6 support and getaddrinfo calls
964 dnl **************************************************
965 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], have_addrinfo,
968 #include "confdefs.h"
969 #include <sys/types.h>
970 #include <sys/socket.h>
971 #include <netinet/in.h>
977 #define NI_MAXHOST 1025
981 #define NI_MAXSERV 32
984 struct addrinfo hints, *res;
985 struct sockaddr_in6 sin6;
987 char host[NI_MAXHOST];
988 char serv[NI_MAXSERV];
990 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
992 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0);
1000 if test x"$have_addrinfo" = "xno" ; then
1001 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1002 if test x"$enable_ipv6" = "xyes" ; then
1003 AC_ERROR(system doesn't support necessary interfaces for ipv6 support)
1008 AC_HELP_STRING( [--enable-ipv6=@<:@no/yes@:>@],
1009 [Enable support for resolving IPv6 addresses.]),
1011 if test x"$enable_ipv6" = "xyes"; then
1013 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1015 #include "confdefs.h"
1016 #include <sys/types.h>
1017 #include <sys/socket.h>
1018 #include <netinet/in.h>
1022 struct addrinfo hints;
1024 hints.ai_flags = AI_ADDRCONFIG;
1026 AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])
1033 AM_CONDITIONAL(ENABLE_IPv6, test "x$enable_ipv6" = "xyes")
1035 dnl **************************************************
1036 dnl Calendar support
1037 dnl **************************************************
1038 AC_MSG_CHECKING(if we should build the calendar)
1039 AC_ARG_ENABLE(calendar,
1040 AC_HELP_STRING( [--enable-calendar=@<:@yes/no@:>@],
1041 [Enable the calendar components (default yes)]),
1042 enable_calendar="$enableval", enable_calendar="yes")
1044 if test "x${enable_calendar}" != "xno"; then
1045 AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
1047 AM_CONDITIONAL(ENABLE_CALENDAR, test x$enable_calendar = xyes)
1048 AC_MSG_RESULT($enable_calendar)
1049 msg_calendar=$enable_calendar
1051 dnl **************************************************
1052 dnl Weather calendar backend support
1053 dnl **************************************************
1054 AC_MSG_CHECKING(if we should build the weather calendar backend)
1055 AC_ARG_WITH([weather],
1056 [AC_HELP_STRING([--with-weather], [Build the weather calendar backend (default=yes)])],
1057 [use_gweather=$withval],
1059 if test $enable_calendar = no; then
1060 use_gweather="no (calendar support is disabled)"
1062 AC_MSG_RESULT($use_gweather)
1064 if test $use_gweather = yes; then
1065 PKG_CHECK_MODULES([LIBGWEATHER],
1066 [gweather >= gweather_minimum_version],
1068 [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.])])
1071 AM_CONDITIONAL(ENABLE_WEATHER, test $use_gweather = yes)
1073 dnl **************************************************
1075 dnl **************************************************
1077 AC_HELP_STRING( [--enable-nntp=@<:@no/yes@:>@],
1078 [Build Usenet news (NNTP) backend]),
1081 if test "x$enable_nntp" = "xyes"; then
1082 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1087 AM_CONDITIONAL(ENABLE_NNTP, test x$enable_nntp = xyes)
1089 dnl **************************************************
1090 dnl New IMAP code support.
1091 dnl **************************************************
1092 AC_ARG_ENABLE(imapp,
1093 AC_HELP_STRING( [--enable-imapp=@<:@no/yes@:>@],
1094 [Attempt to compile alternative, incomplete, very unsupported IMAPv4r1 code]),
1097 if test "x$enable_imapp" = "xyes"; then
1098 AC_DEFINE(ENABLE_IMAPP,1,[Really don't try this at home])
1103 AM_CONDITIONAL(ENABLE_IMAPP, test x$enable_imapp = xyes)
1105 dnl **************************************************
1106 dnl IMAP4rev1 code support.
1107 dnl **************************************************
1108 AC_ARG_ENABLE(imap4,
1109 AC_HELP_STRING( [--enable-imap4=@<:@no/yes@:>@],
1110 [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
1113 if test "x$enable_imap4" = "xyes"; then
1114 AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
1119 AM_CONDITIONAL(ENABLE_IMAP4, test x$enable_imap4 = xyes)
1121 dnl **************************************************
1123 dnl **************************************************
1125 AC_HELP_STRING( [--enable-hula=@<:@no/yes@:>@],
1126 [Enable support for the now-defunct Hula project]),
1129 if test "x$enable_hula" = "xyes"; then
1130 AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1135 AM_CONDITIONAL(ENABLE_HULA, test x$enable_hula = xyes)
1137 dnl **************************************************
1139 dnl **************************************************
1141 AC_ARG_ENABLE(dot-locking,
1142 AC_HELP_STRING( [--enable-dot-locking=@<:@yes/no@:>@],
1143 [Enable support for locking mail files with dot locking]),
1144 ,enable_dot_locking=yes)
1146 if test $os_win32 != yes -a "x$enable_dot_locking" = "xyes"; then
1147 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1153 AC_ARG_ENABLE(file-locking,
1154 AC_HELP_STRING( [--enable-file-locking=@<:@fcntl/flock/no@:>@],
1155 [Enable support for locking mail files with file locking]),
1156 ,enable_file_locking=fcntl)
1158 if test $os_win32 != yes -a "x$enable_file_locking" = "xfcntl"; then
1159 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1162 if test $os_win32 != yes -a "x$enable_file_locking" = "xflock"; then
1163 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1170 dnl **************************************************
1171 dnl * sendmail operation
1172 dnl **************************************************
1174 AC_MSG_CHECKING(for SunOS broken spool format)
1175 if test "x$host_os" = "xsunos" ; then
1176 with_broken_spool="yes"
1179 AC_ARG_WITH(broken-spool,
1180 AC_HELP_STRING( [--with-broken-spool=@<:@yes/no@:>@],
1181 [Using SunOS/Solaris sendmail which has a broken spool format]),
1182 ,with_broken_spool=${with_broken_spool:=no})
1184 if test "x$with_broken_spool" = "xyes"; then
1185 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1188 AC_MSG_RESULT($with_broken_spool)
1194 AC_HELP_STRING( [--with-krb5=DIR],
1195 [Location of Kerberos 5 install dir]),
1196 with_krb5="$withval", with_krb5="no")
1198 AC_ARG_WITH(krb5-libs,
1199 AC_HELP_STRING( [--with-krb5-libs=DIR],
1200 [Location of Kerberos 5 libraries]),
1201 with_krb5_libs="$withval", with_krb5_libs="$with_krb5/lib")
1203 AC_ARG_WITH(krb5-includes,
1204 AC_HELP_STRING( [--with-krb5-includes=DIR],
1205 [Location of Kerberos 5 headers]),
1206 with_krb5_includes="$withval", with_krb5_includes="")
1209 AC_HELP_STRING( [--with-krb4=DIR],
1210 [Location of Kerberos 4 install dir]),
1211 with_krb4="$withval", with_krb4="no")
1213 AC_ARG_WITH(krb4-libs,
1214 AC_HELP_STRING( [--with-krb4-libs=DIR],
1215 [Location of Kerberos 4 libraries]),
1216 with_krb4_libs="$withval", with_krb4_libs="$with_krb4/lib")
1218 AC_ARG_WITH(krb4-includes,
1219 AC_HELP_STRING( [--with-krb4-includes=DIR],
1220 [Location of Kerberos 4 headers]),
1221 with_krb4_includes="$withval", with_krb4_includes="")
1224 if test "x${with_krb5}" != "xno"; then
1227 mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
1228 heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
1229 sunlibs="-lkrb5 -lgss"
1230 AC_CACHE_CHECK([for Kerberos 5], ac_cv_lib_kerberos5,
1232 LIBS="$LIBS -L$with_krb5_libs $mitlibs"
1233 AC_TRY_LINK([#include <krb5.h>],krb5_init_context, ac_cv_lib_kerberos5="$mitlibs",
1235 LIBS="$LIBS_save -L$with_krb5_libs $heimlibs"
1236 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$heimlibs",
1238 LIBS="$LIBS_save -L$with_krb5_libs $sunlibs"
1239 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$sunlibs", ac_cv_lib_kerberos5="no")
1244 if test "$ac_cv_lib_kerberos5" != "no"; then
1245 AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
1246 if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then
1247 AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
1248 if test -z "$with_krb5_includes"; then
1249 KRB5_CFLAGS="-I$with_krb5/include"
1251 KRB5_CFLAGS="-I$with_krb5_includes"
1253 msg_krb5="yes (MIT)"
1255 if test "$ac_cv_lib_kerberos5" = "$heimlibs"; then
1256 AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
1257 if test -z "$with_krb5_includes"; then
1258 KRB5_CFLAGS="-I$with_krb5/include/heimdal"
1260 KRB5_CFLAGS="-I$with_krb5_includes"
1262 msg_krb5="yes (Heimdal)"
1264 AC_DEFINE(HAVE_SUN_KRB5,1,[Define if you have Sun Kerberosv5])
1265 if test -z "$with_krb5_includes"; then
1266 KRB5_CFLAGS="-I$with_krb5/include/kerberosv5"
1268 KRB5_CFLAGS="-I$with_krb5_includes"
1270 msg_krb5="yes (Sun)"
1273 KRB5_LDFLAGS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1274 AC_MSG_RESULT(msg_krb5)
1276 dnl AC_MSG_CHECKING([for Kerberos 5])
1278 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1281 AC_MSG_WARN([krb5 support disabled])
1284 AM_CONDITIONAL(ENABLE_KRB5, test x$with_krb5 != xno)
1286 AC_CHECK_HEADER([et/com_err.h],[AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have et/comm_err.h])])
1287 AC_CHECK_HEADER([com_err.h],[AC_DEFINE([HAVE_COM_ERR_H], 1, [Have comm_err.h])])
1290 if test "x${with_krb4}" != "xno"; then
1291 LDFLAGS_save="$LDFLAGS"
1292 AC_CACHE_CHECK(for Kerberos 4, ac_cv_lib_kerberos4,
1294 ac_cv_lib_kerberos4="no"
1296 mitcompatlibs="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
1297 # Look for MIT krb5 compat krb4
1298 LDFLAGS="$LDFLAGS -L$with_krb4_libs $mitcompatlibs"
1299 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="$mitcompatlibs")
1301 if test "$ac_cv_lib_kerberos4" = "no"; then
1303 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb -lcrypto -lcom_err -lroken"
1304 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -lcrypto -lcom_err -lroken")
1306 if test "$ac_cv_lib_kerberos4" = "no"; then
1307 # Look for old MIT krb4
1308 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb"
1309 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb",
1311 LDFLAGS="$LDFLAGS -ldes"
1312 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -ldes")
1316 LDFLAGS="$LDFLAGS_save"
1317 if test "$ac_cv_lib_kerberos4" != "no"; then
1318 AC_DEFINE(HAVE_KRB4,1,[Define if you have Krb4])
1321 if test -z "$with_krb4_includes"; then
1322 if test -f "$with_krb4/include/krb.h" -o -f "$with_krb4/include/port-sockets.h"; then
1323 KRB4_CFLAGS="-I$with_krb4/include"
1325 if test -d "$with_krb4/include/kerberosIV"; then
1326 KRB4_CFLAGS="$KRB4_CFLAGS -I$with_krb4/include/kerberosIV"
1329 KRB4_CFLAGS="-I$with_krb4_includes"
1331 KRB4_LDFLAGS="-L$with_krb4_libs $ac_cv_lib_kerberos4"
1333 CFLAGS_save="$CFLAGS"
1334 CFLAGS="$CFLAGS $KRB4_CFLAGS"
1335 AC_TRY_COMPILE([#include "krb.h"
1337 ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO,1,[Need krb_sendauth proto])],)
1338 CFLAGS="$CFLAGS_save"
1341 AC_MSG_CHECKING(for Kerberos 4)
1342 AC_MSG_RESULT(${with_krb4})
1345 AC_SUBST(KRB5_CFLAGS)
1346 AC_SUBST(KRB5_LDFLAGS)
1347 AC_SUBST(KRB4_CFLAGS)
1348 AC_SUBST(KRB4_LDFLAGS)
1355 dnl **************************************************
1357 dnl **************************************************
1358 AC_ARG_WITH(e2k-debug,
1359 AC_HELP_STRING( [--with-e2k-debug],
1365 AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1369 dnl **************************************************
1371 dnl **************************************************
1372 if test "$os_win32" != yes; then
1374 case $with_openldap in
1379 case $with_static_ldap in
1381 msg_ldap="$with_openldap (static)"
1384 msg_ldap="$with_openldap (dynamic)"
1389 dnl **************************************************
1390 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1391 dnl **************************************************
1392 if test "$with_openldap" = no ; then
1393 EVO_SUNLDAP_CHECK(no)
1394 case $with_sunldap in
1399 case $with_static_sunldap in
1401 msg_ldap="$with_sunldap (static)"
1404 msg_ldap="$with_sunldap (dynamic)"
1411 AM_CONDITIONAL(SUNLDAP, test "$with_sunldap" != no)
1413 SAVE_CFLAGS="$CFLAGS"
1415 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1416 CFLAGS="$CFLAGS $LDAP_CFLAGS"
1417 LIBS="$LIBS $LDAP_LIBS"
1418 AC_CHECK_FUNCS(ldap_ntlm_bind)
1419 CFLAGS="$SAVE_CFLAGS"
1421 dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1424 if test "$msg_ldap" != "no" ; then
1425 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1428 dnl The user wanted to build with openldap, but his openldap did not have NTLM
1429 dnl support. Make him aware of this with a warning message at the end.
1434 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1435 LDAP_LIBS="-lwldap32"
1436 AC_SUBST(LDAP_CFLAGS)
1438 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1439 AM_CONDITIONAL(ENABLE_LDAP, true)
1440 AM_CONDITIONAL(SUNLDAP, false)
1446 LIBBONOBO_REQUIRED=libbonobo_minimum_version
1447 AC_SUBST(LIBBONOBO_REQUIRED)
1449 ORBIT_REQUIRED=ORBit_minimum_version
1450 AC_SUBST(ORBIT_REQUIRED)
1452 dnl *******************
1453 dnl GObject marshalling
1454 dnl *******************
1457 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1458 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1459 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1461 dnl **************************************************
1462 dnl * Posix thread support
1463 dnl **************************************************
1465 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1466 dnl GNOME_PTHREAD_CHECK
1468 dnl if test "x$PTHREAD_LIB" = "x" ; then
1469 dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1473 dnl Notice that this is a hack, and we wont be able to use this forever, but
1474 dnl at least for some time
1479 THREADS_LIBS="$PTHREAD_LIB"
1480 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1482 AC_SUBST(THREADS_LIBS)
1483 AC_SUBST(THREADS_CFLAGS)
1484 AC_DEFINE(ENABLE_THREADS,1,[Required])
1486 PKG_CHECK_MODULES(ORBIT, ORBit-2.0 >= ORBit_minimum_version)
1487 test x$ORBIT_IDL = x && ORBIT_IDL=`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`
1488 AC_SUBST(ORBIT_CFLAGS)
1489 AC_SUBST(ORBIT_LIBS)
1492 AC_MSG_CHECKING(for CORBA include paths)
1493 IDL_INCLUDES="-I"`pkg-config --variable=idldir libbonobo-2.0`" -I"`pkg-config --variable=idldir bonobo-activation-2.0`
1494 AC_MSG_RESULT($IDL_INCLUDES)
1495 AC_SUBST(IDL_INCLUDES)
1497 dnl Utility macro to set compiler flags for a specific lib.
1498 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1499 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1500 PKG_CHECK_MODULES([$1], [$2])
1501 $1_CFLAGS="[$]$1_CFLAGS $3 "
1502 $1_LIBS="[$]$1_LIBS $4 "
1505 dnl ****************************************
1506 dnl Flags for the various libraries we build
1507 dnl ****************************************
1509 dnl --- libedataserver, libedataserverui, libebackend flags
1511 E_DATA_SERVER_DEPS="libxml-2.0 libbonobo-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1513 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
1514 AC_SUBST(E_DATA_SERVER_CFLAGS)
1515 AC_SUBST(E_DATA_SERVER_LIBS)
1517 E_DATA_SERVER_UI_DEPS="gtk+-2.0 libglade-2.0 gobject-2.0 gthread-2.0 gconf-2.0 $GNOME_KEYRING_REQUIREMENT"
1519 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
1520 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1521 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1523 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0"
1525 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1526 AC_SUBST(E_BACKEND_CFLAGS)
1527 AC_SUBST(E_BACKEND_LIBS)
1529 dnl --- evolution-addressbook flags
1531 EVOLUTION_ADDRESSBOOK_DEPS="libxml-2.0 libbonobo-2.0 gobject-2.0 gthread-2.0 gconf-2.0"
1533 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1534 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1535 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1537 dnl --- evolution-calendar flags
1538 if test "x${enable_calendar}" = "xyes"; then
1539 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"
1542 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1543 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1544 dnl to differentiate between <libical/ical.h> and <ical.h>
1545 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1546 dnl libical is fixed, we have to work-around the buggy CFlags.
1548 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1549 LIBICAL_EXTRA_LIBS=""
1550 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1551 AC_SUBST(LIBICAL_EXTRA_LIBS)
1553 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1554 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1555 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1558 dnl --- factory flags
1560 E_FACTORY_DEPS="$mozilla_nspr"
1561 if test "x${enable_calendar}" = "xyes"; then
1562 E_FACTORY_DEPS="$E_FACTORY_DEPS libical"
1564 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)
1565 AC_SUBST(E_FACTORY_CFLAGS)
1566 AC_SUBST(E_FACTORY_LIBS)
1568 dnl --- Google flags
1569 GDATA_DEPS="libsoup-2.4 libxml-2.0"
1570 EVO_SET_COMPILE_FLAGS(GDATA, $GDATA_DEPS)
1571 AC_SUBST(GDATA_CFLAGS)
1572 AC_SUBST(GDATA_LIBS)
1574 dnl --- Groupwise flags
1575 LIBSOUP_REQUIRED=libsoup_minimum_version
1576 AC_SUBST(LIBSOUP_REQUIRED)
1578 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1579 AC_SUBST(SOUP_CFLAGS)
1583 SQLITE_REQUIRED=sqlite_minimum_version
1584 AC_SUBST(SQLITE_REQUIRED)
1587 dnl deflateInit is a #define, use deflateEnd instead
1588 AC_CHECK_LIB(z, deflateEnd,
1589 [ AC_CHECK_HEADER(zlib.h, zlib_found=true) ])
1590 if test "x$zlib_found" = "xfalse"; then
1591 AC_MSG_ERROR([*** zlib is required])
1594 dnl *************************************
1595 dnl *** Checks for large file support ***
1596 dnl *************************************
1597 AC_ARG_ENABLE(largefile,
1598 AC_HELP_STRING([--enable-largefile],
1599 [enable support for large files [[default=no]]]),,
1600 enable_largefile="no")
1601 if test "x$enable_largefile" != "xno"; then
1603 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], 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 largefile64_source="no"
1615 #define _LARGEFILE64_SOURCE
1616 #include <sys/types.h>
1617 #include <sys/stat.h>
1620 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
1622 largefile64_source="yes"
1624 largefile64_source="unknown"
1629 enable_largefile="no"
1631 if test "x$largefile64_source" = "xyes"; then
1632 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1633 enable_largefile="yes"
1634 elif test "x$largefile64_source" = "xunknown"; then
1635 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1638 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1639 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1640 enable_largefile="yes"
1643 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1644 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1645 enable_largefile="yes"
1648 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1652 AM_CONDITIONAL(ENABLE_LARGEFILE, test "x$enable_largefile" = "xyes")
1654 EVO_SET_COMPILE_FLAGS(CAMEL, $mozilla_nss gio-2.0 sqlite3 >= sqlite_minimum_version gthread-2.0,
1655 $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS,
1656 -lz $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS)
1657 AC_SUBST(CAMEL_CFLAGS)
1658 AC_SUBST(CAMEL_LIBS)
1659 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1660 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1662 dnl *******************
1663 dnl Special directories
1664 dnl *******************
1666 dnl --- If you add something here, consider whether or not you also
1667 dnl --- need to add it to one or more .pc.in files (for Connector,
1670 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1671 AC_SUBST(privdatadir)
1673 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1674 AC_SUBST(privincludedir)
1676 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1677 AC_SUBST(privlibdir)
1679 idldir='${datadir}'/idl/evolution-data-server-$API_VERSION
1682 imagesdir='${datadir}'/pixmaps/evolution-data-server
1685 serverdir="$libdir/bonobo/servers"
1688 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1689 AC_SUBST(extensiondir)
1691 gladedir="$privdatadir/glade"
1694 if test $use_gweather = yes; then
1695 weatherdatadir="$privdatadir/weather"
1696 AC_SUBST(weatherdatadir)
1699 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1700 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
1701 AC_SUBST(camel_providerdir)
1703 dnl ************************
1704 dnl IDL/Component Versioning
1705 dnl ************************
1707 INTERFACE_VERSION="$BASE_VERSION"
1708 AC_SUBST(INTERFACE_VERSION)
1709 AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)])
1711 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)|" $< > $@'
1712 EVO_NAME_SERVER_RULE='%_$(API_VERSION).server: %.server ; mv $< $@'
1713 AC_SUBST(EVO_SUBST_SERVER_RULE)
1714 AC_SUBST(EVO_NAME_SERVER_RULE)
1719 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1727 dnl ******************************
1729 dnl ******************************
1732 export privincludedir
1735 if test $dynamic_libdb = no; then
1736 AC_CONFIG_SUBDIRS(libdb/dist)
1740 evolution-data-server-zip
1741 evolution-data-server.pc
1742 addressbook/Makefile
1743 addressbook/idl/Makefile
1744 addressbook/libebook/Makefile
1745 addressbook/libebook/libebook.pc
1746 addressbook/libedata-book/Makefile
1747 addressbook/libedata-book/libedata-book.pc
1748 addressbook/backends/Makefile
1749 addressbook/backends/file/Makefile
1750 addressbook/backends/vcf/Makefile
1751 addressbook/backends/ldap/Makefile
1752 addressbook/backends/google/Makefile
1753 addressbook/backends/groupwise/Makefile
1754 addressbook/backends/webdav/Makefile
1755 addressbook/tests/Makefile
1756 addressbook/tests/ebook/Makefile
1757 addressbook/tests/vcard/Makefile
1760 calendar/idl/Makefile
1761 calendar/libecal/Makefile
1762 calendar/libecal/libecal.pc
1763 calendar/libedata-cal/Makefile
1764 calendar/libedata-cal/libedata-cal.pc
1765 calendar/backends/Makefile
1766 calendar/backends/caldav/Makefile
1767 calendar/backends/file/Makefile
1768 calendar/backends/groupwise/Makefile
1769 calendar/backends/http/Makefile
1770 calendar/backends/contacts/Makefile
1771 calendar/backends/weather/Makefile
1772 calendar/backends/google/Makefile
1773 calendar/tests/Makefile
1774 calendar/tests/ecal/Makefile
1776 camel/providers/Makefile
1777 camel/providers/groupwise/Makefile
1778 camel/providers/hula/Makefile
1779 camel/providers/imap/Makefile
1780 camel/providers/imapp/Makefile
1781 camel/providers/imap4/Makefile
1782 camel/providers/local/Makefile
1783 camel/providers/nntp/Makefile
1784 camel/providers/pop3/Makefile
1785 camel/providers/sendmail/Makefile
1786 camel/providers/smtp/Makefile
1787 camel/tests/Makefile
1788 camel/tests/folder/Makefile
1789 camel/tests/lib/Makefile
1790 camel/tests/message/Makefile
1791 camel/tests/mime-filter/Makefile
1792 camel/tests/misc/Makefile
1793 camel/tests/smime/Makefile
1794 camel/tests/stream/Makefile
1796 camel/camel-provider.pc
1798 libebackend/Makefile
1799 libebackend/libebackend.pc
1800 libedataserver/Makefile
1801 libedataserver/eds-version.h
1802 libedataserver/libedataserver.pc
1803 libedataserverui/Makefile
1804 libedataserverui/libedataserverui.pc
1806 servers/groupwise/Makefile
1807 servers/groupwise/libegroupwise.pc
1808 servers/exchange/Makefile
1809 servers/exchange/xntlm/Makefile
1810 servers/exchange/lib/Makefile
1811 servers/exchange/storage/Makefile
1812 servers/exchange/storage/libexchange-storage.pc
1813 servers/google/Makefile
1814 servers/google/libgdata/Makefile
1815 servers/google/libgdata/libgdata.pc
1816 servers/google/libgdata-google/Makefile
1817 servers/google/libgdata-google/libgdata-google.pc
1821 docs/reference/Makefile
1822 docs/reference/addressbook/Makefile
1823 docs/reference/addressbook/libebook/Makefile
1824 docs/reference/addressbook/libedata-book/Makefile
1825 docs/reference/calendar/Makefile
1826 docs/reference/calendar/libecal/Makefile
1827 docs/reference/calendar/libedata-cal/Makefile
1828 docs/reference/camel/Makefile
1829 docs/reference/libedataserver/Makefile
1830 docs/reference/libedataserverui/Makefile
1831 docs/reference/libebackend/Makefile
1837 # Override the old libtool in libdb/dist with the one from here
1838 cp libtool libdb/dist
1843 evolution-data-server has been configured as follows:
1844 Calendar: $msg_calendar
1845 Weather calendar: $use_gweather
1846 Mail Directory: $system_mail_dir, $system_mail_perm
1847 LDAP support: $msg_ldap"
1848 if test "$msg_nntp" = "yes"; then
1850 NNTP support: $msg_nntp"
1852 if test "$msg_hula" = "yes"; then
1854 Hula support: $msg_hula"
1857 Kerberos 4/5: $msg_krb4/$msg_krb5
1858 Gnome Keyring: $enable_gnome_keyring/$with_gnome_keyring
1859 SSL support: $msg_ssl
1860 SMIME support: $msg_smime
1861 IPv6 support: $msg_ipv6
1862 Berkeley DB: $msg_libdb
1863 Exchange support: $msg_exchange
1864 Dot Locking: $msg_dot
1865 File Locking: $msg_file
1866 Large files: $largefile_support
1867 Gtk Doc: $enable_gtk_doc
1869 if test "$msg_no_ntlm" != "no" ; then
1872 No NTLM support in OpenLDAP; Plaintext password authentication will be
1873 used when connecting to the Exchange Global Catalog server. Consider
1874 installing the evo-openldap package, or building OpenLDAP with the
1875 patch in servers/exchange/docs/openldap-ntlm.diff