Bug #597182 - Rewrite autoconf check of NSS\NSPR
[platform/upstream/evolution-data-server.git] / configure.ac
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])
5
6 m4_define([eds_version],
7         [eds_major_version.eds_minor_version.eds_micro_version])
8
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.
13 BASE_VERSION=2.30
14 m4_define([base_version], [2.30])
15
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])
19
20 dnl Autoconf / Automake Initialization
21 AC_PREREQ(2.58)
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)
27
28 dnl This is for the autoconf tests only - it set's the language we use
29 AC_LANG(C)
30
31 dnl Automake 1.11 - Silent Build Rules
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
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])
45
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)])
50
51 EDS_MAJOR_VERSION=eds_major_version
52 EDS_MINOR_VERSION=eds_minor_version
53 EDS_MICRO_VERSION=eds_micro_version
54
55 dnl ******************************
56 dnl Libtool versioning
57 dnl ******************************
58 LIBEDATASERVER_CURRENT=11
59 LIBEDATASERVER_REVISION=1
60 LIBEDATASERVER_AGE=0
61
62 LIBEDATASERVERUI_CURRENT=9
63 LIBEDATASERVERUI_REVISION=1
64 LIBEDATASERVERUI_AGE=1
65
66 LIBECAL_CURRENT=9
67 LIBECAL_REVISION=2
68 LIBECAL_AGE=2
69
70 LIBEDATACAL_CURRENT=6
71 LIBEDATACAL_REVISION=2
72 LIBEDATACAL_AGE=0
73
74 LIBEDATABOOK_CURRENT=6
75 LIBEDATABOOK_REVISION=1
76 LIBEDATABOOK_AGE=4
77
78 LIBEBOOK_CURRENT=12
79 LIBEBOOK_REVISION=1
80 LIBEBOOK_AGE=3
81
82 LIBEGROUPWISE_CURRENT=13
83 LIBEGROUPWISE_REVISION=1
84 LIBEGROUPWISE_AGE=0
85
86 LIBCAMEL_CURRENT=14
87 LIBCAMEL_REVISION=1
88 LIBCAMEL_AGE=0
89
90 LIBEXCHANGE_STORAGE_CURRENT=3
91 LIBEXCHANGE_STORAGE_REVISION=0
92 LIBEXCHANGE_STORAGE_AGE=0
93
94 LIBGDATA_CURRENT=1
95 LIBGDATA_REVISION=0
96 LIBGDATA_AGE=0
97
98 LIBGDATA_GOOGLE_CURRENT=1
99 LIBGDATA_GOOGLE_REVISION=0
100 LIBGDATA_GOOGLE_AGE=0
101
102 LIBEBACKEND_CURRENT=0
103 LIBEBACKEND_REVISION=1
104 LIBEBACKEND_AGE=0
105
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)
145
146 dnl **************************************
147 dnl Put the ACLOCAL flags in the Makefile
148 dnl **************************************
149 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
150
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
161         -Wall -Wextra
162         -Wno-missing-field-initializers
163         -Wno-sign-compare
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)
172
173 dnl Other useful compiler warnings for test builds only.
174 dnl These may produce warnings we have no control over.
175 dnl
176 dnl     -Wformat-nonliteral
177 dnl     -Wmissing-format-attribute
178 dnl     -Wshadow
179 CFLAGS="$CFLAGS $WARNING_FLAGS"
180
181 dnl ******************************
182 dnl Initialize maintainer mode
183 dnl ******************************
184 AM_MAINTAINER_MODE
185
186 AC_PROG_CC
187 AC_PROG_CPP
188 AC_C_INLINE
189 AM_PROG_CC_C_O
190 AC_PROG_INSTALL
191 AC_PROG_LN_S
192 AC_PROG_MAKE_SET
193 AM_PROG_LEX
194 AC_PROG_YACC
195 case $YACC in
196 *yacc*)
197         AC_MSG_ERROR([You need bison to build evolution-data-server])
198         ;;
199 esac
200
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
206         HAVE_JW="no"
207 else
208         HAVE_JW="yes"
209 fi
210 AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
211 AC_SUBST(HAVE_JW)
212
213 dnl ******************************
214 dnl I18N stuff
215 dnl ******************************
216 IT_PROG_INTLTOOL([0.35.5])
217
218 AM_GLIB_GNU_GETTEXT
219
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])
223
224 localedir='$(prefix)/$(DATADIRNAME)/locale'
225 AC_SUBST(localedir)
226
227 dnl ******************************
228 dnl Initialize libtool
229 dnl ******************************
230 LT_PREREQ(2.2)
231 LT_INIT(disable-static win32-dll)
232
233 PKG_PROG_PKG_CONFIG
234
235 dnl ******************************
236 dnl Check for Win32
237 dnl ******************************
238 AC_MSG_CHECKING([for Win32])
239 case "$host" in
240 *-mingw*)
241         os_win32=yes
242         NO_UNDEFINED='-no-undefined'
243         SOCKET_LIBS='-lws2_32 -ldnsapi'
244         DL_LIB=''
245         SOFTOKN3_LIB=''
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])
249         ;;
250 *)
251         os_win32=no
252         NO_UNDEFINED=''
253         SOCKET_LIBS=''
254         DL_LIB='-ldl'
255         SOFTOKN3_LIB='-lsoftokn3'
256         LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
257         ;;
258 esac
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)
264
265 dnl **************************************
266 dnl Check for posix compatible sys/wait.h
267 dnl **************************************
268 AC_HEADER_SYS_WAIT
269
270 dnl ************************************
271 dnl Check for posix compatible alloca()
272 dnl ************************************
273 AC_FUNC_ALLOCA
274
275 dnl ******************************
276 dnl Checks for functions
277 dnl ******************************
278 AC_CHECK_FUNCS(fsync strptime strtok_r)
279
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])
289
290 LIBICAL_REQUIRED=libical_minimum_version
291 AC_SUBST(LIBICAL_REQUIRED)
292
293 dnl ******************************
294 dnl regex check
295 dnl ******************************
296 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
297                         [REGEX_LIBS=-lregex
298                         AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
299                         [AC_MSG_ERROR([No regex library found])])])
300 AC_SUBST(REGEX_LIBS)
301
302 dnl ******************************
303 dnl libdb checking
304 dnl ******************************
305 AC_ARG_WITH([libdb],
306         AS_HELP_STRING([--with-libdb=PREFIX],
307         [Prefix where libdb is installed]),
308         [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
309
310 DB_CFLAGS="-I$libdb_prefix/include"
311 DB_LIBS="-L$libdb_prefix/lib -ldb"
312
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(
317         [[#include <db.h>]],
318         [[db_create(NULL, NULL, 0)]])],
319         [AC_MSG_RESULT([yes])],
320         [AC_MSG_ERROR([Cannot find libdb])])
321 CFLAGS=$save_cflags
322 LIBS=$save_libs
323 AC_SUBST(DB_CFLAGS)
324 AC_SUBST(DB_LIBS)
325
326 dnl ******************************
327 dnl iconv checking
328 dnl ******************************
329 have_iconv=no
330 save_LIBS="$LIBS"
331 LIBS="$LIBS -liconv"
332 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
333         AC_LINK_IFELSE([AC_LANG_PROGRAM(
334         [[
335                 #include <iconv.h>
336                 #include <stdlib.h>
337         ]],
338         [[
339                 iconv_t cd;
340                 cd = iconv_open ("UTF-8", "ISO-8859-1");
341         ]]
342         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
343
344 if test $ac_cv_libiconv = yes; then
345         ICONV_LIBS="-liconv"
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"
350         fi
351         have_iconv=yes
352 else
353         LIBS="$save_LIBS"
354         AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
355 fi
356
357 if test $have_iconv = yes; then
358         if test $ac_cv_libiconv = no; then
359                 AC_CHECK_FUNCS(gnu_get_libc_version)
360         fi
361 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
362         AC_RUN_IFELSE([AC_LANG_SOURCE([[
363                 #include <iconv.h>
364                 #include <stdlib.h>
365                 #include <string.h>
366                 #ifdef HAVE_GNU_GET_LIBC_VERSION
367                 #include <gnu/libc-version.h>
368                 #endif
369                 int main() {
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;
373                         iconv_t cd;
374                         size_t jp_len = strlen (jp), utf8_len = 10;
375                         size_t utf8_real_len = strlen (utf8);
376
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"))
380                                 exit (1);
381                         #endif
382
383                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
384                         if (cd == (iconv_t) -1)
385                                 exit (1);
386                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
387                                 exit (1);
388                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
389                                 exit (1);
390                         return (0);}
391                 ]])
392         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
393 fi
394
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])
397 fi
398 AC_SUBST(ICONV_LIBS)
399
400 CFLAGS="$CFLAGS -I$srcdir"
401
402 AC_MSG_CHECKING([preferred charset name formats for system iconv])
403 AC_RUN_IFELSE([AC_LANG_SOURCE([[
404         #define CONFIGURE_IN
405         #include "iconv-detect.c"
406         ]])],
407         [AC_MSG_RESULT([found])],
408         [AC_MSG_RESULT([not found])
409                 AC_MSG_WARN([
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
415         ])],
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
423         else
424                 AC_MSG_RESULT([unknown])
425                 AC_MSG_WARN([
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.
430                 ])
431         fi
432 ])
433
434 CFLAGS="$save_CFLAGS"
435 LIBS="$save_LIBS"
436
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)])
447 fi
448 AC_MSG_RESULT([$ac_cv_langinfo_codeset])
449
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>
456                 #include <string.h>
457                 #include <time.h>
458                 int main(int argc, char **argv) {
459                 char buf[10];
460                 time_t rawtime;
461                 struct tm *timeinfo;
462
463                 time(&rawtime);
464                 timeinfo=localtime(&rawtime);
465                 buf[0] = '\0';
466                 strftime(buf, 10, "%lx%k", timeinfo);
467
468                 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
469                         exit(1);
470                 else
471                         exit(0);
472                 return 0;
473                 }
474         ]]
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])
477
478 dnl ********************************************************************************
479 dnl security extension support (SSL and S/MIME)
480 dnl
481 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
482 dnl needed by Camel (SSL and S/MIME).
483 dnl
484 dnl The Evolution security extensions are only built if these libraries are found
485 dnl ********************************************************************************
486 msg_ssl="no"
487 msg_smime="no"
488
489 AC_ARG_ENABLE([ssl],
490         AS_HELP_STRING([--enable-ssl],
491         [Enable SSL support through Mozilla nss @<:@default=yes@:>@]),
492         [enable_ssl="$enableval"],[enable_ssl="yes"])
493
494 AC_ARG_ENABLE([smime],
495         AS_HELP_STRING([--enable-smime],
496         [Enable SMIME support through Mozilla nss @<:@default=yes,requires --enable-ssl@:>@ ]),
497         [enable_smime="$enableval"],[enable_smime="yes"])
498
499 AC_ARG_WITH([nspr-includes],
500         AS_HELP_STRING([--with-nspr-includes],
501         [Prefix of Mozilla nspr4 includes.]),
502         [with_nspr_includes="$withval"])
503
504 AC_ARG_WITH([nspr-libs],
505         AS_HELP_STRING([--with-nspr-libs],
506         [Prefix of Mozilla nspr4 libs.]),
507         [with_nspr_libs="$withval"])
508
509 AC_ARG_WITH([nss-includes],
510         AS_HELP_STRING([--with-nss-includes],
511         [Prefix of Mozilla nss3 includes.]),
512         [with_nss_includes="$withval"])
513
514 AC_ARG_WITH([nss-libs],
515         AS_HELP_STRING([--with-nss-libs],
516         [Prefix of Mozilla nss3 libs.]),
517         [with_nss_libs="$withval"])
518
519 if test "x${enable_ssl}" = "xyes"; then
520         if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
521                 check_manually="yes"
522         else
523                 check_manually="no"
524         fi
525
526 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
527         if test "x${check_manually}" = "xno"; then
528                 AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
529                 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
530                 for pc in $mozilla_nspr_pcs; do
531                         if $PKG_CONFIG --exists $pc; then
532                                 AC_MSG_RESULT($pc)
533                                 mozilla_nspr=$pc
534                                 break;
535                         fi
536                 done
537
538                 AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
539                 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
540                 for pc in $mozilla_nss_pcs; do
541                         if $PKG_CONFIG --exists $pc; then
542                                 AC_MSG_RESULT($pc)
543                                 mozilla_nss=$pc
544                                 break;
545                         fi
546                 done
547
548                 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
549                         msg_ssl="yes"
550                         if test "x$enable_smime" = "xyes"; then
551                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
552                                 msg_smime="yes"
553                         fi
554                         AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
555                         AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
556                         MANUAL_NSPR_CFLAGS=""
557                         MANUAL_NSPR_LIBS=""
558                         MANUAL_NSS_CFLAGS=""
559                         MANUAL_NSS_LIBS=""
560                 else
561                         check_manually="yes"
562                         mozilla_nspr=""
563                         mozilla_nss=""
564                 fi
565         fi
566
567         if test "x${check_manually}" = "xyes"; then
568         dnl ******************
569         dnl Check for NSPR 4
570         dnl ******************
571                 AC_MSG_CHECKING([for Mozilla nspr4 includes])
572                         CPPFLAGS_save="$CPPFLAGS"
573                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
574
575                         AC_CHECK_HEADERS(nspr.h prio.h,
576                         [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
577                         CPPFLAGS="$CPPFLAGS_save"
578
579                         if test "x${moz_nspr_includes}" = "xyes"; then
580                                 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
581                         else
582                                 AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
583                         fi
584                 AC_MSG_RESULT([$moz_nspr_includes])
585
586                 AC_MSG_CHECKING([for Mozilla nspr libraries])
587                         CFLAGS_save="$CFLAGS"
588                         LDFLAGS_save="$LDFLAGS"
589                         LIBS_save="$LIBS"
590                         nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
591
592                         CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
593                         LIBS="$nsprlibs"
594                         dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
595                         if test -n "${with_nspr_libs}"; then
596                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs"
597                         else
598                                 LDFLAGS="$LDFLAGS"
599                         fi
600
601                         AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
602                         [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
603
604                         CFLAGS="$CFLAGS_save"
605                         LDFLAGS="$LDFLAGS_save"
606                         LIBS="$LIBS_save"
607
608                         if test -n "${moz_nspr_libs}"; then
609                                 if test -n "${with_nspr_libs}"; then
610                                         MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
611                                 else
612                                         MANUAL_NSPR_LIBS="$nsprlibs"
613                                 fi
614                         else
615                                 AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
616                         fi
617                 AC_MSG_RESULT([$moz_nspr_libs])
618
619         dnl *****************
620         dnl Check for NSS 3
621         dnl *****************
622                 AC_MSG_CHECKING([for Mozilla nss3 includes])
623                         CPPFLAGS_save="$CPPFLAGS"
624                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
625
626                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
627                         [moz_nss_includes="yes"],[moz_nss_includes="no"])
628                         CPPFLAGS="$CPPFLAGS_save"
629
630                         if test "x${moz_nss_includes}" = "xyes"; then
631                                 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
632                         else
633                                 AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
634                         fi
635                 AC_MSG_RESULT($moz_nss_includes)
636
637                 AC_MSG_CHECKING([for Mozilla nss libraries])
638                         LDFLAGS_save="$LDFLAGS"
639                         LIBS_save="$LIBS"
640                         nsslibs="-lssl3 -lsmime3 -lnss3"
641
642                         LIBS="$nsslibs $nsprlibs"
643                         dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
644                         if test -n "${with_nss_libs}"; then
645                                 LDFLAGS="$LDFLAGS $-L$with_nss_libs"
646                         else
647                                 LDFLAGS="$LDFLAGS $LDFLAGS_NSPR"
648                         fi
649
650                         AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
651                         [moz_nss_libs="yes"],[moz_nss_libs="no"])
652                         LDFLAGS="$LDFLAGS_save"
653                         LIBS="$LIBS_save"
654
655                         if test "x${moz_nss_libs}" = "xyes"; then
656                                 AC_DEFINE(HAVE_NSS)
657                                 AC_DEFINE(HAVE_SSL)
658                                 msg_ssl="yes"
659                                 if test "x${enable_smime}" = "xyes"; then
660                                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
661                                         msg_smime="yes"
662                                 fi
663                                 if test -n "${with_nss_libs}"; then
664                                         MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
665                                 else
666                                         MANUAL_NSS_LIBS="$nsslibs"
667                                 fi
668                         else
669                                 AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
670                         fi
671                 AC_MSG_RESULT([$moz_nss_libs])
672
673                 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
674                 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
675         fi
676 fi
677
678 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
679
680 AC_SUBST(MANUAL_NSPR_CFLAGS)
681 AC_SUBST(MANUAL_NSPR_LIBS)
682 AC_SUBST(MANUAL_NSS_CFLAGS)
683 AC_SUBST(MANUAL_NSS_LIBS)
684
685 dnl ******************************
686 dnl system mail stuff
687 dnl ******************************
688 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
689 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
690
691 AC_MSG_CHECKING([system mail directory])
692 if test -d /var/mail -a '!' -h /var/mail ; then
693         system_mail_dir="/var/mail"
694 else
695         system_mail_dir="/var/spool/mail"
696 fi
697 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
698
699 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
700         d??????rw?)
701                 CAMEL_LOCK_HELPER_USER=""
702                 CAMEL_LOCK_HELPER_GROUP=""
703                 system_mail_perm="world writable"
704         ;;
705         d???rw????)
706                 CAMEL_LOCK_HELPER_USER=""
707                 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
708                 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
709         ;;
710         drw???????)
711                 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
712                 CAMEL_LOCK_HELPER_GROUP=""
713                 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
714         ;;
715         *)
716                 CAMEL_LOCK_HELPER_USER=""
717                 CAMEL_LOCK_HELPER_GROUP=""
718                 system_mail_perm="???"
719         ;;
720 esac
721
722 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
723 AC_SUBST(CAMEL_LOCK_HELPER_USER)
724 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
725
726 dnl ******************************
727 dnl Timezone checks
728 dnl ******************************
729 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
730         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
731         [[      #include <time.h>       ]],
732         [[
733                 struct tm tm;
734                 tm.tm_gmtoff = 1;
735         ]]
736         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
737 if test $ac_cv_struct_tm_gmtoff = yes; then
738         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
739 else
740         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
741                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
742                 [[      #include <time.h> ]],
743                 [[      timezone = 1;   ]]
744                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
745         if test $ac_cv_var_timezone = yes; then
746                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
747                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
748                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
749                         [[      #include <time.h>       ]],
750                         [[      altzone = 1; ]]
751                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
752                 if test $ac_cv_var_altzone = yes; then
753                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
754                 fi
755         else
756                 AC_MSG_ERROR([unable to find a way to determine timezone])
757         fi
758 fi
759
760 dnl ******************************
761 dnl ctime_r prototype
762 dnl ******************************
763 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
764 [
765         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
766         [[      #include <time.h> ]],
767         [[      char *buf;
768                 time_t date;
769                 ctime_r (&date, buf, 100); ]]
770         )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
771 ])
772
773 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
774         AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
775 fi
776
777 dnl ******************************
778 dnl gethostbyname_r prototype
779 dnl ******************************
780 AC_CHECK_FUNCS(gethostbyname_r,[
781 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
782 [
783         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
784         [[
785                 #include "confdefs.h"
786                 #include <sys/types.h>
787                 #include <sys/socket.h>
788                 #include <netinet/in.h>
789                 #include <netdb.h>
790                 #define BUFSIZE (sizeof(struct hostent)+10)
791         ]],
792         [[
793                 struct hostent hent;
794                 char buffer[BUFSIZE];
795                 int bufsize=BUFSIZE;
796                 int h_errno;
797                 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
798         ]]
799         )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
800 ])])
801
802 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
803         AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
804 fi
805
806 dnl ******************************
807 dnl gethostbyaddr_r prototype
808 dnl ******************************
809 AC_CHECK_FUNCS(gethostbyaddr_r,[
810 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
811 [
812         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
813         [[
814                 #include "confdefs.h"
815                 #include <sys/types.h>
816                 #include <sys/socket.h>
817                 #include <netinet/in.h>
818                 #include <netdb.h>
819                 #define BUFSIZE (sizeof(struct hostent)+10)
820         ]],
821         [[
822                 struct hostent hent;
823                 char buffer[BUFSIZE];
824                 int bufsize=BUFSIZE;
825                 int h_errno;
826                 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
827         )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
828 ])])
829
830 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
831         AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
832 fi
833
834 dnl ******************************
835 dnl stat(v)fs location/type
836 dnl ******************************
837 AC_CHECK_HEADER([sys/statvfs.h],
838         [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
839         [[      #if HAVE_SYS_STATVFS_H
840                 #include <sys/statvfs.h>
841                 #endif
842         ]])
843 AC_CHECK_FUNCS(statvfs)
844
845 AC_CHECK_HEADER([sys/param.h],
846         [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
847         [[      #if HAVE_SYS_PARAM_H
848                 #include <sys/param.h>
849                 #endif
850         ]])
851 AC_CHECK_HEADER([sys/mount.h],
852         [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
853         [[      #if HAVE_SYS_MOUNT_H
854                 #include <sys/mount.h>
855                 #endif
856         ]])
857 AC_CHECK_FUNCS(statfs)
858
859 dnl ******************************
860 dnl IPv6 support and getaddrinfo calls
861 dnl ******************************
862 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
863 [
864         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
865         [[      #include "confdefs.h"
866                 #include <sys/types.h>
867                 #include <sys/socket.h>
868                 #include <netinet/in.h>
869                 #include <netdb.h>
870                 #include <stddef.h>
871         ]],
872         [[      #ifndef NI_MAXHOST
873                 #define NI_MAXHOST      1025
874                 #endif
875
876                 #ifndef NI_MAXSERV
877                 #define NI_MAXSERV      32
878                 #endif
879
880                 struct addrinfo hints, *res;
881                 struct sockaddr_in6 sin6;
882                 int af = AF_INET6;
883                 char host[NI_MAXHOST];
884                 char serv[NI_MAXSERV];
885
886                 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
887                 freeaddrinfo (res);
888                 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
889         )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
890 ])
891
892 if test x"$ac_cv_have_addrinfo" = "xno" ; then
893         AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
894         if test x"$enable_ipv6" = "xyes" ; then
895                 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
896         fi
897         msg_ipv6=no
898 else
899         AC_ARG_ENABLE([ipv6],
900         AS_HELP_STRING([--enable-ipv6=no/yes],
901         [Enable support for resolving IPv6 addresses.]),
902         [enable_ipv6=$enableval],[enable_ipv6=yes])
903         if test x"$enable_ipv6" = "xyes"; then
904                 msg_ipv6=yes
905                 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
906                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
907                 [[      #include "confdefs.h"
908                         #include <sys/types.h>
909                         #include <sys/socket.h>
910                         #include <netinet/in.h>
911                         #include <netdb.h>
912                 ]],
913                 [[      struct addrinfo hints;
914                         hints.ai_flags = AI_ADDRCONFIG;
915                 ]]
916                 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
917         else
918                 msg_ipv6=no
919         fi
920 fi
921
922 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
923
924 dnl ******************************
925 dnl Calendar support
926 dnl ******************************
927 AC_MSG_CHECKING([if we should build the calendar])
928 AC_ARG_ENABLE([calendar],
929         AS_HELP_STRING([--enable-calendar=yes/no],
930         [Enable the calendar components (default yes)]),
931         [enable_calendar=$enableval], [enable_calendar=yes])
932
933 if test "x${enable_calendar}" != "xno"; then
934         AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
935 fi
936 AM_CONDITIONAL(ENABLE_CALENDAR, [test x$enable_calendar = xyes])
937 AC_MSG_RESULT([$enable_calendar])
938 msg_calendar=$enable_calendar
939
940 dnl **********************************
941 dnl Weather calendar backend support
942 dnl **********************************
943 AC_MSG_CHECKING([if we should build the weather calendar backend])
944 AC_ARG_WITH([weather],
945         [AS_HELP_STRING([--with-weather],
946         [Build the weather calendar backend (default=yes)])],
947         [use_gweather=$withval], [use_gweather=yes])
948 if test "$enable_calendar" = "no"; then
949         use_gweather="no (calendar support is disabled)"
950 fi
951
952 AC_MSG_RESULT([$use_gweather])
953 if test "$use_gweather" = "yes"; then
954         PKG_CHECK_MODULES([LIBGWEATHER], [gweather >= gweather_minimum_version],[],
955         [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.])])
956 fi
957 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
958
959 dnl ******************************
960 dnl NNTP support.
961 dnl ******************************
962 AC_ARG_ENABLE([nntp],
963         AS_HELP_STRING([--enable-nntp],
964         [Build Usenet news (NNTP) backend]),
965         [enable_nntp=$enableval],[enable_nntp=yes])
966 if test "x$enable_nntp" = "xyes"; then
967         AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
968         msg_nntp=yes
969 else
970         msg_nntp=no
971 fi
972 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
973
974 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
975
976 dnl ******************************
977 dnl IMAP4rev1 code support.
978 dnl ******************************
979 AC_ARG_ENABLE(imap4,
980         AS_HELP_STRING([--enable-imap4=no/yes],
981         [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
982         [],[enable_imap4=no])
983
984 if test "x$enable_imap4" = "xyes"; then
985         AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
986         msg_imap4=yes
987 else
988         msg_imap4=no
989 fi
990 AM_CONDITIONAL(ENABLE_IMAP4, [test x$enable_imap4 = xyes])
991
992 dnl ******************************
993 dnl IMAPX code support.
994 dnl ******************************
995 AC_ARG_ENABLE(imapx,
996         AS_HELP_STRING([--enable-imapx=no/yes],
997         [Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation]),
998         [],[enable_imapx=no])
999
1000 if test "x$enable_imapx" = "xyes"; then
1001         AC_DEFINE(ENABLE_IMAPX,1,[Really don't try this at home])
1002         AC_PATH_PROG(GPERF, gperf)
1003         if test -z "$GPERF" ; then
1004                 AC_MSG_ERROR([You need gperf to compile imapx provider])
1005         fi
1006         msg_imapx=yes
1007 else
1008         msg_imapx=no
1009 fi
1010 AM_CONDITIONAL(ENABLE_IMAPX, [test x$enable_imapx = xyes])
1011
1012 dnl ******************************
1013 dnl Hula support
1014 dnl ******************************
1015 AC_ARG_ENABLE([hula],
1016         AS_HELP_STRING([--enable-hula=no/yes],
1017         [Enable support for the now-defunct Hula project]),
1018         [],[enable_hula=no])
1019
1020 if test "x$enable_hula" = "xyes"; then
1021         AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1022         msg_hula=yes
1023 else
1024         msg_hula=no
1025 fi
1026 AM_CONDITIONAL(ENABLE_HULA, [test x$enable_hula = xyes])
1027
1028 dnl ******************************
1029 dnl File locking
1030 dnl ******************************
1031 AC_ARG_ENABLE([dot-locking],
1032         AS_HELP_STRING([--enable-dot-locking=yes/no],
1033         [Enable support for locking mail files with dot locking]),
1034         [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1035
1036 if test $os_win32 != yes -a "x$enable_dot_locking" = "xyes"; then
1037         AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1038         msg_dot=yes
1039 else
1040         msg_dot=no
1041 fi
1042
1043 AC_ARG_ENABLE([file-locking],
1044         AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1045         [Enable support for locking mail files with file locking]),
1046         [],[enable_file_locking=fcntl])
1047
1048 if test $os_win32 != yes -a "x$enable_file_locking" = "xfcntl"; then
1049         AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1050         msg_file=fcntl
1051 else
1052         if test $os_win32 != yes -a "x$enable_file_locking" = "xflock"; then
1053                 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1054                 msg_file=flock
1055         else
1056                 msg_file=no
1057         fi
1058 fi
1059
1060 dnl ******************************
1061 dnl sendmail operation
1062 dnl ******************************
1063 AC_MSG_CHECKING([for SunOS broken spool format])
1064 if test "x$host_os" = "xsunos" ; then
1065         with_broken_spool="yes"
1066 fi
1067
1068 AC_ARG_WITH([broken-spool],
1069         AS_HELP_STRING([--with-broken-spool=yes/no],
1070         [Using SunOS/Solaris sendmail which has a broken spool format]),
1071         [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1072
1073 if test "x$with_broken_spool" = "xyes"; then
1074         AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1075 fi
1076
1077 AC_MSG_RESULT([$with_broken_spool])
1078
1079 dnl ******************************
1080 dnl Kerberos
1081 dnl ******************************
1082 AC_ARG_WITH([krb5],
1083         AS_HELP_STRING([--with-krb5=PATH],
1084         [Location of Kerberos 5 install dir]),
1085         [with_krb5="$withval"], [with_krb5="no"])
1086
1087 AC_ARG_WITH([krb5-libs],
1088         AS_HELP_STRING([--with-krb5-libs=PATH],
1089         [Location of Kerberos 5 libraries]),
1090         [with_krb5_libs="$withval"], [with_krb5_libs="$with_krb5/lib"])
1091
1092 AC_ARG_WITH([krb5-includes],
1093         AS_HELP_STRING([--with-krb5-includes=PATH],
1094         [Location of Kerberos 5 headers]),
1095         [with_krb5_includes="$withval"], [with_krb5_includes=""])
1096
1097 dnl ******************************
1098 dnl Kerberos 5
1099 dnl ******************************
1100 msg_krb5="no"
1101 if test "x${with_krb5}" != "xno"; then
1102         LIBS_save="$LIBS"
1103
1104         mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
1105         heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
1106         sunlibs="-lkrb5 -lgss"
1107         AC_CACHE_CHECK([for Kerberos 5], [ac_cv_lib_kerberos5],
1108         [
1109                 LIBS="$LIBS -L$with_krb5_libs $mitlibs"
1110                 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1111                 [ac_cv_lib_kerberos5="$mitlibs"],
1112                 [
1113                         LIBS="$LIBS_save -L$with_krb5_libs $heimlibs"
1114                         AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1115                         [ac_cv_lib_kerberos5="$heimlibs"],
1116                         [
1117                                 LIBS="$LIBS_save -L$with_krb5_libs $sunlibs"
1118                                 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1119                                 [ac_cv_lib_kerberos5="$sunlibs"], [ac_cv_lib_kerberos5="no"])
1120                         ])
1121                 ])
1122                 LIBS="$LIBS_save"
1123         ])
1124         if test "$ac_cv_lib_kerberos5" != "no"; then
1125                 AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
1126                 if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then
1127                         AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
1128                         if test -z "$with_krb5_includes"; then
1129                                 KRB5_CFLAGS="-I$with_krb5/include"
1130                         else
1131                                 KRB5_CFLAGS="-I$with_krb5_includes"
1132                         fi
1133                         msg_krb5="yes (MIT)"
1134                 else
1135                         if test "$ac_cv_lib_kerberos5" = "$heimlibs"; then
1136                                 AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
1137                                 if test -z "$with_krb5_includes"; then
1138                                         KRB5_CFLAGS="-I$with_krb5/include/heimdal"
1139                                 else
1140                                         KRB5_CFLAGS="-I$with_krb5_includes"
1141                                 fi
1142                                 msg_krb5="yes (Heimdal)"
1143                         else
1144                                 AC_DEFINE(HAVE_SUN_KRB5,1,[Define if you have Sun Kerberosv5])
1145                                 if test -z "$with_krb5_includes"; then
1146                                         KRB5_CFLAGS="-I$with_krb5/include/kerberosv5"
1147                                 else
1148                                         KRB5_CFLAGS="-I$with_krb5_includes"
1149                                 fi
1150                                 msg_krb5="yes (Sun)"
1151                         fi
1152                 fi
1153                 KRB5_LIBS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1154                 AC_MSG_RESULT([msg_krb5])
1155         else
1156                 dnl AC_MSG_CHECKING([for Kerberos 5])
1157                 AC_MSG_RESULT([no])
1158                 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1159         fi
1160 else
1161         AC_MSG_WARN([krb5 support disabled])
1162 fi
1163
1164 AM_CONDITIONAL(ENABLE_KRB5, [test x$with_krb5 != xno])
1165
1166 AC_CHECK_HEADER([et/com_err.h],
1167         [AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have <et/comm_err.h>])],,
1168         [[      #if HAVE_ET_COM_ERR_H
1169                 #include <com_err.h>
1170                 #endif
1171         ]])
1172 AC_CHECK_HEADER([com_err.h],
1173         [AC_DEFINE([HAVE_COM_ERR_H], 1, [Have <comm_err.h>])],,
1174         [[      #if HAVE_COM_ERR_H
1175                 #include <com_err.h>
1176                 #endif
1177         ]])
1178
1179 AC_SUBST(KRB5_CFLAGS)
1180 AC_SUBST(KRB5_LIBS)
1181
1182 dnl ******************************
1183 dnl Purify support
1184 dnl ******************************
1185 EVO_PURIFY_SUPPORT
1186
1187 dnl ******************************
1188 dnl Exchange debug
1189 dnl ******************************
1190 AC_ARG_ENABLE([e2k-debug],
1191         AS_HELP_STRING([--enable-e2kdebug],
1192         [Allow debugging]),
1193         [enable_e2kdebug=$enableval],[enable_e2kdebug="no"])
1194
1195 if test "$enable_e2kdebug" = "yes"; then
1196         AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1197 fi
1198
1199 dnl ******************************
1200 dnl LDAP support.
1201 dnl ******************************
1202 if test "$os_win32" != yes; then
1203         EVO_LDAP_CHECK(no)
1204         case $with_openldap in
1205         no)
1206                 msg_ldap=no
1207         ;;
1208         *)
1209                 case $with_static_ldap in
1210                 yes)
1211                         msg_ldap="$with_openldap (static)"
1212                         ;;
1213                 *)
1214                         msg_ldap="$with_openldap (dynamic)"
1215                         ;;
1216                 esac
1217         esac
1218
1219 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1220         if test "$with_openldap" = no ; then
1221                 EVO_SUNLDAP_CHECK(no)
1222                 case $with_sunldap in
1223                 no)
1224                         msg_ldap=no
1225                         ;;
1226                 *)
1227                         case $with_static_sunldap in
1228                         yes)
1229                                 msg_ldap="$with_sunldap (static)"
1230                                 ;;
1231                         *)
1232                                 msg_ldap="$with_sunldap (dynamic)"
1233                                 ;;
1234                 esac
1235         esac
1236         else
1237                 with_sunldap=no
1238         fi
1239         AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1240
1241         SAVE_CFLAGS="$CFLAGS"
1242         SAVE_LIBS="$LIBS"
1243         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1244         CFLAGS="$CFLAGS $LDAP_CFLAGS"
1245         LIBS="$LIBS $LDAP_LIBS"
1246         AC_CHECK_FUNCS(ldap_ntlm_bind)
1247         CFLAGS="$SAVE_CFLAGS"
1248         LIBS="$SAVE_LIBS"
1249         dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1250         msg_no_ntlm="no"
1251         msg_exchange="no"
1252         if test "$msg_ldap" != "no" ; then
1253                 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1254                         msg_exchange="yes"
1255                 else
1256                 dnl The user wanted to build with openldap, but his openldap did not have NTLM
1257                 dnl support. Make him aware of this with a warning message at the end.
1258                         msg_no_ntlm="yes"
1259                 fi
1260         fi
1261 else
1262         dnl Win32 LDAP support
1263         LDAP_CFLAGS="-DLDAP_DEPRECATED"
1264         LDAP_LIBS="-lwldap32"
1265         AC_SUBST(LDAP_CFLAGS)
1266         AC_SUBST(LDAP_LIBS)
1267         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1268         AM_CONDITIONAL(ENABLE_LDAP, true)
1269         AM_CONDITIONAL(SUNLDAP, false)
1270         msg_ldap="yes"
1271         msg_no_ntlm="no"
1272         msg_exchange="yes"
1273 fi
1274
1275 DBUS_GLIB_REQUIRED=dbus_glib_minimum_version
1276 AC_SUBST(DBUS_GLIB_REQUIRED)
1277
1278 dnl ******************************
1279 dnl GObject marshalling
1280 dnl ******************************
1281 AM_PATH_GLIB_2_0
1282
1283 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1284 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1285 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1286
1287 dnl ******************************
1288 dnl Posix thread support
1289 dnl ******************************
1290
1291 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1292 dnl GNOME_PTHREAD_CHECK
1293
1294 dnl if test "x$PTHREAD_LIB" = "x" ; then
1295 dnl     AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1296 dnl fi
1297
1298 dnl Notice that this is a hack, and we wont be able to use this forever, but
1299 dnl at least for some time
1300
1301 EVO_PTHREAD_CHECK
1302
1303 THREADS_LIBS="$PTHREAD_LIB"
1304 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1305
1306 AC_SUBST(THREADS_LIBS)
1307 AC_SUBST(THREADS_CFLAGS)
1308 AC_DEFINE(ENABLE_THREADS,1,[Required])
1309
1310 dnl ******************************
1311 dnl DBus stuff
1312 dnl ******************************
1313 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_minimum_version)
1314 AC_SUBST(DBUS_GLIB_CFLAGS)
1315 AC_SUBST(DBUS_GLIB_LIBS)
1316
1317 dnl ***********************
1318 dnl Gnome keyring support
1319 dnl ***********************
1320 AC_ARG_ENABLE([gnome-keyring],
1321         AS_HELP_STRING([--enable-gnome-keyring],
1322         [Attempt to use Gnome Keyring for storing passwords @<:@default=yes@:>@]),
1323         [enable_gnome_keyring="$enableval"],[enable_gnome_keyring="yes"])
1324
1325 if test "x${enable_gnome_keyring}" = "xyes"; then
1326         PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= gnome_keyring_minimum_version, have_gnome_keyring="yes", have_gnome_keyring="no");
1327         if test "x${have_gnome_keyring}" = "xyes"; then
1328                 AC_DEFINE(WITH_GNOME_KEYRING, 1, [Gnome Keyring available])
1329                 GNOME_KEYRING_REQUIREMENT="gnome-keyring-1"
1330         else
1331                 AC_MSG_ERROR([gnome-keyring >= gnome_keyring_minimum_version is required for gnome keyring support. Use --disable-gnome-keyring if you want to disable gnome-keyring support.])
1332         fi
1333 fi
1334
1335 dnl ******************************
1336 dnl Utility macro to set compiler flags for a specific lib.
1337 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1338 dnl ******************************
1339 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1340         PKG_CHECK_MODULES([$1], [$2])
1341         $1_CFLAGS="[$]$1_CFLAGS $3 "
1342         $1_LIBS="[$]$1_LIBS $4 "
1343 ])
1344
1345 dnl ******************************
1346 dnl libedataserver flags
1347 dnl ******************************
1348 E_DATA_SERVER_DEPS="libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1349
1350 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
1351 AC_SUBST(E_DATA_SERVER_CFLAGS)
1352 AC_SUBST(E_DATA_SERVER_LIBS)
1353
1354 dnl ******************************
1355 dnl libedataserverui
1356 dnl ******************************
1357 E_DATA_SERVER_UI_DEPS="gtk+-2.0 libxml-2.0 gobject-2.0 gthread-2.0 gconf-2.0 $GNOME_KEYRING_REQUIREMENT"
1358
1359 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
1360 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
1361 AC_SUBST(E_DATA_SERVER_UI_LIBS)
1362
1363 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0 gconf-2.0"
1364
1365 dnl ******************************
1366 dnl libebackend flags
1367 dnl ******************************
1368 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1369 AC_SUBST(E_BACKEND_CFLAGS)
1370 AC_SUBST(E_BACKEND_LIBS)
1371
1372 dnl ******************************
1373 dnl evolution-addressbook flags
1374 dnl ******************************
1375 EVOLUTION_ADDRESSBOOK_DEPS="libxml-2.0 dbus-glib-1 gobject-2.0 gthread-2.0 gconf-2.0"
1376
1377 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1378 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1379 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1380
1381 dnl ******************************
1382 dnl evolution-calendar flags
1383 dnl ******************************
1384 if test "x${enable_calendar}" = "xyes"; then
1385         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"
1386
1387 dnl *****
1388 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1389 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1390 dnl to differentiate between <libical/ical.h> and <ical.h>
1391 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1392 dnl libical is fixed, we have to work-around the buggy CFlags.
1393 dnl *****
1394         LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1395         LIBICAL_EXTRA_LIBS=""
1396         AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1397         AC_SUBST(LIBICAL_EXTRA_LIBS)
1398
1399         EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1400         AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1401         AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1402 fi
1403
1404 dnl ******************************
1405 dnl Google flags
1406 dnl ******************************
1407 GDATA_DEPS="libsoup-2.4 libxml-2.0"
1408 EVO_SET_COMPILE_FLAGS(GDATA, $GDATA_DEPS)
1409 AC_SUBST(GDATA_CFLAGS)
1410 AC_SUBST(GDATA_LIBS)
1411
1412 dnl ******************************
1413 dnl Groupwise flags
1414 dnl ******************************
1415 LIBSOUP_REQUIRED=libsoup_minimum_version
1416 AC_SUBST(LIBSOUP_REQUIRED)
1417
1418 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1419 AC_SUBST(SOUP_CFLAGS)
1420 AC_SUBST(SOUP_LIBS)
1421
1422 dnl ******************************
1423 dnl Camel flags
1424 dnl ******************************
1425 SQLITE_REQUIRED=sqlite_minimum_version
1426 AC_SUBST(SQLITE_REQUIRED)
1427
1428 zlib_found=false
1429 dnl deflateInit is a #define, use deflateEnd instead
1430 AC_CHECK_LIB(z, deflateEnd,
1431         [AC_CHECK_HEADER(zlib.h, zlib_found=true)])
1432 if test "x$zlib_found" = "xfalse"; then
1433         AC_MSG_ERROR([*** zlib is required])
1434 fi
1435
1436 dnl ******************************
1437 dnl Checks for large file support
1438 dnl ******************************
1439 AC_ARG_ENABLE([largefile],
1440         AS_HELP_STRING([--enable-largefile],
1441         [enable support for large files [[default=no]]]),
1442         [],[enable_largefile="no"])
1443
1444 if test "x$enable_largefile" != "xno"; then
1445         AC_SYS_LARGEFILE
1446         AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1447         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1448         [[      #include <sys/types.h>
1449                         #include <sys/stat.h>
1450                 #include <fcntl.h>
1451         ]],
1452         [[      int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);  ]]
1453         )],[ac_cv_largefile64_source="no"],
1454                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1455                 [[      #define _LARGEFILE64_SOURCE
1456                         #include <sys/types.h>
1457                         #include <sys/stat.h>
1458                         #include <fcntl.h>
1459                 ]],
1460                 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1461                 [ac_cv_largefile64_source="unknown"])])
1462         ])
1463
1464         enable_largefile="no"
1465
1466         if test "x$ac_cv_largefile64_source" = "xyes"; then
1467                 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1468                 enable_largefile="yes"
1469         elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1470                 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1471         fi
1472
1473         if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1474                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1475                 enable_largefile="yes"
1476         fi
1477
1478         if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1479                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1480                 enable_largefile="yes"
1481         fi
1482 else
1483         AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1484         LARGEFILE_CFLAGS=""
1485 fi
1486
1487 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1488
1489 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)
1490 AC_SUBST(CAMEL_CFLAGS)
1491 AC_SUBST(CAMEL_LIBS)
1492 AC_SUBST(CAMEL_GROUPWISE_CFLAGS)
1493 AC_SUBST(CAMEL_GROUPWISE_LIBS)
1494
1495 dnl ******************************
1496 dnl Special directories
1497 dnl ******************************
1498
1499 dnl If you add something here, consider whether or not you also
1500 dnl need to add it to one or more .pc.in files (for Connector,
1501 dnl etc)
1502
1503 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1504 AC_SUBST(privdatadir)
1505
1506 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1507 AC_SUBST(privincludedir)
1508
1509 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1510 AC_SUBST(privlibdir)
1511
1512 imagesdir='${datadir}'/pixmaps/evolution-data-server
1513 AC_SUBST(imagesdir)
1514
1515 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1516 AC_SUBST(extensiondir)
1517
1518 uidir="$privdatadir/ui"
1519 AC_SUBST(uidir)
1520
1521 if test $use_gweather = yes; then
1522         weatherdatadir="$privdatadir/weather"
1523         AC_SUBST(weatherdatadir)
1524 fi
1525
1526 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1527 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
1528 AC_SUBST(camel_providerdir)
1529
1530 dnl ******************************
1531 dnl IDL/Component Versioning
1532 dnl ******************************
1533 INTERFACE_VERSION="$BASE_VERSION"
1534 AC_SUBST(INTERFACE_VERSION)
1535 AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)])
1536
1537 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)|" $< > $@'
1538 EVO_NAME_SERVER_RULE='%_$(API_VERSION).server: %.server ; mv $< $@'
1539 AC_SUBST(EVO_SUBST_SERVER_RULE)
1540 AC_SUBST(EVO_NAME_SERVER_RULE)
1541
1542 dnl *******************
1543 dnl D-BUS service stuff
1544 dnl *******************
1545 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)|" $< > $@'
1546 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1547
1548 dnl ******************************
1549 dnl GConf stuff
1550 dnl ******************************
1551 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1552 AM_GCONF_SOURCE_2
1553
1554 dnl ******************************
1555 dnl Gtk Doc stuff
1556 dnl ******************************
1557 GTK_DOC_CHECK(1.9)
1558
1559 dnl ******************************
1560 dnl Makefiles
1561 dnl ******************************
1562 export privlibdir
1563 export privincludedir
1564 export privdatadir
1565
1566 AC_CONFIG_FILES([
1567 Makefile
1568 evolution-data-server-zip
1569 evolution-data-server.pc
1570 addressbook/Makefile
1571 addressbook/libebook/Makefile
1572 addressbook/libebook/libebook.pc
1573 addressbook/libedata-book/Makefile
1574 addressbook/libedata-book/libedata-book.pc
1575 addressbook/backends/Makefile
1576 addressbook/backends/file/Makefile
1577 addressbook/backends/vcf/Makefile
1578 addressbook/backends/ldap/Makefile
1579 addressbook/backends/google/Makefile
1580 addressbook/backends/groupwise/Makefile
1581 addressbook/backends/webdav/Makefile
1582 addressbook/tests/Makefile
1583 addressbook/tests/ebook/Makefile
1584 addressbook/tests/vcard/Makefile
1585 art/Makefile
1586 calendar/Makefile
1587 calendar/libecal/Makefile
1588 calendar/libecal/libecal.pc
1589 calendar/libedata-cal/Makefile
1590 calendar/libedata-cal/libedata-cal.pc
1591 calendar/backends/Makefile
1592 calendar/backends/caldav/Makefile
1593 calendar/backends/file/Makefile
1594 calendar/backends/groupwise/Makefile
1595 calendar/backends/http/Makefile
1596 calendar/backends/contacts/Makefile
1597 calendar/backends/weather/Makefile
1598 calendar/backends/google/Makefile
1599 calendar/tests/Makefile
1600 calendar/tests/ecal/Makefile
1601 camel/Makefile
1602 camel/providers/Makefile
1603 camel/providers/groupwise/Makefile
1604 camel/providers/hula/Makefile
1605 camel/providers/imap/Makefile
1606 camel/providers/imapx/Makefile
1607 camel/providers/imap4/Makefile
1608 camel/providers/local/Makefile
1609 camel/providers/nntp/Makefile
1610 camel/providers/pop3/Makefile
1611 camel/providers/sendmail/Makefile
1612 camel/providers/smtp/Makefile
1613 camel/tests/Makefile
1614 camel/tests/folder/Makefile
1615 camel/tests/lib/Makefile
1616 camel/tests/message/Makefile
1617 camel/tests/mime-filter/Makefile
1618 camel/tests/misc/Makefile
1619 camel/tests/smime/Makefile
1620 camel/tests/stream/Makefile
1621 camel/camel.pc
1622 camel/camel-provider.pc
1623 libebackend/Makefile
1624 libebackend/libebackend.pc
1625 libedataserver/Makefile
1626 libedataserver/eds-version.h
1627 libedataserver/libedataserver.pc
1628 libedataserverui/Makefile
1629 libedataserverui/libedataserverui.pc
1630 servers/Makefile
1631 servers/groupwise/Makefile
1632 servers/groupwise/libegroupwise.pc
1633 servers/exchange/Makefile
1634 servers/exchange/xntlm/Makefile
1635 servers/exchange/lib/Makefile
1636 servers/exchange/storage/Makefile
1637 servers/exchange/storage/libexchange-storage.pc
1638 servers/google/Makefile
1639 servers/google/libgdata/Makefile
1640 servers/google/libgdata/libgdata.pc
1641 servers/google/libgdata-google/Makefile
1642 servers/google/libgdata-google/libgdata-google.pc
1643 win32/Makefile
1644 docs/Makefile
1645 docs/reference/Makefile
1646 docs/reference/addressbook/Makefile
1647 docs/reference/addressbook/libebook/Makefile
1648 docs/reference/addressbook/libedata-book/Makefile
1649 docs/reference/calendar/Makefile
1650 docs/reference/calendar/libecal/Makefile
1651 docs/reference/calendar/libedata-cal/Makefile
1652 docs/reference/camel/Makefile
1653 docs/reference/libedataserver/Makefile
1654 docs/reference/libedataserverui/Makefile
1655 docs/reference/libebackend/Makefile
1656 po/Makefile.in
1657 ])
1658 AC_OUTPUT
1659
1660 echo "
1661         evolution-data-server has been configured as follows:
1662         Calendar:               $msg_calendar
1663         Weather calendar:       $use_gweather
1664         Mail Directory:         $system_mail_dir, $system_mail_perm
1665         LDAP support:           $msg_ldap
1666         NNTP support:           $msg_nntp
1667         Kerberos 5:             $msg_krb5
1668         Gnome Keyring:          $enable_gnome_keyring
1669         SSL support:            $msg_ssl
1670         SMIME support:          $msg_smime
1671         IPv6 support:           $msg_ipv6
1672         Exchange support:       $msg_exchange
1673         Dot Locking:            $msg_dot
1674         File Locking:           $msg_file
1675         Large files:            $enable_largefile
1676         Gtk Doc:                $enable_gtk_doc
1677 "
1678 if test "$msg_hula" = "yes"; then
1679         echo "Hula support:     $msg_hula"
1680 fi
1681
1682 if test "$msg_imapx" = "yes"; then
1683         echo "
1684         IMAPX support:          $msg_imapx
1685 "
1686 fi
1687
1688 if test "$msg_no_ntlm" != "no" ; then
1689         echo ""
1690         AC_MSG_WARN([
1691 No NTLM support in OpenLDAP; Plaintext password authentication will be
1692 used when connecting to the Exchange Global Catalog server. Consider
1693 installing the evo-openldap package, or building OpenLDAP with the
1694 patch in servers/exchange/docs/openldap-ntlm.diff
1695 ])
1696 fi