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], [2])
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-nonliteral -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 #»······-Wmissing-format-attribute
172 CFLAGS="$CFLAGS $WARNING_FLAGS"
174 dnl Initialize maintainer mode
186 AC_MSG_ERROR(You need bison to build evolution-data-server)
194 dnl Test whether jw is installed
195 AC_PATH_PROG(JW,jw,no)
196 if test x$JW = xno; then
201 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
205 IT_PROG_INTLTOOL([0.35.5])
209 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
210 AC_SUBST(GETTEXT_PACKAGE)
211 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
213 localedir='$(prefix)/$(DATADIRNAME)/locale'
216 dnl Initialize libtool
224 dnl ******************************
226 dnl ******************************
228 AC_MSG_CHECKING([for Win32])
232 NO_UNDEFINED='-no-undefined'
233 SOCKET_LIBS='-lws2_32 -ldnsapi'
236 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
237 AC_CACHE_VAL(have_addrinfo, [have_addrinfo=yes])
238 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
244 SOFTOKN3_LIB='-lsoftokn3'
245 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
248 AC_MSG_RESULT([$os_win32])
249 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
250 AC_SUBST(NO_UNDEFINED)
251 AC_SUBST(SOCKET_LIBS)
252 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
254 AC_CHECK_HEADERS(pthread.h semaphore.h sys/wait.h)
255 AC_CHECK_FUNCS(fsync strptime strtok_r)
258 AC_CHECK_HEADERS(alloca.h)
260 # Check for base dependencies early.
261 PKG_CHECK_MODULES(GNOME_PLATFORM,
262 [glib-2.0 >= glib_minimum_version
263 gtk+-2.0 >= gtk_minimum_version
264 ORBit-2.0 >= ORBit_minimum_version
265 libbonobo-2.0 >= libbonobo_minimum_version
266 gconf-2.0 >= gconf_minimum_version
267 libglade-2.0 >= libglade_minimum_version
268 libxml-2.0 >= libxml_minimum_version
269 libsoup-2.4 >= libsoup_minimum_version])
271 LIBICAL_REQUIRED=libical_minimum_version
272 AC_SUBST(LIBICAL_REQUIRED)
274 dnl **************************************************
276 dnl **************************************************
277 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
279 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
280 [AC_MSG_ERROR([No regex library found])])])
283 dnl **************************************************
285 dnl **************************************************
288 AC_HELP_STRING( [--with-libdb],
289 [Prefix where libdb is installed]),
290 dynamic_libdb=yes, dynamic_libdb=no)
292 if test "x${dynamic_libdb}" = "xyes"; then
293 DB_CFLAGS="-I$withval/include"
294 DB_LIBS="-L$withval/lib -ldb"
296 AC_MSG_CHECKING([Berkeley DB])
297 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
298 save_libs=$LIBS; LIBS="$DB_LIBS"
300 [AC_LANG_PROGRAM([[#include <db.h>]],
301 [db_create(NULL, NULL, 0)])],
303 AC_MSG_ERROR(cannot find libdb))
307 msg_libdb="dynamically linked"
309 DB_CFLAGS="-I\$(top_builddir)/libdb/dist"
310 DB_LIBS="\$(top_builddir)/libdb/dist/libdb-4.1.la"
311 if test $os_win32 = yes; then
312 # Don't pointlessly auto-export the global symbols
313 # from the static libdb
314 DB_LIBS="$DB_LIBS -Wl,--exclude-libs=libdb-4.1.a"
316 AC_MSG_NOTICE(Using local libdb)
317 msg_libdb="statically linked to local copy"
319 AM_CONDITIONAL(WITH_LIBDB, test "x$dynamic_libdb" != "xno")
324 dnl ******************************
326 dnl ******************************
328 AC_ARG_WITH(libiconv,
329 AC_HELP_STRING( [--with-libiconv],
330 [Prefix where libiconv is installed]))
331 if test -d $withval; then
332 ICONV_CFLAGS="-I$withval/include"
333 ICONV_LIBS="-L$withval/lib"
336 save_CFLAGS="$CFLAGS"
338 CFLAGS="$CFLAGS $ICONV_CFLAGS"
339 LIBS="$LIBS $ICONV_LIBS -liconv"
340 AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([
342 #include <stdlib.h>],[
344 int main (int argc, char **argv)
347 cd = iconv_open ("UTF-8", "ISO-8859-1");
350 ], ac_cv_libiconv=yes, ac_cv_libiconv=no))
351 if test $ac_cv_libiconv = yes; then
352 ICONV_LIBS="$ICONV_LIBS -liconv"
353 if test $os_win32 = yes; then
354 # Don't pointlessly auto-export the global symbols
355 # from a potentially static libiconv.a
356 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
360 CFLAGS="$save_CFLAGS"
362 AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
365 if test $have_iconv = yes; then
366 if test $ac_cv_libiconv = no; then
367 AC_CHECK_FUNCS(gnu_get_libc_version)
369 AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([
373 #ifdef HAVE_GNU_GET_LIBC_VERSION
374 #include <gnu/libc-version.h>
377 int main (int argc, char **argv)
379 char *from = "Some Text \xA4";
380 char *utf8 = "Some Text \xC2\xA4";
381 char *transbuf = malloc (20), *trans = transbuf;
383 size_t from_len = strlen (from), utf8_len = 20;
384 size_t utf8_real_len = strlen (utf8);
386 #ifdef HAVE_GNU_GET_LIBC_VERSION
387 /* glibc 2.1.2's iconv is broken in hard to test ways. */
388 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
392 cd = iconv_open ("UTF-8", "ISO-8859-1");
393 if (cd == (iconv_t) -1)
395 if (iconv (cd, &from, &from_len, &trans, &utf8_len) == -1 || from_len != 0)
397 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
401 }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], ac_cv_libiconv_utf8=HOPEFULLY))
404 if test "$have_iconv" = no; then
405 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
407 AC_SUBST(ICONV_CFLAGS)
410 CFLAGS="$CFLAGS -I$srcdir"
412 AC_MSG_CHECKING(preferred charset formats for system iconv)
415 #include "iconv-detect.c"
419 AC_MSG_RESULT(not found)
421 *** The iconv-detect program was unable to determine the
422 *** preferred charset formats recognized by your system
423 *** iconv library. It is suggested that you install a
424 *** working iconv library such as the one found at
425 *** ftp://ftp.gnu.org/pub/gnu/libiconv
428 if test x$os_win32 = xyes; then
429 AC_MSG_RESULT(using cached win32 result)
430 echo "/* This is an auto-generated header, DO NOT EDIT! */" > iconv-detect.h
431 echo "" >>iconv-detect.h
432 echo "#define ICONV_ISO_D_FORMAT \"iso-%d-%d\"" >>iconv-detect.h
433 echo "#define ICONV_ISO_S_FORMAT \"iso-%d-%s\"" >>iconv-detect.h
434 echo "#define ICONV_10646 \"UCS-4BE\"" >>iconv-detect.h
436 AC_MSG_RESULT(unknown)
438 *** The iconv-detect program was unable to determine the
439 *** preferred charset formats recognized by your system
440 *** iconv library. You are crosscompiling and supposed
441 *** to know what you are doing. (:-)
446 CFLAGS="$save_CFLAGS"
449 dnl Check for nl_langinfo and CODESET
450 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
451 AC_TRY_COMPILE([#include <langinfo.h>],
452 [char *codeset = nl_langinfo (CODESET);],
453 [ac_cv_langinfo_codeset=yes],
454 [ac_cv_langinfo_codeset=no])
455 if test x$ac_cv_langinfo_codeset = xyes; then
456 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
458 AC_MSG_RESULT($ac_cv_langinfo_codeset)
460 dnl Check to see if strftime supports the use of %l and %k
462 AC_MSG_CHECKING(for %l and %k support in strftime)
468 int main(int argc, char **argv)
475 timeinfo=localtime(&rawtime);
477 strftime(buf, 10, "%lx%k", timeinfo);
479 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
484 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
486 ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no,[
487 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
490 AC_MSG_RESULT($ac_cv_lkstrftime)
492 dnl ********************************************************************************
493 dnl security extension support (SSL and S/MIME)
495 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
496 dnl needed by Camel (SSL and S/MIME).
498 dnl The Evolution security extensions are only built if these libraries are found
499 dnl ********************************************************************************
503 dnl these 2 enable's are inverses of each other
505 AC_HELP_STRING( [--enable-nss=@<:@yes/no/static@:>@],
506 [Attempt to use Mozilla libnss for SSL support.]),
507 enable_nss="$enableval", enable_nss="yes")
510 AC_HELP_STRING( [--enable-smime=@<:@yes/no@:>@],
511 [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
512 enable_smime="$enableval", enable_smime="yes")
514 AC_ARG_ENABLE(gnome-keyring,
515 AC_HELP_STRING( [--enable-gnome-keyring=@<:@yes/no@:>@],
516 [Attempt to use Gnome Keyring for storing passwords]),
517 enable_gnome_keyring="$enableval", enable_gnome_keyring="no")
519 AC_ARG_WITH(nspr-includes,
520 AC_HELP_STRING( [--with-nspr-includes=PREFIX],
521 [Location of Mozilla nspr4 includes.]),
522 with_nspr_includes="$withval")
524 AC_ARG_WITH(nspr-libs,
525 AC_HELP_STRING( [--with-nspr-libs=PREFIX],
526 [Location of Mozilla nspr4 libs.]),
527 with_nspr_libs="$withval")
529 AC_ARG_WITH(nss-includes,
530 AC_HELP_STRING( [--with-nss-includes=PREFIX],
531 [Location of Mozilla nss3 includes.]),
532 with_nss_includes="$withval")
534 AC_ARG_WITH(nss-libs,
535 AC_HELP_STRING( [--with-nss-libs=PREFIX],
536 [Location of Mozilla nss3 libs.]),
537 with_nss_libs="$withval")
539 if test "x${enable_gnome_keyring}" = "xyes"; then
540 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= gnome_keyring_minimum_version, with_gnome_keyring="yes", with_gnome_keyring="no");
541 if test "x$with_gnome_keyring" = "xyes"; then
542 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Gnome Keyring available])
543 GNOME_KEYRING_REQUIREMENT="gnome-keyring-1"
545 GNOME_KEYRING_REQUIREMENT=""
549 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
550 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
556 if test "x${check_manually}" = "xno"; then
557 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
558 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
559 for pc in $mozilla_nspr_pcs; do
560 if $PKG_CONFIG --exists $pc; then
567 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
568 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
569 for pc in $mozilla_nss_pcs; do
570 if $PKG_CONFIG --exists $pc; then
577 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
578 msg_ssl="yes (Mozilla NSS)"
579 if test "x$enable_smime" = "xyes"; then
580 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
581 msg_smime="yes (Mozilla NSS)"
583 AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
584 AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
585 MANUAL_NSPR_CFLAGS=""
596 if test "x${check_manually}" = "xyes"; then
597 have_nspr_includes="no"
598 if test "x${with_nspr_includes}" != "xno"; then
599 CPPFLAGS_save="$CPPFLAGS"
601 AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
604 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
605 AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
606 CPPFLAGS="$CPPFLAGS_save"
608 if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
609 have_nspr_includes="yes"
610 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
613 AC_MSG_CHECKING(for Mozilla nspr4 includes)
618 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
619 CFLAGS_save="$CFLAGS"
620 LDFLAGS_save="$LDFLAGS"
622 if test "$enable_nss" = "static"; then
623 if test -z "${with_nspr_libs}"; then
624 AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
625 [Please specify the path to libnspr4.a]
626 [Example: --with-nspr-libs=/usr/lib])
628 nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
631 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
634 AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs,
637 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
639 if test "x${with_nspr_libs}" != "x"; then
641 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
647 AC_TRY_LINK_FUNC(PR_Init, moz_nspr_libs="yes", moz_nspr_libs="no")
648 CFLAGS="$CFLAGS_save"
649 LDFLAGS="$LDFLAGS_save"
652 if test "x$moz_nspr_libs" != "xno"; then
654 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
656 MANUAL_NSPR_CLFAGS=""
659 AC_MSG_CHECKING(for Mozilla nspr4 libraries)
663 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
664 CPPFLAGS_save="$CPPFLAGS"
666 AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
669 if test "x${with_nspr_includes}" != "x"; then
670 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
672 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
675 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
676 [ have_nss_includes="yes" ],
677 [ have_nss_includes="no" ])
679 CPPFLAGS="$CPPFLAGS_save"
681 if test "x${have_nss_includes}" = "xyes"; then
682 have_nss_includes="yes"
683 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
685 MANUAL_NSPR_CFLAGS=""
689 AC_MSG_CHECKING(for Mozilla nss3 includes)
693 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
694 LDFLAGS_save="$LDFLAGS"
696 if test "$enable_nss" = "static"; then
697 if test -z "${with_nss_libs}"; then
698 AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
699 [Please specify the path to libnss3.a]
700 [Example: --with-nspr-libs=/usr/lib/mozilla])
702 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"
705 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
710 nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB"
713 AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs,
716 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
717 LIBS="$nsslibs $nsprlibs"
718 AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
719 if test "$moz_nss_libs" = no; then
720 nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB"
721 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
722 AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
724 LDFLAGS="$LDFLAGS_save"
727 if test "$moz_nss_libs" != no; then
730 if test "$enable_nss" = "static"; then
731 msg_ssl="yes (Mozilla NSS:static)"
733 msg_ssl="yes (Mozilla NSS)"
735 if test "$enable_smime" = "yes"; then
736 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
737 msg_smime="yes (Mozilla NSS)"
739 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
742 MANUAL_NSPR_CFLAGS=""
746 AC_MSG_CHECKING(for Mozilla nss libraries)
750 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
751 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
755 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
757 AC_SUBST(MANUAL_NSPR_CFLAGS)
758 AC_SUBST(MANUAL_NSPR_LIBS)
759 AC_SUBST(MANUAL_NSS_CFLAGS)
760 AC_SUBST(MANUAL_NSS_LIBS)
762 if test $os_win32 != yes; then
764 dnl check for socklen_t (in Unix98)
765 AC_MSG_CHECKING(for socklen_t)
766 AC_TRY_COMPILE([#include <sys/types.h>
767 #include <sys/socket.h>
769 ],[],[AC_MSG_RESULT(yes)],[
770 AC_TRY_COMPILE([#include <sys/types.h>
771 #include <sys/socket.h>
772 int accept (int, struct sockaddr *, size_t *);
774 AC_MSG_RESULT(size_t)
775 AC_DEFINE(socklen_t,size_t,[Define to appropriate type if socklen_t is not defined])], [
777 AC_DEFINE(socklen_t,int)])])
782 dnl system mail stuff
784 AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
785 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
787 AC_MSG_CHECKING(system mail directory)
788 if test -d /var/mail -a '!' -h /var/mail ; then
789 system_mail_dir=/var/mail
791 system_mail_dir=/var/spool/mail
793 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
795 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
797 CAMEL_LOCK_HELPER_USER=""
798 CAMEL_LOCK_HELPER_GROUP=""
799 system_mail_perm="world writable"
803 CAMEL_LOCK_HELPER_USER=""
804 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
805 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
809 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
810 CAMEL_LOCK_HELPER_GROUP=""
811 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
815 CAMEL_LOCK_HELPER_USER=""
816 CAMEL_LOCK_HELPER_GROUP=""
817 system_mail_perm="???"
821 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
822 AC_SUBST(CAMEL_LOCK_HELPER_USER)
823 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
829 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
835 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
836 if test $ac_cv_struct_tm_gmtoff = yes; then
837 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
839 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
844 ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
845 if test $ac_cv_var_timezone = yes; then
846 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
847 AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone,
852 ], ac_cv_var_altzone=yes, ac_cv_var_altzone=no))
853 if test $ac_cv_var_altzone = yes; then
854 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
857 AC_ERROR(unable to find a way to determine timezone)
862 dnl **************************************************
863 dnl ctime_r prototype
864 dnl **************************************************
866 AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args,
873 ctime_r (&date, buf, 100);
875 ac_cv_ctime_r_three_args=yes
877 ac_cv_ctime_r_three_args=no
881 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
882 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
885 dnl **************************************************
886 dnl gethostbyname_r prototype
887 dnl **************************************************
889 AC_CHECK_FUNCS(gethostbyname_r,[
890 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args,
893 #include "confdefs.h"
894 #include <sys/types.h>
895 #include <sys/socket.h>
896 #include <netinet/in.h>
899 #define BUFSIZE (sizeof(struct hostent)+10)
902 char buffer[BUFSIZE];
906 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
908 ac_cv_gethostbyname_r_five_args=yes
910 ac_cv_gethostbyname_r_five_args=no
914 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
915 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
918 dnl **************************************************
919 dnl gethostbyaddr_r prototype
920 dnl **************************************************
922 AC_CHECK_FUNCS(gethostbyaddr_r,[
923 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args,
926 #include "confdefs.h"
927 #include <sys/types.h>
928 #include <sys/socket.h>
929 #include <netinet/in.h>
932 #define BUFSIZE (sizeof(struct hostent)+10)
935 char buffer[BUFSIZE];
939 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno);
941 ac_cv_gethostbyaddr_r_seven_args=yes
943 ac_cv_gethostbyaddr_r_seven_args=no
947 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
948 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
951 dnl **************************************************
952 dnl stat(v)fs location/type
953 dnl **************************************************
955 AC_CHECK_HEADERS(sys/statvfs.h)
956 AC_CHECK_FUNCS(statvfs)
957 AC_CHECK_HEADERS(sys/param.h)
958 AC_CHECK_HEADERS(sys/mount.h)
959 AC_CHECK_FUNCS(statfs)
961 dnl **************************************************
962 dnl * IPv6 support and getaddrinfo calls
963 dnl **************************************************
964 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], have_addrinfo,
967 #include "confdefs.h"
968 #include <sys/types.h>
969 #include <sys/socket.h>
970 #include <netinet/in.h>
976 #define NI_MAXHOST 1025
980 #define NI_MAXSERV 32
983 struct addrinfo hints, *res;
984 struct sockaddr_in6 sin6;
986 char host[NI_MAXHOST];
987 char serv[NI_MAXSERV];
989 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
991 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0);
999 if test x"$have_addrinfo" = "xno" ; then
1000 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1001 if test x"$enable_ipv6" = "xyes" ; then
1002 AC_ERROR(system doesn't support necessary interfaces for ipv6 support)
1007 AC_HELP_STRING( [--enable-ipv6=@<:@no/yes@:>@],
1008 [Enable support for resolving IPv6 addresses.]),
1010 if test x"$enable_ipv6" = "xyes"; then
1012 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1014 #include "confdefs.h"
1015 #include <sys/types.h>
1016 #include <sys/socket.h>
1017 #include <netinet/in.h>
1021 struct addrinfo hints;
1023 hints.ai_flags = AI_ADDRCONFIG;
1025 AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])
1032 AM_CONDITIONAL(ENABLE_IPv6, test "x$enable_ipv6" = "xyes")
1034 dnl **************************************************
1035 dnl Calendar support
1036 dnl **************************************************
1037 AC_MSG_CHECKING(if we should build the calendar)
1038 AC_ARG_ENABLE(calendar,
1039 AC_HELP_STRING( [--enable-calendar=@<:@yes/no@:>@],
1040 [Enable the calendar components (default yes)]),
1041 enable_calendar="$enableval", enable_calendar="yes")
1043 if test "x${enable_calendar}" != "xno"; then
1044 AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
1046 AM_CONDITIONAL(ENABLE_CALENDAR, test x$enable_calendar = xyes)
1047 AC_MSG_RESULT($enable_calendar)
1048 msg_calendar=$enable_calendar
1050 dnl **************************************************
1051 dnl Weather calendar backend support
1052 dnl **************************************************
1053 AC_MSG_CHECKING(if we should build the weather calendar backend)
1054 AC_ARG_WITH([weather],
1055 [AC_HELP_STRING([--with-weather], [Build the weather calendar backend (default=yes)])],
1056 [use_gweather=$withval],
1058 if test $enable_calendar = no; then
1059 use_gweather="no (calendar support is disabled)"
1061 AC_MSG_RESULT($use_gweather)
1063 if test $use_gweather = yes; then
1064 PKG_CHECK_MODULES([LIBGWEATHER],
1065 [gweather >= gweather_minimum_version],
1067 [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.])])
1070 AM_CONDITIONAL(ENABLE_WEATHER, test $use_gweather = yes)
1072 dnl **************************************************
1074 dnl **************************************************
1076 AC_HELP_STRING( [--enable-nntp=@<:@no/yes@:>@],
1077 [Build Usenet news (NNTP) backend]),
1080 if test "x$enable_nntp" = "xyes"; then
1081 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1086 AM_CONDITIONAL(ENABLE_NNTP, test x$enable_nntp = xyes)
1088 dnl **************************************************
1089 dnl New IMAP code support.
1090 dnl **************************************************
1091 AC_ARG_ENABLE(imapp,
1092 AC_HELP_STRING( [--enable-imapp=@<:@no/yes@:>@],
1093 [Attempt to compile alternative, incomplete, very unsupported IMAPv4r1 code]),
1096 if test "x$enable_imapp" = "xyes"; then
1097 AC_DEFINE(ENABLE_IMAPP,1,[Really don't try this at home])
1102 AM_CONDITIONAL(ENABLE_IMAPP, test x$enable_imapp = xyes)
1104 dnl **************************************************
1105 dnl IMAP4rev1 code support.
1106 dnl **************************************************
1107 AC_ARG_ENABLE(imap4,
1108 AC_HELP_STRING( [--enable-imap4=@<:@no/yes@:>@],
1109 [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
1112 if test "x$enable_imap4" = "xyes"; then
1113 AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
1118 AM_CONDITIONAL(ENABLE_IMAP4, test x$enable_imap4 = xyes)
1120 dnl **************************************************
1122 dnl **************************************************
1124 AC_HELP_STRING( [--enable-hula=@<:@no/yes@:>@],
1125 [Enable support for the now-defunct Hula project]),
1128 if test "x$enable_hula" = "xyes"; then
1129 AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1134 AM_CONDITIONAL(ENABLE_HULA, test x$enable_hula = xyes)
1136 dnl **************************************************
1138 dnl **************************************************
1140 AC_ARG_ENABLE(dot-locking,
1141 AC_HELP_STRING( [--enable-dot-locking=@<:@yes/no@:>@],
1142 [Enable support for locking mail files with dot locking]),
1143 ,enable_dot_locking=yes)
1145 if test $os_win32 != yes -a "x$enable_dot_locking" = "xyes"; then
1146 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1152 AC_ARG_ENABLE(file-locking,
1153 AC_HELP_STRING( [--enable-file-locking=@<:@fcntl/flock/no@:>@],
1154 [Enable support for locking mail files with file locking]),
1155 ,enable_file_locking=fcntl)
1157 if test $os_win32 != yes -a "x$enable_file_locking" = "xfcntl"; then
1158 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1161 if test $os_win32 != yes -a "x$enable_file_locking" = "xflock"; then
1162 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1169 dnl **************************************************
1170 dnl * sendmail operation
1171 dnl **************************************************
1173 AC_MSG_CHECKING(for SunOS broken spool format)
1174 if test "x$host_os" = "xsunos" ; then
1175 with_broken_spool="yes"
1178 AC_ARG_WITH(broken-spool,
1179 AC_HELP_STRING( [--with-broken-spool=@<:@yes/no@:>@],
1180 [Using SunOS/Solaris sendmail which has a broken spool format]),
1181 ,with_broken_spool=${with_broken_spool:=no})
1183 if test "x$with_broken_spool" = "xyes"; then
1184 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1187 AC_MSG_RESULT($with_broken_spool)
1193 AC_HELP_STRING( [--with-krb5=DIR],
1194 [Location of Kerberos 5 install dir]),
1195 with_krb5="$withval", with_krb5="no")
1197 AC_ARG_WITH(krb5-libs,
1198 AC_HELP_STRING( [--with-krb5-libs=DIR],
1199 [Location of Kerberos 5 libraries]),
1200 with_krb5_libs="$withval", with_krb5_libs="$with_krb5/lib")
1202 AC_ARG_WITH(krb5-includes,
1203 AC_HELP_STRING( [--with-krb5-includes=DIR],
1204 [Location of Kerberos 5 headers]),
1205 with_krb5_includes="$withval", with_krb5_includes="")
1208 AC_HELP_STRING( [--with-krb4=DIR],
1209 [Location of Kerberos 4 install dir]),
1210 with_krb4="$withval", with_krb4="no")
1212 AC_ARG_WITH(krb4-libs,
1213 AC_HELP_STRING( [--with-krb4-libs=DIR],
1214 [Location of Kerberos 4 libraries]),
1215 with_krb4_libs="$withval", with_krb4_libs="$with_krb4/lib")
1217 AC_ARG_WITH(krb4-includes,
1218 AC_HELP_STRING( [--with-krb4-includes=DIR],
1219 [Location of Kerberos 4 headers]),
1220 with_krb4_includes="$withval", with_krb4_includes="")
1223 if test "x${with_krb5}" != "xno"; then
1224 LDFLAGS_save="$LDFLAGS"
1226 mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
1227 heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
1228 sunlibs="-lkrb5 -lgss"
1229 AC_CACHE_CHECK([for Kerberos 5], ac_cv_lib_kerberos5,
1231 LDFLAGS="$LDFLAGS -L$with_krb5_libs $mitlibs"
1232 AC_TRY_LINK([#include <krb5.h>],krb5_init_context, ac_cv_lib_kerberos5="$mitlibs",
1234 LDFLAGS="$LDFLAGS_save -L$with_krb5_libs $heimlibs"
1235 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$heimlibs",
1237 LDFLAGS="$LDFLAGS_save -L$with_krb5_libs $sunlibs"
1238 AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$sunlibs", ac_cv_lib_kerberos5="no")
1241 LDFLAGS="$LDFLAGS_save"
1243 if test "$ac_cv_lib_kerberos5" != "no"; then
1244 AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
1245 if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then
1246 AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
1247 if test -z "$with_krb5_includes"; then
1248 KRB5_CFLAGS="-I$with_krb5/include"
1250 KRB5_CFLAGS="-I$with_krb5_includes"
1252 msg_krb5="yes (MIT)"
1254 if test "$ac_cv_lib_kerberos5" = "$heimlibs"; then
1255 AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
1256 if test -z "$with_krb5_includes"; then
1257 KRB5_CFLAGS="-I$with_krb5/include/heimdal"
1259 KRB5_CFLAGS="-I$with_krb5_includes"
1261 msg_krb5="yes (Heimdal)"
1263 AC_DEFINE(HAVE_SUN_KRB5,1,[Define if you have Sun Kerberosv5])
1264 if test -z "$with_krb5_includes"; then
1265 KRB5_CFLAGS="-I$with_krb5/include/kerberosv5"
1267 KRB5_CFLAGS="-I$with_krb5_includes"
1269 msg_krb5="yes (Sun)"
1272 KRB5_LDFLAGS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1273 AC_MSG_RESULT(msg_krb5)
1275 dnl AC_MSG_CHECKING([for Kerberos 5])
1277 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1280 AC_MSG_WARN([krb5 support disabled])
1283 AM_CONDITIONAL(ENABLE_KRB5, test x$with_krb5 != xno)
1285 AC_CHECK_HEADER([et/com_err.h],[AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have et/comm_err.h])])
1286 AC_CHECK_HEADER([com_err.h],[AC_DEFINE([HAVE_COM_ERR_H], 1, [Have comm_err.h])])
1289 if test "x${with_krb4}" != "xno"; then
1290 LDFLAGS_save="$LDFLAGS"
1291 AC_CACHE_CHECK(for Kerberos 4, ac_cv_lib_kerberos4,
1293 ac_cv_lib_kerberos4="no"
1295 mitcompatlibs="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
1296 # Look for MIT krb5 compat krb4
1297 LDFLAGS="$LDFLAGS -L$with_krb4_libs $mitcompatlibs"
1298 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="$mitcompatlibs")
1300 if test "$ac_cv_lib_kerberos4" = "no"; then
1302 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb -lcrypto -lcom_err -lroken"
1303 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -lcrypto -lcom_err -lroken")
1305 if test "$ac_cv_lib_kerberos4" = "no"; then
1306 # Look for old MIT krb4
1307 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb"
1308 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb",
1310 LDFLAGS="$LDFLAGS -ldes"
1311 AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -ldes")
1315 LDFLAGS="$LDFLAGS_save"
1316 if test "$ac_cv_lib_kerberos4" != "no"; then
1317 AC_DEFINE(HAVE_KRB4,1,[Define if you have Krb4])
1320 if test -z "$with_krb4_includes"; then
1321 if test -f "$with_krb4/include/krb.h" -o -f "$with_krb4/include/port-sockets.h"; then
1322 KRB4_CFLAGS="-I$with_krb4/include"
1324 if test -d "$with_krb4/include/kerberosIV"; then
1325 KRB4_CFLAGS="$KRB4_CFLAGS -I$with_krb4/include/kerberosIV"
1328 KRB4_CFLAGS="-I$with_krb4_includes"
1330 KRB4_LDFLAGS="-L$with_krb4_libs $ac_cv_lib_kerberos4"
1332 CFLAGS_save="$CFLAGS"
1333 CFLAGS="$CFLAGS $KRB4_CFLAGS"
1334 AC_TRY_COMPILE([#include "krb.h"
1336 ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO,1,[Need krb_sendauth proto])],)
1337 CFLAGS="$CFLAGS_save"
1340 AC_MSG_CHECKING(for Kerberos 4)
1341 AC_MSG_RESULT(${with_krb4})
1344 AC_SUBST(KRB5_CFLAGS)
1345 AC_SUBST(KRB5_LDFLAGS)
1346 AC_SUBST(KRB4_CFLAGS)
1347 AC_SUBST(KRB4_LDFLAGS)
1354 dnl **************************************************
1356 dnl **************************************************
1357 AC_ARG_WITH(e2k-debug,
1358 AC_HELP_STRING( [--with-e2k-debug],
1364 AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1368 dnl **************************************************
1370 dnl **************************************************
1371 if test "$os_win32" != yes; then
1373 case $with_openldap in
1378 case $with_static_ldap in
1380 msg_ldap="$with_openldap (static)"
1383 msg_ldap="$with_openldap (dynamic)"
1388 dnl **************************************************
1389 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1390 dnl **************************************************
1391 if test "$with_openldap" = no ; then
1392 EVO_SUNLDAP_CHECK(no)
1393 case $with_sunldap in
1398 case $with_static_sunldap in
1400 msg_ldap="$with_sunldap (static)"
1403 msg_ldap="$with_sunldap (dynamic)"
1410 AM_CONDITIONAL(SUNLDAP, test "$with_sunldap" != no)
1412 SAVE_CFLAGS="$CFLAGS"
1414 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1415 CFLAGS="$CFLAGS $LDAP_CFLAGS"
1416 LIBS="$LIBS $LDAP_LIBS"
1417 AC_CHECK_FUNCS(ldap_ntlm_bind)
1418 CFLAGS="$SAVE_CFLAGS"
1420 dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1423 if test "$msg_ldap" != "no" ; then
1424 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1427 dnl The user wanted to build with openldap, but his openldap did not have NTLM
1428 dnl support. Make him aware of this with a warning message at the end.
1433 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1434 LDAP_LIBS="-lwldap32"
1435 AC_SUBST(LDAP_CFLAGS)
1437 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1438 AM_CONDITIONAL(ENABLE_LDAP, true)
1439 AM_CONDITIONAL(SUNLDAP, false)
1445 LIBBONOBO_REQUIRED=libbonobo_minimum_version
1446 AC_SUBST(LIBBONOBO_REQUIRED)
1448 ORBIT_REQUIRED=ORBit_minimum_version
1449 AC_SUBST(ORBIT_REQUIRED)
1451 dnl *******************
1452 dnl GObject marshalling
1453 dnl *******************
1456 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1457 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1458 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1460 dnl **************************************************
1461 dnl * Posix thread support
1462 dnl **************************************************
1464 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1465 dnl GNOME_PTHREAD_CHECK
1467 dnl if test "x$PTHREAD_LIB" = "x" ; then
1468 dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1472 dnl Notice that this is a hack, and we wont be able to use this forever, but
1473 dnl at least for some time
1478 THREADS_LIBS="$PTHREAD_LIB"
1479 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1481 AC_SUBST(THREADS_LIBS)
1482 AC_SUBST(THREADS_CFLAGS)
1483 AC_DEFINE(ENABLE_THREADS,1,[Required])
1485 PKG_CHECK_MODULES(ORBIT, ORBit-2.0 >= ORBit_minimum_version)
1486 test x$ORBIT_IDL = x && ORBIT_IDL=`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`
1487 AC_SUBST(ORBIT_CFLAGS)
1488 AC_SUBST(ORBIT_LIBS)
1491 AC_MSG_CHECKING(for CORBA include paths)
1492 IDL_INCLUDES="-I"`pkg-config --variable=idldir libbonobo-2.0`" -I"`pkg-config --variable=idldir bonobo-activation-2.0`
1493 AC_MSG_RESULT($IDL_INCLUDES)
1494 AC_SUBST(IDL_INCLUDES)
1496 dnl Utility macro to set compiler flags for a specific lib.
1497 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1498 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1499 PKG_CHECK_MODULES([$1], [$2])
1500 $1_CFLAGS="[$]$1_CFLAGS $3 "
1501 $1_LIBS="[$]$1_LIBS $4 "
1504 dnl ****************************************
1505 dnl Flags for the various libraries we build
1506 dnl ****************************************
1508 dnl --- libedataserver, libedataserverui, libebackend flags
1510 E_DATA_SERVER_DEPS="libxml-2.0 libbonobo-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1512 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
1513 AC_SUBST(E_DATA_SERVER_CFLAGS)
1514 AC_SUBST(E_DATA_SERVER_LIBS)
1516 E_DATA_SERVER_UI_DEPS="gtk+-2.0 libglade-2.0 gobject-2.0 gthread-2.0 gconf-2.0 $GNOME_KEYRING_REQUIREMENT"
1518 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
1519 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1520 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1522 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0"
1524 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1525 AC_SUBST(E_BACKEND_CFLAGS)
1526 AC_SUBST(E_BACKEND_LIBS)
1528 dnl --- evolution-addressbook flags
1530 EVOLUTION_ADDRESSBOOK_DEPS="libxml-2.0 libbonobo-2.0 gobject-2.0 gthread-2.0 gconf-2.0"
1532 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1533 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1534 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1536 dnl --- evolution-calendar flags
1537 if test "x${enable_calendar}" = "xyes"; then
1538 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"
1541 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1542 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1543 dnl to differentiate between <libical/ical.h> and <ical.h>
1544 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1545 dnl libical is fixed, we have to work-around the buggy CFlags.
1547 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1548 LIBICAL_EXTRA_LIBS=""
1549 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1550 AC_SUBST(LIBICAL_EXTRA_LIBS)
1552 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1553 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1554 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1557 dnl --- factory flags
1559 E_FACTORY_DEPS="$mozilla_nspr"
1560 if test "x${enable_calendar}" = "xyes"; then
1561 E_FACTORY_DEPS="$E_FACTORY_DEPS libical"
1563 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)
1564 AC_SUBST(E_FACTORY_CFLAGS)
1565 AC_SUBST(E_FACTORY_LIBS)
1567 dnl --- Google flags
1568 GDATA_DEPS="libsoup-2.4 libxml-2.0"
1569 EVO_SET_COMPILE_FLAGS(GDATA, $GDATA_DEPS)
1570 AC_SUBST(GDATA_CFLAGS)
1571 AC_SUBST(GDATA_LIBS)
1573 dnl --- Groupwise flags
1574 LIBSOUP_REQUIRED=libsoup_minimum_version
1575 AC_SUBST(LIBSOUP_REQUIRED)
1577 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1578 AC_SUBST(SOUP_CFLAGS)
1582 SQLITE_REQUIRED=sqlite_minimum_version
1583 AC_SUBST(SQLITE_REQUIRED)
1586 dnl deflateInit is a #define, use deflateEnd instead
1587 AC_CHECK_LIB(z, deflateEnd,
1588 [ AC_CHECK_HEADER(zlib.h, zlib_found=true) ])
1589 if test "x$zlib_found" = "xfalse"; then
1590 AC_MSG_ERROR([*** zlib is required])
1593 dnl *************************************
1594 dnl *** Checks for large file support ***
1595 dnl *************************************
1596 AC_ARG_ENABLE(largefile,
1597 AC_HELP_STRING([--enable-largefile],
1598 [enable support for large files [[default=no]]]),,
1599 enable_largefile="no")
1600 if test "x$enable_largefile" != "xno"; then
1602 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], largefile64_source,
1605 #include <sys/types.h>
1606 #include <sys/stat.h>
1609 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
1611 largefile64_source="no"
1614 #define _LARGEFILE64_SOURCE
1615 #include <sys/types.h>
1616 #include <sys/stat.h>
1619 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
1621 largefile64_source="yes"
1623 largefile64_source="unknown"
1628 enable_largefile="no"
1630 if test "x$largefile64_source" = "xyes"; then
1631 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1632 enable_largefile="yes"
1633 elif test "x$largefile64_source" = "xunknown"; then
1634 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1637 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1638 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1639 enable_largefile="yes"
1642 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1643 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1644 enable_largefile="yes"
1647 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1651 AM_CONDITIONAL(ENABLE_LARGEFILE, test "x$enable_largefile" = "xyes")
1653 EVO_SET_COMPILE_FLAGS(CAMEL, $mozilla_nss gio-2.0 sqlite3 >= sqlite_minimum_version gthread-2.0,
1654 $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS,
1655 -lz $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS)
1656 AC_SUBST(CAMEL_CFLAGS)
1657 AC_SUBST(CAMEL_LIBS)
1658 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1659 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1661 dnl *******************
1662 dnl Special directories
1663 dnl *******************
1665 dnl --- If you add something here, consider whether or not you also
1666 dnl --- need to add it to one or more .pc.in files (for Connector,
1669 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1670 AC_SUBST(privdatadir)
1672 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1673 AC_SUBST(privincludedir)
1675 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1676 AC_SUBST(privlibdir)
1678 idldir='${datadir}'/idl/evolution-data-server-$API_VERSION
1681 imagesdir='${datadir}'/pixmaps/evolution-data-server
1684 serverdir="$libdir/bonobo/servers"
1687 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1688 AC_SUBST(extensiondir)
1690 gladedir="$privdatadir/glade"
1693 if test $use_gweather = yes; then
1694 weatherdatadir="$privdatadir/weather"
1695 AC_SUBST(weatherdatadir)
1698 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1699 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
1700 AC_SUBST(camel_providerdir)
1702 dnl ************************
1703 dnl IDL/Component Versioning
1704 dnl ************************
1706 INTERFACE_VERSION="$BASE_VERSION"
1707 AC_SUBST(INTERFACE_VERSION)
1708 AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)])
1710 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)|" $< > $@'
1711 EVO_NAME_SERVER_RULE='%_$(API_VERSION).server: %.server ; mv $< $@'
1712 AC_SUBST(EVO_SUBST_SERVER_RULE)
1713 AC_SUBST(EVO_NAME_SERVER_RULE)
1718 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1726 dnl ******************************
1728 dnl ******************************
1731 export privincludedir
1734 if test $dynamic_libdb = no; then
1735 AC_CONFIG_SUBDIRS(libdb/dist)
1739 evolution-data-server-zip
1740 evolution-data-server.pc
1741 addressbook/Makefile
1742 addressbook/idl/Makefile
1743 addressbook/libebook/Makefile
1744 addressbook/libebook/libebook.pc
1745 addressbook/libedata-book/Makefile
1746 addressbook/libedata-book/libedata-book.pc
1747 addressbook/backends/Makefile
1748 addressbook/backends/file/Makefile
1749 addressbook/backends/vcf/Makefile
1750 addressbook/backends/ldap/Makefile
1751 addressbook/backends/google/Makefile
1752 addressbook/backends/groupwise/Makefile
1753 addressbook/backends/webdav/Makefile
1754 addressbook/tests/Makefile
1755 addressbook/tests/ebook/Makefile
1756 addressbook/tests/vcard/Makefile
1759 calendar/idl/Makefile
1760 calendar/libecal/Makefile
1761 calendar/libecal/libecal.pc
1762 calendar/libedata-cal/Makefile
1763 calendar/libedata-cal/libedata-cal.pc
1764 calendar/backends/Makefile
1765 calendar/backends/caldav/Makefile
1766 calendar/backends/file/Makefile
1767 calendar/backends/groupwise/Makefile
1768 calendar/backends/http/Makefile
1769 calendar/backends/contacts/Makefile
1770 calendar/backends/weather/Makefile
1771 calendar/backends/google/Makefile
1772 calendar/tests/Makefile
1773 calendar/tests/ecal/Makefile
1775 camel/providers/Makefile
1776 camel/providers/groupwise/Makefile
1777 camel/providers/hula/Makefile
1778 camel/providers/imap/Makefile
1779 camel/providers/imapp/Makefile
1780 camel/providers/imap4/Makefile
1781 camel/providers/local/Makefile
1782 camel/providers/nntp/Makefile
1783 camel/providers/pop3/Makefile
1784 camel/providers/sendmail/Makefile
1785 camel/providers/smtp/Makefile
1786 camel/tests/Makefile
1787 camel/tests/folder/Makefile
1788 camel/tests/lib/Makefile
1789 camel/tests/message/Makefile
1790 camel/tests/mime-filter/Makefile
1791 camel/tests/misc/Makefile
1792 camel/tests/smime/Makefile
1793 camel/tests/stream/Makefile
1795 camel/camel-provider.pc
1797 libebackend/Makefile
1798 libebackend/libebackend.pc
1799 libedataserver/Makefile
1800 libedataserver/eds-version.h
1801 libedataserver/libedataserver.pc
1802 libedataserverui/Makefile
1803 libedataserverui/libedataserverui.pc
1805 servers/groupwise/Makefile
1806 servers/groupwise/libegroupwise.pc
1807 servers/exchange/Makefile
1808 servers/exchange/xntlm/Makefile
1809 servers/exchange/lib/Makefile
1810 servers/exchange/storage/Makefile
1811 servers/exchange/storage/libexchange-storage.pc
1812 servers/google/Makefile
1813 servers/google/libgdata/Makefile
1814 servers/google/libgdata/libgdata.pc
1815 servers/google/libgdata-google/Makefile
1816 servers/google/libgdata-google/libgdata-google.pc
1820 docs/reference/Makefile
1821 docs/reference/addressbook/Makefile
1822 docs/reference/addressbook/libebook/Makefile
1823 docs/reference/addressbook/libedata-book/Makefile
1824 docs/reference/calendar/Makefile
1825 docs/reference/calendar/libecal/Makefile
1826 docs/reference/calendar/libedata-cal/Makefile
1827 docs/reference/camel/Makefile
1828 docs/reference/libedataserver/Makefile
1829 docs/reference/libedataserverui/Makefile
1830 docs/reference/libebackend/Makefile
1836 # Override the old libtool in libdb/dist with the one from here
1837 cp libtool libdb/dist
1842 evolution-data-server has been configured as follows:
1843 Calendar: $msg_calendar
1844 Weather calendar: $use_gweather
1845 Mail Directory: $system_mail_dir, $system_mail_perm
1846 LDAP support: $msg_ldap"
1847 if test "$msg_nntp" = "yes"; then
1849 NNTP support: $msg_nntp"
1851 if test "$msg_hula" = "yes"; then
1853 Hula support: $msg_hula"
1856 Kerberos 4/5: $msg_krb4/$msg_krb5
1857 Gnome Keyring: $enable_gnome_keyring/$with_gnome_keyring
1858 SSL support: $msg_ssl
1859 SMIME support: $msg_smime
1860 IPv6 support: $msg_ipv6
1861 Berkeley DB: $msg_libdb
1862 Exchange support: $msg_exchange
1863 Dot Locking: $msg_dot
1864 File Locking: $msg_file
1865 Large files: $largefile_support
1866 Gtk Doc: $enable_gtk_doc
1868 if test "$msg_no_ntlm" != "no" ; then
1871 No NTLM support in OpenLDAP; Plaintext password authentication will be
1872 used when connecting to the Exchange Global Catalog server. Consider
1873 installing the evo-openldap package, or building OpenLDAP with the
1874 patch in servers/exchange/docs/openldap-ntlm.diff