1 dnl Evolution-Data-Server version
2 m4_define([eds_major_version], [2])
3 m4_define([eds_minor_version], [29])
4 m4_define([eds_micro_version], [1])
6 m4_define([eds_version],
7 [eds_major_version.eds_minor_version.eds_micro_version])
9 dnl Base Version: This is for API/version tracking for things like
10 dnl Bonobo server files. This should always be the major/minor of
11 dnl the stable version or stable version to be. Note, this is set
12 dnl the way it is so that GETTEXT_PACKAGE will be parsed correctly.
14 m4_define([base_version], [2.30])
16 dnl This number is meaningless, but we're now stuck with it in our
17 dnl library names for backward compatibility.
18 m4_define([api_version], [1.2])
20 dnl Autoconf / Automake Initialization
22 AC_INIT([evolution-data-server],[eds_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server])
23 AM_INIT_AUTOMAKE([gnu 1.9 tar-ustar])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_SRCDIR(README)
26 AC_CONFIG_HEADERS(config.h)
28 dnl This is for the autoconf tests only - it set's the language we use
31 dnl Automake 1.11 - Silent Build Rules
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
34 dnl Required Package Versions
35 m4_define([glib_minimum_version], [2.16.1])
36 m4_define([gtk_minimum_version], [2.14.0])
37 m4_define([gconf_minimum_version], [2.0.0]) dnl XXX Just a Guess
38 m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
39 m4_define([libsoup_minimum_version], [2.3.0])
40 m4_define([gnome_keyring_minimum_version], [2.20.1])
41 m4_define([sqlite_minimum_version], [3.5])
42 m4_define([gweather_minimum_version], [2.25.4])
43 m4_define([libical_minimum_version], [0.43])
44 m4_define([dbus_glib_minimum_version], [0.6])
46 AC_SUBST([BASE_VERSION],[base_version])
47 AC_SUBST([API_VERSION],[api_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
55 dnl ******************************
56 dnl Libtool versioning
57 dnl ******************************
58 LIBEDATASERVER_CURRENT=11
59 LIBEDATASERVER_REVISION=1
62 LIBEDATASERVERUI_CURRENT=9
63 LIBEDATASERVERUI_REVISION=1
64 LIBEDATASERVERUI_AGE=1
71 LIBEDATACAL_REVISION=2
74 LIBEDATABOOK_CURRENT=6
75 LIBEDATABOOK_REVISION=1
82 LIBEGROUPWISE_CURRENT=13
83 LIBEGROUPWISE_REVISION=1
90 LIBEXCHANGE_STORAGE_CURRENT=3
91 LIBEXCHANGE_STORAGE_REVISION=0
92 LIBEXCHANGE_STORAGE_AGE=0
98 LIBGDATA_GOOGLE_CURRENT=1
99 LIBGDATA_GOOGLE_REVISION=0
100 LIBGDATA_GOOGLE_AGE=0
102 LIBEBACKEND_CURRENT=0
103 LIBEBACKEND_REVISION=1
106 AC_SUBST(EDS_MAJOR_VERSION)
107 AC_SUBST(EDS_MINOR_VERSION)
108 AC_SUBST(EDS_MICRO_VERSION)
109 AC_SUBST(LIBEDATASERVER_CURRENT)
110 AC_SUBST(LIBEDATASERVER_REVISION)
111 AC_SUBST(LIBEDATASERVER_AGE)
112 AC_SUBST(LIBEDATASERVERUI_CURRENT)
113 AC_SUBST(LIBEDATASERVERUI_REVISION)
114 AC_SUBST(LIBEDATASERVERUI_AGE)
115 AC_SUBST(LIBECAL_CURRENT)
116 AC_SUBST(LIBECAL_REVISION)
117 AC_SUBST(LIBECAL_AGE)
118 AC_SUBST(LIBEDATACAL_CURRENT)
119 AC_SUBST(LIBEDATACAL_REVISION)
120 AC_SUBST(LIBEDATACAL_AGE)
121 AC_SUBST(LIBEBOOK_CURRENT)
122 AC_SUBST(LIBEBOOK_REVISION)
123 AC_SUBST(LIBEBOOK_AGE)
124 AC_SUBST(LIBEDATABOOK_CURRENT)
125 AC_SUBST(LIBEDATABOOK_REVISION)
126 AC_SUBST(LIBEDATABOOK_AGE)
127 AC_SUBST(LIBEGROUPWISE_CURRENT)
128 AC_SUBST(LIBEGROUPWISE_REVISION)
129 AC_SUBST(LIBEGROUPWISE_AGE)
130 AC_SUBST(LIBCAMEL_CURRENT)
131 AC_SUBST(LIBCAMEL_REVISION)
132 AC_SUBST(LIBCAMEL_AGE)
133 AC_SUBST(LIBEXCHANGE_STORAGE_CURRENT)
134 AC_SUBST(LIBEXCHANGE_STORAGE_REVISION)
135 AC_SUBST(LIBEXCHANGE_STORAGE_AGE)
136 AC_SUBST(LIBGDATA_CURRENT)
137 AC_SUBST(LIBGDATA_REVISION)
138 AC_SUBST(LIBGDATA_AGE)
139 AC_SUBST(LIBGDATA_GOOGLE_CURRENT)
140 AC_SUBST(LIBGDATA_GOOGLE_REVISION)
141 AC_SUBST(LIBGDATA_GOOGLE_AGE)
142 AC_SUBST(LIBEBACKEND_CURRENT)
143 AC_SUBST(LIBEBACKEND_REVISION)
144 AC_SUBST(LIBEBACKEND_AGE)
146 dnl **************************************
147 dnl Put the ACLOCAL flags in the Makefile
148 dnl **************************************
149 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
151 dnl ******************************
152 dnl Compiler Warning Flags
153 dnl ******************************
154 AS_COMPILER_FLAGS(WARNING_FLAGS,
155 "-DG_DISABLE_DEPRECATED
156 -DPANGO_DISABLE_DEPRECATED
157 -DGDK_DISABLE_DEPRECATED
158 -DGDK_PIXBUF_DISABLE_DEPRECATED
159 -DG_DISABLE_SINGLE_INCLUDES
160 -DGTK_DISABLE_SINGLE_INCLUDES
162 -Wno-missing-field-initializers
164 -Wno-unused-parameter
165 -Wdeclaration-after-statement
166 -Werror-implicit-function-declaration
167 -Wformat-security -Winit-self
168 -Wmissing-declarations -Wmissing-include-dirs
169 -Wmissing-noreturn -Wnested-externs -Wpointer-arith
170 -Wredundant-decls -Wundef -Wwrite-strings")
171 AC_SUBST(WARNING_FLAGS)
173 dnl Other useful compiler warnings for test builds only.
174 dnl These may produce warnings we have no control over.
176 dnl -Wformat-nonliteral
177 dnl -Wmissing-format-attribute
179 CFLAGS="$CFLAGS $WARNING_FLAGS"
181 dnl ******************************
182 dnl Initialize maintainer mode
183 dnl ******************************
197 AC_MSG_ERROR([You need bison to build evolution-data-server])
201 dnl ******************************
202 dnl Test whether jw is installed
203 dnl ******************************
204 AC_PATH_PROG(JW,jw,no)
205 if test x$JW = xno; then
210 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
213 dnl ******************************
215 dnl ******************************
216 IT_PROG_INTLTOOL([0.35.5])
220 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
221 AC_SUBST(GETTEXT_PACKAGE)
222 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
224 localedir='$(prefix)/$(DATADIRNAME)/locale'
227 dnl ******************************
228 dnl Initialize libtool
229 dnl ******************************
231 LT_INIT(disable-static win32-dll)
235 dnl ******************************
237 dnl ******************************
238 AC_MSG_CHECKING([for Win32])
242 NO_UNDEFINED='-no-undefined'
243 SOCKET_LIBS='-lws2_32 -ldnsapi'
246 LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
247 AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
248 AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
255 SOFTOKN3_LIB='-lsoftokn3'
256 LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
259 AC_MSG_RESULT([$os_win32])
260 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
261 AC_SUBST(NO_UNDEFINED)
262 AC_SUBST(SOCKET_LIBS)
263 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
265 dnl **************************************
266 dnl Check for posix compatible sys/wait.h
267 dnl **************************************
270 dnl ************************************
271 dnl Check for posix compatible alloca()
272 dnl ************************************
275 dnl ******************************
276 dnl Checks for functions
277 dnl ******************************
278 AC_CHECK_FUNCS(fsync strptime strtok_r)
280 dnl ***********************************
281 dnl Check for base dependencies early.
282 dnl ***********************************
283 PKG_CHECK_MODULES(GNOME_PLATFORM,
284 [glib-2.0 >= glib_minimum_version
285 gtk+-2.0 >= gtk_minimum_version
286 gconf-2.0 >= gconf_minimum_version
287 libxml-2.0 >= libxml_minimum_version
288 libsoup-2.4 >= libsoup_minimum_version])
290 LIBICAL_REQUIRED=libical_minimum_version
291 AC_SUBST(LIBICAL_REQUIRED)
293 dnl ******************************
295 dnl ******************************
296 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
298 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
299 [AC_MSG_ERROR([No regex library found])])])
302 dnl ******************************
304 dnl ******************************
306 AS_HELP_STRING([--with-libdb=PREFIX],
307 [Prefix where libdb is installed]),
308 [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
310 DB_CFLAGS="-I$libdb_prefix/include"
311 DB_LIBS="-L$libdb_prefix/lib -ldb"
313 AC_MSG_CHECKING([Berkeley DB])
314 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
315 save_libs=$LIBS; LIBS="$DB_LIBS"
316 AC_LINK_IFELSE([AC_LANG_PROGRAM(
318 [[db_create(NULL, NULL, 0)]])],
319 [AC_MSG_RESULT([yes])],
320 [AC_MSG_ERROR([Cannot find libdb])])
326 dnl ******************************
328 dnl ******************************
332 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
333 AC_LINK_IFELSE([AC_LANG_PROGRAM(
340 cd = iconv_open ("UTF-8", "ISO-8859-1");
342 )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
344 if test $ac_cv_libiconv = yes; then
346 if test $os_win32 = yes; then
347 dnl Don't pointlessly auto-export the global symbols
348 dnl from a potentially static libiconv.a
349 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
354 AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
357 if test $have_iconv = yes; then
358 if test $ac_cv_libiconv = no; then
359 AC_CHECK_FUNCS(gnu_get_libc_version)
361 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
362 AC_RUN_IFELSE([AC_LANG_SOURCE([[
366 #ifdef HAVE_GNU_GET_LIBC_VERSION
367 #include <gnu/libc-version.h>
370 char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
371 char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
372 char *transbuf = malloc (10), *trans = transbuf;
374 size_t jp_len = strlen (jp), utf8_len = 10;
375 size_t utf8_real_len = strlen (utf8);
377 #ifdef HAVE_GNU_GET_LIBC_VERSION
378 /* glibc 2.1.2's iconv is broken in hard to test ways. */
379 if (!strcmp (gnu_get_libc_version (), "2.1.2"))
383 cd = iconv_open ("UTF-8", "ISO-2022-JP");
384 if (cd == (iconv_t) -1)
386 if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
388 if (memcmp (utf8, transbuf, utf8_real_len) != 0)
392 ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
395 if test "$have_iconv" = no; then
396 AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
400 CFLAGS="$CFLAGS -I$srcdir"
402 AC_MSG_CHECKING([preferred charset name formats for system iconv])
403 AC_RUN_IFELSE([AC_LANG_SOURCE([[
405 #include "iconv-detect.c"
407 [AC_MSG_RESULT([found])],
408 [AC_MSG_RESULT([not found])
410 *** The iconv-detect program was unable to determine the
411 *** preferred charset name formats recognized by your
412 *** iconv library. It is suggested that you install a
413 *** working iconv library such as the one found at
414 *** ftp://ftp.gnu.org/pub/gnu/libiconv
416 [if test x$os_win32 = xyes; then
417 AC_MSG_RESULT([using known win32 result])
418 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
419 echo >>iconv-detect.h
420 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
421 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
422 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
424 AC_MSG_RESULT([unknown])
426 *** We can't determine the preferred charset name formats
427 *** recognized by your iconv library. You are
428 *** cross-compiling and supposed to know what you are doing.
429 *** Please construct the iconv-detect.h file manually.
434 CFLAGS="$save_CFLAGS"
437 dnl **********************************
438 dnl Check for nl_langinfo and CODESET
439 dnl **********************************
440 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
441 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
442 [[#include <langinfo.h>]],
443 [[char *codeset = nl_langinfo (CODESET);]]
444 )],[ac_cv_langinfo_codeset=yes],[ac_cv_langinfo_codeset=no])
445 if test x$ac_cv_langinfo_codeset = xyes; then
446 AC_DEFINE(HAVE_CODESET, 1, [Have nl_langinfo (CODESET)])
448 AC_MSG_RESULT([$ac_cv_langinfo_codeset])
450 dnl *******************************************************
451 dnl Check to see if strftime supports the use of %l and %k
452 dnl *******************************************************
453 AC_MSG_CHECKING([for %l and %k support in strftime])
454 AC_RUN_IFELSE([AC_LANG_SOURCE(
455 [[ #include <stdlib.h>
458 int main(int argc, char **argv) {
464 timeinfo=localtime(&rawtime);
466 strftime(buf, 10, "%lx%k", timeinfo);
468 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
475 )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
476 AC_MSG_RESULT([$ac_cv_lkstrftime])
478 dnl ********************************************************************************
479 dnl security extension support (SSL and S/MIME)
481 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
482 dnl needed by Camel (SSL and S/MIME).
484 dnl The Evolution security extensions are only built if these libraries are found
485 dnl ********************************************************************************
489 dnl these 2 enable's are inverses of each other
491 AS_HELP_STRING([--enable-nss=@<:@yes/no/static@:>@],[Attempt to use Mozilla libnss for SSL support.]),
492 enable_nss="$enableval", enable_nss="yes")
495 AS_HELP_STRING([--enable-smime=@<:@yes/no@:>@],[Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
496 enable_smime="$enableval", enable_smime="yes")
498 AC_ARG_ENABLE(gnome-keyring,
499 AS_HELP_STRING([--enable-gnome-keyring=@<:@yes/no@:>@],[Attempt to use Gnome Keyring for storing passwords]),
500 enable_gnome_keyring="$enableval", enable_gnome_keyring="no")
502 AC_ARG_WITH(nspr-includes,
503 AS_HELP_STRING([--with-nspr-includes=PREFIX],[Location of Mozilla nspr4 includes.]),
504 with_nspr_includes="$withval")
506 AC_ARG_WITH(nspr-libs,
507 AS_HELP_STRING([--with-nspr-libs=PREFIX],[Location of Mozilla nspr4 libs.]),
508 with_nspr_libs="$withval")
510 AC_ARG_WITH(nss-includes,
511 AS_HELP_STRING([--with-nss-includes=PREFIX],[Location of Mozilla nss3 includes.]),
512 with_nss_includes="$withval")
514 AC_ARG_WITH(nss-libs,
515 AS_HELP_STRING([--with-nss-libs=PREFIX],[Location of Mozilla nss3 libs.]),
516 with_nss_libs="$withval")
518 if test "x${enable_gnome_keyring}" = "xyes"; then
519 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= gnome_keyring_minimum_version, with_gnome_keyring="yes", with_gnome_keyring="no");
520 if test "x$with_gnome_keyring" = "xyes"; then
521 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Gnome Keyring available])
522 GNOME_KEYRING_REQUIREMENT="gnome-keyring-1"
524 GNOME_KEYRING_REQUIREMENT=""
528 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
529 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
535 if test "x${check_manually}" = "xno"; then
536 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
537 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
538 for pc in $mozilla_nspr_pcs; do
539 if $PKG_CONFIG --exists $pc; then
546 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
547 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
548 for pc in $mozilla_nss_pcs; do
549 if $PKG_CONFIG --exists $pc; then
556 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
557 msg_ssl="yes (Mozilla NSS)"
558 if test "x$enable_smime" = "xyes"; then
559 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
560 msg_smime="yes (Mozilla NSS)"
562 AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
563 AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
564 MANUAL_NSPR_CFLAGS=""
575 if test "x${check_manually}" = "xyes"; then
576 have_nspr_includes="no"
577 if test "x${with_nspr_includes}" != "xno"; then
578 CPPFLAGS_save="$CPPFLAGS"
580 AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
583 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
584 AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
585 CPPFLAGS="$CPPFLAGS_save"
587 if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
588 have_nspr_includes="yes"
589 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
592 AC_MSG_CHECKING(for Mozilla nspr4 includes)
597 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
598 CFLAGS_save="$CFLAGS"
599 LDFLAGS_save="$LDFLAGS"
601 if test "$enable_nss" = "static"; then
602 if test -z "${with_nspr_libs}"; then
603 AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
604 [Please specify the path to libnspr4.a]
605 [Example: --with-nspr-libs=/usr/lib])
607 nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
610 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
613 AC_CACHE_CHECK([for Mozilla nspr libraries], ac_cv_moz_nspr_libs,
616 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
618 if test "x${with_nspr_libs}" != "x"; then
620 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
626 AC_TRY_LINK_FUNC(PR_Init, ac_cv_moz_nspr_libs="yes", ac_cv_moz_nspr_libs="no")
627 CFLAGS="$CFLAGS_save"
628 LDFLAGS="$LDFLAGS_save"
631 if test "x$ac_cv_moz_nspr_libs" != "xno"; then
633 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
635 MANUAL_NSPR_CLFAGS=""
638 AC_MSG_CHECKING(for Mozilla nspr4 libraries)
642 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
643 CPPFLAGS_save="$CPPFLAGS"
645 AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
648 if test "x${with_nspr_includes}" != "x"; then
649 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
651 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
654 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
655 [ have_nss_includes="yes" ],
656 [ have_nss_includes="no" ])
658 CPPFLAGS="$CPPFLAGS_save"
660 if test "x${have_nss_includes}" = "xyes"; then
661 have_nss_includes="yes"
662 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
664 MANUAL_NSPR_CFLAGS=""
668 AC_MSG_CHECKING(for Mozilla nss3 includes)
672 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
673 LDFLAGS_save="$LDFLAGS"
675 if test "$enable_nss" = "static"; then
676 if test -z "${with_nss_libs}"; then
677 AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
678 [Please specify the path to libnss3.a]
679 [Example: --with-nspr-libs=/usr/lib/mozilla])
681 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"
684 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
689 nsslibs="-lssl3 -lsmime3 -lnss3"
692 AC_CACHE_CHECK([for Mozilla nss libraries], ac_cv_moz_nss_libs,
695 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
696 LIBS="$nsslibs $nsprlibs"
697 AC_TRY_LINK_FUNC(NSS_Init, ac_cv_moz_nss_libs="yes", ac_cv_moz_nss_libs="no")
698 if test "$ac_cv_moz_nss_libs" = no; then
699 nsslibs="-lssl3 -lsmime3 -lnss3"
700 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
701 AC_TRY_LINK_FUNC(NSS_Init, ac_cv_moz_nss_libs="yes", ac_cv_moz_nss_libs="no")
703 LDFLAGS="$LDFLAGS_save"
706 if test "$ac_cv_moz_nss_libs" != no; then
709 if test "$enable_nss" = "static"; then
710 msg_ssl="yes (Mozilla NSS:static)"
712 msg_ssl="yes (Mozilla NSS)"
714 if test "$enable_smime" = "yes"; then
715 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
716 msg_smime="yes (Mozilla NSS)"
718 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
721 MANUAL_NSPR_CFLAGS=""
725 AC_MSG_CHECKING(for Mozilla nss libraries)
729 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
730 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
734 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
736 AC_SUBST(MANUAL_NSPR_CFLAGS)
737 AC_SUBST(MANUAL_NSPR_LIBS)
738 AC_SUBST(MANUAL_NSS_CFLAGS)
739 AC_SUBST(MANUAL_NSS_LIBS)
741 dnl ******************************
742 dnl system mail stuff
743 dnl ******************************
744 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
745 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
747 AC_MSG_CHECKING([system mail directory])
748 if test -d /var/mail -a '!' -h /var/mail ; then
749 system_mail_dir="/var/mail"
751 system_mail_dir="/var/spool/mail"
753 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
755 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
757 CAMEL_LOCK_HELPER_USER=""
758 CAMEL_LOCK_HELPER_GROUP=""
759 system_mail_perm="world writable"
762 CAMEL_LOCK_HELPER_USER=""
763 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
764 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
767 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
768 CAMEL_LOCK_HELPER_GROUP=""
769 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
772 CAMEL_LOCK_HELPER_USER=""
773 CAMEL_LOCK_HELPER_GROUP=""
774 system_mail_perm="???"
778 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
779 AC_SUBST(CAMEL_LOCK_HELPER_USER)
780 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
782 dnl ******************************
784 dnl ******************************
785 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
786 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
787 [[ #include <time.h> ]],
792 )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
793 if test $ac_cv_struct_tm_gmtoff = yes; then
794 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
796 AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
797 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
798 [[ #include <time.h> ]],
800 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
801 if test $ac_cv_var_timezone = yes; then
802 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
803 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
804 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
805 [[ #include <time.h> ]],
807 )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
808 if test $ac_cv_var_altzone = yes; then
809 AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
812 AC_MSG_ERROR([unable to find a way to determine timezone])
816 dnl ******************************
817 dnl ctime_r prototype
818 dnl ******************************
819 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
821 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
822 [[ #include <time.h> ]],
825 ctime_r (&date, buf, 100); ]]
826 )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
829 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
830 AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
833 dnl ******************************
834 dnl gethostbyname_r prototype
835 dnl ******************************
836 AC_CHECK_FUNCS(gethostbyname_r,[
837 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
839 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
841 #include "confdefs.h"
842 #include <sys/types.h>
843 #include <sys/socket.h>
844 #include <netinet/in.h>
846 #define BUFSIZE (sizeof(struct hostent)+10)
850 char buffer[BUFSIZE];
853 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
855 )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
858 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
859 AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
862 dnl ******************************
863 dnl gethostbyaddr_r prototype
864 dnl ******************************
865 AC_CHECK_FUNCS(gethostbyaddr_r,[
866 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
870 #include "confdefs.h"
871 #include <sys/types.h>
872 #include <sys/socket.h>
873 #include <netinet/in.h>
875 #define BUFSIZE (sizeof(struct hostent)+10)
879 char buffer[BUFSIZE];
882 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
883 )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
886 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
887 AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
890 dnl ******************************
891 dnl stat(v)fs location/type
892 dnl ******************************
893 AC_CHECK_HEADER([sys/statvfs.h],
894 [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
895 [[ #if HAVE_SYS_STATVFS_H
896 #include <sys/statvfs.h>
899 AC_CHECK_FUNCS(statvfs)
901 AC_CHECK_HEADER([sys/param.h],
902 [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
903 [[ #if HAVE_SYS_PARAM_H
904 #include <sys/param.h>
907 AC_CHECK_HEADER([sys/mount.h],
908 [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
909 [[ #if HAVE_SYS_MOUNT_H
910 #include <sys/mount.h>
913 AC_CHECK_FUNCS(statfs)
915 dnl ******************************
916 dnl IPv6 support and getaddrinfo calls
917 dnl ******************************
918 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
920 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
921 [[ #include "confdefs.h"
922 #include <sys/types.h>
923 #include <sys/socket.h>
924 #include <netinet/in.h>
928 [[ #ifndef NI_MAXHOST
929 #define NI_MAXHOST 1025
933 #define NI_MAXSERV 32
936 struct addrinfo hints, *res;
937 struct sockaddr_in6 sin6;
939 char host[NI_MAXHOST];
940 char serv[NI_MAXSERV];
942 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
944 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
945 )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
948 if test x"$ac_cv_have_addrinfo" = "xno" ; then
949 AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
950 if test x"$enable_ipv6" = "xyes" ; then
951 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
955 AC_ARG_ENABLE([ipv6],
956 AS_HELP_STRING([--enable-ipv6=no/yes],
957 [Enable support for resolving IPv6 addresses.]),
958 [enable_ipv6=$enableval],[enable_ipv6=yes])
959 if test x"$enable_ipv6" = "xyes"; then
961 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
962 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
963 [[ #include "confdefs.h"
964 #include <sys/types.h>
965 #include <sys/socket.h>
966 #include <netinet/in.h>
969 [[ struct addrinfo hints;
970 hints.ai_flags = AI_ADDRCONFIG;
972 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
978 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
980 dnl ******************************
982 dnl ******************************
983 AC_MSG_CHECKING([if we should build the calendar])
984 AC_ARG_ENABLE([calendar],
985 AS_HELP_STRING([--enable-calendar=yes/no],
986 [Enable the calendar components (default yes)]),
987 [enable_calendar=$enableval], [enable_calendar=yes])
989 if test "x${enable_calendar}" != "xno"; then
990 AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
992 AM_CONDITIONAL(ENABLE_CALENDAR, [test x$enable_calendar = xyes])
993 AC_MSG_RESULT([$enable_calendar])
994 msg_calendar=$enable_calendar
996 dnl **********************************
997 dnl Weather calendar backend support
998 dnl **********************************
999 AC_MSG_CHECKING([if we should build the weather calendar backend])
1000 AC_ARG_WITH([weather],
1001 [AS_HELP_STRING([--with-weather],
1002 [Build the weather calendar backend (default=yes)])],
1003 [use_gweather=$withval], [use_gweather=yes])
1004 if test "$enable_calendar" = "no"; then
1005 use_gweather="no (calendar support is disabled)"
1008 AC_MSG_RESULT([$use_gweather])
1009 if test "$use_gweather" = "yes"; then
1010 PKG_CHECK_MODULES([LIBGWEATHER], [gweather >= gweather_minimum_version],[],
1011 [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.])])
1013 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1015 dnl ******************************
1017 dnl ******************************
1018 AC_ARG_ENABLE([nntp],
1019 AS_HELP_STRING([--enable-nntp],
1020 [Build Usenet news (NNTP) backend]),
1021 [enable_nntp=$enableval],[enable_nntp=yes])
1022 if test "x$enable_nntp" = "xyes"; then
1023 AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1028 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1030 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1032 dnl ******************************
1033 dnl IMAP4rev1 code support.
1034 dnl ******************************
1035 AC_ARG_ENABLE(imap4,
1036 AS_HELP_STRING([--enable-imap4=no/yes],
1037 [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
1038 [],[enable_imap4=no])
1040 if test "x$enable_imap4" = "xyes"; then
1041 AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
1046 AM_CONDITIONAL(ENABLE_IMAP4, [test x$enable_imap4 = xyes])
1048 dnl ******************************
1049 dnl IMAPX code support.
1050 dnl ******************************
1051 AC_ARG_ENABLE(imapx,
1052 AS_HELP_STRING([--enable-imapx=no/yes],
1053 [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
1054 [],[enable_imapx=no])
1056 if test "x$enable_imapx" = "xyes"; then
1057 AC_DEFINE(ENABLE_IMAPX,1,[Really don't try this at home])
1058 AC_PATH_PROG(GPERF, gperf)
1059 if test -z "$GPERF" ; then
1060 AC_MSG_ERROR([You need gperf to compile imapx provider])
1066 AM_CONDITIONAL(ENABLE_IMAPX, [test x$enable_imapx = xyes])
1068 dnl ******************************
1070 dnl ******************************
1071 AC_ARG_ENABLE([hula],
1072 AS_HELP_STRING([--enable-hula=no/yes],
1073 [Enable support for the now-defunct Hula project]),
1074 [],[enable_hula=no])
1076 if test "x$enable_hula" = "xyes"; then
1077 AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1082 AM_CONDITIONAL(ENABLE_HULA, [test x$enable_hula = xyes])
1084 dnl ******************************
1086 dnl ******************************
1087 AC_ARG_ENABLE([dot-locking],
1088 AS_HELP_STRING([--enable-dot-locking=yes/no],
1089 [Enable support for locking mail files with dot locking]),
1090 [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1092 if test $os_win32 != yes -a "x$enable_dot_locking" = "xyes"; then
1093 AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1099 AC_ARG_ENABLE([file-locking],
1100 AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1101 [Enable support for locking mail files with file locking]),
1102 [],[enable_file_locking=fcntl])
1104 if test $os_win32 != yes -a "x$enable_file_locking" = "xfcntl"; then
1105 AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1108 if test $os_win32 != yes -a "x$enable_file_locking" = "xflock"; then
1109 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1116 dnl ******************************
1117 dnl sendmail operation
1118 dnl ******************************
1119 AC_MSG_CHECKING([for SunOS broken spool format])
1120 if test "x$host_os" = "xsunos" ; then
1121 with_broken_spool="yes"
1124 AC_ARG_WITH([broken-spool],
1125 AS_HELP_STRING([--with-broken-spool=yes/no],
1126 [Using SunOS/Solaris sendmail which has a broken spool format]),
1127 [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1129 if test "x$with_broken_spool" = "xyes"; then
1130 AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1133 AC_MSG_RESULT([$with_broken_spool])
1135 dnl ******************************
1137 dnl ******************************
1139 AS_HELP_STRING([--with-krb5=PATH],
1140 [Location of Kerberos 5 install dir]),
1141 [with_krb5="$withval"], [with_krb5="no"])
1143 AC_ARG_WITH([krb5-libs],
1144 AS_HELP_STRING([--with-krb5-libs=PATH],
1145 [Location of Kerberos 5 libraries]),
1146 [with_krb5_libs="$withval"], [with_krb5_libs="$with_krb5/lib"])
1148 AC_ARG_WITH([krb5-includes],
1149 AS_HELP_STRING([--with-krb5-includes=PATH],
1150 [Location of Kerberos 5 headers]),
1151 [with_krb5_includes="$withval"], [with_krb5_includes=""])
1153 dnl ******************************
1155 dnl ******************************
1157 if test "x${with_krb5}" != "xno"; then
1160 mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
1161 heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
1162 sunlibs="-lkrb5 -lgss"
1163 AC_CACHE_CHECK([for Kerberos 5], [ac_cv_lib_kerberos5],
1165 LIBS="$LIBS -L$with_krb5_libs $mitlibs"
1166 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1167 [ac_cv_lib_kerberos5="$mitlibs"],
1169 LIBS="$LIBS_save -L$with_krb5_libs $heimlibs"
1170 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1171 [ac_cv_lib_kerberos5="$heimlibs"],
1173 LIBS="$LIBS_save -L$with_krb5_libs $sunlibs"
1174 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1175 [ac_cv_lib_kerberos5="$sunlibs"], [ac_cv_lib_kerberos5="no"])
1180 if test "$ac_cv_lib_kerberos5" != "no"; then
1181 AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
1182 if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then
1183 AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
1184 if test -z "$with_krb5_includes"; then
1185 KRB5_CFLAGS="-I$with_krb5/include"
1187 KRB5_CFLAGS="-I$with_krb5_includes"
1189 msg_krb5="yes (MIT)"
1191 if test "$ac_cv_lib_kerberos5" = "$heimlibs"; then
1192 AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
1193 if test -z "$with_krb5_includes"; then
1194 KRB5_CFLAGS="-I$with_krb5/include/heimdal"
1196 KRB5_CFLAGS="-I$with_krb5_includes"
1198 msg_krb5="yes (Heimdal)"
1200 AC_DEFINE(HAVE_SUN_KRB5,1,[Define if you have Sun Kerberosv5])
1201 if test -z "$with_krb5_includes"; then
1202 KRB5_CFLAGS="-I$with_krb5/include/kerberosv5"
1204 KRB5_CFLAGS="-I$with_krb5_includes"
1206 msg_krb5="yes (Sun)"
1209 KRB5_LIBS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1210 AC_MSG_RESULT([msg_krb5])
1212 dnl AC_MSG_CHECKING([for Kerberos 5])
1214 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1217 AC_MSG_WARN([krb5 support disabled])
1220 AM_CONDITIONAL(ENABLE_KRB5, [test x$with_krb5 != xno])
1222 AC_CHECK_HEADER([et/com_err.h],
1223 [AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have <et/comm_err.h>])],,
1224 [[ #if HAVE_ET_COM_ERR_H
1225 #include <com_err.h>
1228 AC_CHECK_HEADER([com_err.h],
1229 [AC_DEFINE([HAVE_COM_ERR_H], 1, [Have <comm_err.h>])],,
1230 [[ #if HAVE_COM_ERR_H
1231 #include <com_err.h>
1235 AC_SUBST(KRB5_CFLAGS)
1238 dnl ******************************
1240 dnl ******************************
1243 dnl ******************************
1245 dnl ******************************
1246 AC_ARG_ENABLE([e2k-debug],
1247 AS_HELP_STRING([--enable-e2kdebug],
1249 [enable_e2kdebug=$enableval],[enable_e2kdebug="no"])
1251 if test "$enable_e2kdebug" = "yes"; then
1252 AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1255 dnl ******************************
1257 dnl ******************************
1258 if test "$os_win32" != yes; then
1260 case $with_openldap in
1265 case $with_static_ldap in
1267 msg_ldap="$with_openldap (static)"
1270 msg_ldap="$with_openldap (dynamic)"
1275 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1276 if test "$with_openldap" = no ; then
1277 EVO_SUNLDAP_CHECK(no)
1278 case $with_sunldap in
1283 case $with_static_sunldap in
1285 msg_ldap="$with_sunldap (static)"
1288 msg_ldap="$with_sunldap (dynamic)"
1295 AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1297 SAVE_CFLAGS="$CFLAGS"
1299 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1300 CFLAGS="$CFLAGS $LDAP_CFLAGS"
1301 LIBS="$LIBS $LDAP_LIBS"
1302 AC_CHECK_FUNCS(ldap_ntlm_bind)
1303 CFLAGS="$SAVE_CFLAGS"
1305 dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1308 if test "$msg_ldap" != "no" ; then
1309 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1312 dnl The user wanted to build with openldap, but his openldap did not have NTLM
1313 dnl support. Make him aware of this with a warning message at the end.
1318 dnl Win32 LDAP support
1319 LDAP_CFLAGS="-DLDAP_DEPRECATED"
1320 LDAP_LIBS="-lwldap32"
1321 AC_SUBST(LDAP_CFLAGS)
1323 AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1324 AM_CONDITIONAL(ENABLE_LDAP, true)
1325 AM_CONDITIONAL(SUNLDAP, false)
1331 DBUS_GLIB_REQUIRED=dbus_glib_minimum_version
1332 AC_SUBST(DBUS_GLIB_REQUIRED)
1334 dnl ******************************
1335 dnl GObject marshalling
1336 dnl ******************************
1339 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1340 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1341 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1343 dnl ******************************
1344 dnl Posix thread support
1345 dnl ******************************
1347 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1348 dnl GNOME_PTHREAD_CHECK
1350 dnl if test "x$PTHREAD_LIB" = "x" ; then
1351 dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1354 dnl Notice that this is a hack, and we wont be able to use this forever, but
1355 dnl at least for some time
1359 THREADS_LIBS="$PTHREAD_LIB"
1360 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1362 AC_SUBST(THREADS_LIBS)
1363 AC_SUBST(THREADS_CFLAGS)
1364 AC_DEFINE(ENABLE_THREADS,1,[Required])
1366 dnl ******************************
1368 dnl ******************************
1369 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_minimum_version)
1370 AC_SUBST(DBUS_GLIB_CFLAGS)
1371 AC_SUBST(DBUS_GLIB_LIBS)
1373 dnl ******************************
1374 dnl Utility macro to set compiler flags for a specific lib.
1375 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1376 dnl ******************************
1377 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1378 PKG_CHECK_MODULES([$1], [$2])
1379 $1_CFLAGS="[$]$1_CFLAGS $3 "
1380 $1_LIBS="[$]$1_LIBS $4 "
1383 dnl ******************************
1384 dnl libedataserver flags
1385 dnl ******************************
1386 E_DATA_SERVER_DEPS="libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1388 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
1389 AC_SUBST(E_DATA_SERVER_CFLAGS)
1390 AC_SUBST(E_DATA_SERVER_LIBS)
1392 dnl ******************************
1393 dnl libedataserverui
1394 dnl ******************************
1395 E_DATA_SERVER_UI_DEPS="gtk+-2.0 libxml-2.0 gobject-2.0 gthread-2.0 gconf-2.0 $GNOME_KEYRING_REQUIREMENT"
1397 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
1398 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1399 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1401 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0"
1403 dnl ******************************
1404 dnl libebackend flags
1405 dnl ******************************
1406 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1407 AC_SUBST(E_BACKEND_CFLAGS)
1408 AC_SUBST(E_BACKEND_LIBS)
1410 dnl ******************************
1411 dnl evolution-addressbook flags
1412 dnl ******************************
1413 EVOLUTION_ADDRESSBOOK_DEPS="libxml-2.0 dbus-glib-1 gobject-2.0 gthread-2.0 gconf-2.0"
1415 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1416 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1417 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1419 dnl ******************************
1420 dnl evolution-calendar flags
1421 dnl ******************************
1422 if test "x${enable_calendar}" = "xyes"; then
1423 EVOLUTION_CALENDAR_DEPS="libical >= libical_minimum_version libxml-2.0 dbus-glib-1 gio-2.0 gobject-2.0 gthread-2.0 gconf-2.0"
1426 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1427 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1428 dnl to differentiate between <libical/ical.h> and <ical.h>
1429 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1430 dnl libical is fixed, we have to work-around the buggy CFlags.
1432 LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1433 LIBICAL_EXTRA_LIBS=""
1434 AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1435 AC_SUBST(LIBICAL_EXTRA_LIBS)
1437 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1438 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1439 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1442 dnl ******************************
1444 dnl ******************************
1445 GDATA_DEPS="libsoup-2.4 libxml-2.0"
1446 EVO_SET_COMPILE_FLAGS(GDATA, $GDATA_DEPS)
1447 AC_SUBST(GDATA_CFLAGS)
1448 AC_SUBST(GDATA_LIBS)
1450 dnl ******************************
1452 dnl ******************************
1453 LIBSOUP_REQUIRED=libsoup_minimum_version
1454 AC_SUBST(LIBSOUP_REQUIRED)
1456 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1457 AC_SUBST(SOUP_CFLAGS)
1460 dnl ******************************
1462 dnl ******************************
1463 SQLITE_REQUIRED=sqlite_minimum_version
1464 AC_SUBST(SQLITE_REQUIRED)
1467 dnl deflateInit is a #define, use deflateEnd instead
1468 AC_CHECK_LIB(z, deflateEnd,
1469 [AC_CHECK_HEADER(zlib.h, zlib_found=true)])
1470 if test "x$zlib_found" = "xfalse"; then
1471 AC_MSG_ERROR([*** zlib is required])
1474 dnl ******************************
1475 dnl Checks for large file support
1476 dnl ******************************
1477 AC_ARG_ENABLE([largefile],
1478 AS_HELP_STRING([--enable-largefile],
1479 [enable support for large files [[default=no]]]),
1480 [],[enable_largefile="no"])
1482 if test "x$enable_largefile" != "xno"; then
1484 AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1485 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1486 [[ #include <sys/types.h>
1487 #include <sys/stat.h>
1490 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]]
1491 )],[ac_cv_largefile64_source="no"],
1492 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1493 [[ #define _LARGEFILE64_SOURCE
1494 #include <sys/types.h>
1495 #include <sys/stat.h>
1498 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1499 [ac_cv_largefile64_source="unknown"])])
1502 enable_largefile="no"
1504 if test "x$ac_cv_largefile64_source" = "xyes"; then
1505 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1506 enable_largefile="yes"
1507 elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1508 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1511 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1512 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1513 enable_largefile="yes"
1516 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1517 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1518 enable_largefile="yes"
1521 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1525 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1527 EVO_SET_COMPILE_FLAGS(CAMEL, $mozilla_nss gio-2.0 sqlite3 >= sqlite_minimum_version gthread-2.0, $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS, -lz $THREADS_LIBS $KRB4_LIBS $KRB5_LIBS $MANUAL_NSS_LIBS)
1528 AC_SUBST(CAMEL_CFLAGS)
1529 AC_SUBST(CAMEL_LIBS)
1530 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1531 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1533 dnl ******************************
1534 dnl Special directories
1535 dnl ******************************
1537 dnl If you add something here, consider whether or not you also
1538 dnl need to add it to one or more .pc.in files (for Connector,
1541 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1542 AC_SUBST(privdatadir)
1544 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1545 AC_SUBST(privincludedir)
1547 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1548 AC_SUBST(privlibdir)
1550 imagesdir='${datadir}'/pixmaps/evolution-data-server
1553 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1554 AC_SUBST(extensiondir)
1556 uidir="$privdatadir/ui"
1559 if test $use_gweather = yes; then
1560 weatherdatadir="$privdatadir/weather"
1561 AC_SUBST(weatherdatadir)
1564 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1565 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
1566 AC_SUBST(camel_providerdir)
1568 dnl ******************************
1569 dnl IDL/Component Versioning
1570 dnl ******************************
1571 INTERFACE_VERSION="$BASE_VERSION"
1572 AC_SUBST(INTERFACE_VERSION)
1573 AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)])
1575 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)|" $< > $@'
1576 EVO_NAME_SERVER_RULE='%_$(API_VERSION).server: %.server ; mv $< $@'
1577 AC_SUBST(EVO_SUBST_SERVER_RULE)
1578 AC_SUBST(EVO_NAME_SERVER_RULE)
1580 dnl *******************
1581 dnl D-BUS service stuff
1582 dnl *******************
1583 EVO_SUBST_SERVICE_RULE='%.service: %.service.in Makefile ; sed -e "s|\@BINDIR\@|$(bindir)|" -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@COMPONENTDIR\@|$(componentdir)|" -e "s|\@IMPORTERSDIR\@|$(importersdir)|" -e "s|\@VERSION\@|$(BASE_VERSION)|" -e "s|\@INTERFACE_VERSION\@|$(INTERFACE_VERSION)|" $< > $@'
1584 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1586 dnl ******************************
1588 dnl ******************************
1589 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1592 dnl ******************************
1594 dnl ******************************
1597 dnl ******************************
1599 dnl ******************************
1601 export privincludedir
1606 evolution-data-server-zip
1607 evolution-data-server.pc
1608 addressbook/Makefile
1609 addressbook/libebook/Makefile
1610 addressbook/libebook/libebook.pc
1611 addressbook/libedata-book/Makefile
1612 addressbook/libedata-book/libedata-book.pc
1613 addressbook/backends/Makefile
1614 addressbook/backends/file/Makefile
1615 addressbook/backends/vcf/Makefile
1616 addressbook/backends/ldap/Makefile
1617 addressbook/backends/google/Makefile
1618 addressbook/backends/groupwise/Makefile
1619 addressbook/backends/webdav/Makefile
1620 addressbook/tests/Makefile
1621 addressbook/tests/ebook/Makefile
1622 addressbook/tests/vcard/Makefile
1625 calendar/libecal/Makefile
1626 calendar/libecal/libecal.pc
1627 calendar/libedata-cal/Makefile
1628 calendar/libedata-cal/libedata-cal.pc
1629 calendar/backends/Makefile
1630 calendar/backends/caldav/Makefile
1631 calendar/backends/file/Makefile
1632 calendar/backends/groupwise/Makefile
1633 calendar/backends/http/Makefile
1634 calendar/backends/contacts/Makefile
1635 calendar/backends/weather/Makefile
1636 calendar/backends/google/Makefile
1637 calendar/tests/Makefile
1638 calendar/tests/ecal/Makefile
1640 camel/providers/Makefile
1641 camel/providers/groupwise/Makefile
1642 camel/providers/hula/Makefile
1643 camel/providers/imap/Makefile
1644 camel/providers/imapx/Makefile
1645 camel/providers/imap4/Makefile
1646 camel/providers/local/Makefile
1647 camel/providers/nntp/Makefile
1648 camel/providers/pop3/Makefile
1649 camel/providers/sendmail/Makefile
1650 camel/providers/smtp/Makefile
1651 camel/tests/Makefile
1652 camel/tests/folder/Makefile
1653 camel/tests/lib/Makefile
1654 camel/tests/message/Makefile
1655 camel/tests/mime-filter/Makefile
1656 camel/tests/misc/Makefile
1657 camel/tests/smime/Makefile
1658 camel/tests/stream/Makefile
1660 camel/camel-provider.pc
1661 libebackend/Makefile
1662 libebackend/libebackend.pc
1663 libedataserver/Makefile
1664 libedataserver/eds-version.h
1665 libedataserver/libedataserver.pc
1666 libedataserverui/Makefile
1667 libedataserverui/libedataserverui.pc
1669 servers/groupwise/Makefile
1670 servers/groupwise/libegroupwise.pc
1671 servers/exchange/Makefile
1672 servers/exchange/xntlm/Makefile
1673 servers/exchange/lib/Makefile
1674 servers/exchange/storage/Makefile
1675 servers/exchange/storage/libexchange-storage.pc
1676 servers/google/Makefile
1677 servers/google/libgdata/Makefile
1678 servers/google/libgdata/libgdata.pc
1679 servers/google/libgdata-google/Makefile
1680 servers/google/libgdata-google/libgdata-google.pc
1683 docs/reference/Makefile
1684 docs/reference/addressbook/Makefile
1685 docs/reference/addressbook/libebook/Makefile
1686 docs/reference/addressbook/libedata-book/Makefile
1687 docs/reference/calendar/Makefile
1688 docs/reference/calendar/libecal/Makefile
1689 docs/reference/calendar/libedata-cal/Makefile
1690 docs/reference/camel/Makefile
1691 docs/reference/libedataserver/Makefile
1692 docs/reference/libedataserverui/Makefile
1693 docs/reference/libebackend/Makefile
1699 evolution-data-server has been configured as follows:
1700 Calendar: $msg_calendar
1701 Weather calendar: $use_gweather
1702 Mail Directory: $system_mail_dir, $system_mail_perm
1703 LDAP support: $msg_ldap
1704 NNTP support: $msg_nntp
1705 Kerberos 5: $msg_krb5
1706 Gnome Keyring: $enable_gnome_keyring/$with_gnome_keyring
1707 SSL support: $msg_ssl
1708 SMIME support: $msg_smime
1709 IPv6 support: $msg_ipv6
1710 Exchange support: $msg_exchange
1711 Dot Locking: $msg_dot
1712 File Locking: $msg_file
1713 Large files: $enable_largefile
1714 Gtk Doc: $enable_gtk_doc
1716 if test "$msg_hula" = "yes"; then
1717 echo "Hula support: $msg_hula"
1720 if test "$msg_imapx" = "yes"; then
1722 IMAPX support: $msg_imapx
1726 if test "$msg_no_ntlm" != "no" ; then
1729 No NTLM support in OpenLDAP; Plaintext password authentication will be
1730 used when connecting to the Exchange Global Catalog server. Consider
1731 installing the evo-openldap package, or building OpenLDAP with the
1732 patch in servers/exchange/docs/openldap-ntlm.diff