Remove calendar/idl
[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 dnl these 2 enable's are inverses of each other
490 AC_ARG_ENABLE(nss,
491   AS_HELP_STRING([--enable-nss=@<:@yes/no/static@:>@],[Attempt to use Mozilla libnss for SSL support.]),
492   enable_nss="$enableval", enable_nss="yes")
493
494 AC_ARG_ENABLE(smime,
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")
497
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")
501
502 AC_ARG_WITH(nspr-includes,
503   AS_HELP_STRING([--with-nspr-includes=PREFIX],[Location of Mozilla nspr4 includes.]),
504   with_nspr_includes="$withval")
505
506 AC_ARG_WITH(nspr-libs,
507   AS_HELP_STRING([--with-nspr-libs=PREFIX],[Location of Mozilla nspr4 libs.]),
508   with_nspr_libs="$withval")
509
510 AC_ARG_WITH(nss-includes,
511   AS_HELP_STRING([--with-nss-includes=PREFIX],[Location of Mozilla nss3 includes.]),
512   with_nss_includes="$withval")
513
514 AC_ARG_WITH(nss-libs,
515   AS_HELP_STRING([--with-nss-libs=PREFIX],[Location of Mozilla nss3 libs.]),
516   with_nss_libs="$withval")
517
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"
523         else
524                 GNOME_KEYRING_REQUIREMENT=""
525         fi
526 fi
527
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
530                 check_manually="yes"
531         else
532                 check_manually="no"
533         fi
534
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
540                                 AC_MSG_RESULT($pc)
541                                 mozilla_nspr=$pc
542                                 break;
543                         fi
544                 done
545
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
550                                 AC_MSG_RESULT($pc)
551                                 mozilla_nss=$pc
552                                 break;
553                         fi
554                 done
555
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)"
561                         fi
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=""
565                         MANUAL_NSPR_LIBS=""
566                         MANUAL_NSS_CFLAGS=""
567                         MANUAL_NSS_LIBS=""
568                 else
569                         check_manually="yes"
570                         mozilla_nspr=""
571                         mozilla_nss=""
572                 fi
573         fi
574
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"
579
580                         AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
581                         AC_MSG_RESULT("")
582
583                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
584                         AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
585                         CPPFLAGS="$CPPFLAGS_save"
586
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"
590                         fi
591                 else
592                         AC_MSG_CHECKING(for Mozilla nspr4 includes)
593                         AC_MSG_RESULT(no)
594                 fi
595
596                 have_nspr_libs="no"
597                 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
598                         CFLAGS_save="$CFLAGS"
599                         LDFLAGS_save="$LDFLAGS"
600
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])
606                                 else
607                                         nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
608                                 fi
609                         else
610                                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
611                         fi
612
613                         AC_CACHE_CHECK([for Mozilla nspr libraries], ac_cv_moz_nspr_libs,
614                         [
615                                 LIBS_save="$LIBS"
616                                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
617
618                                 if test "x${with_nspr_libs}" != "x"; then
619                                         LIBS="$nsprlibs"
620                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
621                                 else
622                                         LIBS="$nsprlibs"
623                                         LDFLAGS="$LDFLAGS"
624                                 fi
625
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"
629                                 LIBS="$LIBS_save"
630                         ])
631                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
632                                 have_nspr_libs="yes"
633                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
634                         else
635                                 MANUAL_NSPR_CLFAGS=""
636                         fi
637                 else
638                         AC_MSG_CHECKING(for Mozilla nspr4 libraries)
639                         AC_MSG_RESULT(no)
640                 fi
641
642                 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
643                         CPPFLAGS_save="$CPPFLAGS"
644
645                         AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
646                         AC_MSG_RESULT("")
647
648                         if test "x${with_nspr_includes}" != "x"; then
649                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
650                         else
651                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
652                         fi
653
654                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
655                                 [ have_nss_includes="yes" ],
656                                 [ have_nss_includes="no" ])
657
658                         CPPFLAGS="$CPPFLAGS_save"
659
660                         if test "x${have_nss_includes}" = "xyes"; then
661                                 have_nss_includes="yes"
662                                 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
663                         else
664                                 MANUAL_NSPR_CFLAGS=""
665                                 MANUAL_NSPR_LIBS=""
666                         fi
667                 else
668                         AC_MSG_CHECKING(for Mozilla nss3 includes)
669                         AC_MSG_RESULT(no)
670                 fi
671
672                 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
673                         LDFLAGS_save="$LDFLAGS"
674
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])
680                                 else
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"
682                                         case "$host" in
683                                                 *solaris*)
684                                                 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
685                                         ;;
686                                         esac
687                                 fi
688                         else
689                                 nsslibs="-lssl3 -lsmime3 -lnss3"
690                         fi
691
692                         AC_CACHE_CHECK([for Mozilla nss libraries], ac_cv_moz_nss_libs,
693                         [
694                                 LIBS_save="$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")
702                                 fi
703                                 LDFLAGS="$LDFLAGS_save"
704                                 LIBS="$LIBS_save"
705                         ])
706                         if test "$ac_cv_moz_nss_libs" != no; then
707                                 AC_DEFINE(HAVE_NSS)
708                                 AC_DEFINE(HAVE_SSL)
709                                 if test "$enable_nss" = "static"; then
710                                         msg_ssl="yes (Mozilla NSS:static)"
711                                 else
712                                         msg_ssl="yes (Mozilla NSS)"
713                                 fi # static_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)"
717                                 fi
718                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
719                         else
720                                 MANUAL_NSS_CFLAGS=""
721                                 MANUAL_NSPR_CFLAGS=""
722                                 MANUAL_NSPR_LIBS=""
723                         fi
724                 else
725                         AC_MSG_CHECKING(for Mozilla nss libraries)
726                         AC_MSG_RESULT(no)
727                 fi
728
729                 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
730                 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
731         fi
732 fi
733
734 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
735
736 AC_SUBST(MANUAL_NSPR_CFLAGS)
737 AC_SUBST(MANUAL_NSPR_LIBS)
738 AC_SUBST(MANUAL_NSS_CFLAGS)
739 AC_SUBST(MANUAL_NSS_LIBS)
740
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])
746
747 AC_MSG_CHECKING([system mail directory])
748 if test -d /var/mail -a '!' -h /var/mail ; then
749         system_mail_dir="/var/mail"
750 else
751         system_mail_dir="/var/spool/mail"
752 fi
753 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
754
755 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
756         d??????rw?)
757                 CAMEL_LOCK_HELPER_USER=""
758                 CAMEL_LOCK_HELPER_GROUP=""
759                 system_mail_perm="world writable"
760         ;;
761         d???rw????)
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"
765         ;;
766         drw???????)
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"
770         ;;
771         *)
772                 CAMEL_LOCK_HELPER_USER=""
773                 CAMEL_LOCK_HELPER_GROUP=""
774                 system_mail_perm="???"
775         ;;
776 esac
777
778 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
779 AC_SUBST(CAMEL_LOCK_HELPER_USER)
780 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
781
782 dnl ******************************
783 dnl Timezone checks
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>       ]],
788         [[
789                 struct tm tm;
790                 tm.tm_gmtoff = 1;
791         ]]
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])
795 else
796         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
797                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
798                 [[      #include <time.h> ]],
799                 [[      timezone = 1;   ]]
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>       ]],
806                         [[      altzone = 1; ]]
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])
810                 fi
811         else
812                 AC_MSG_ERROR([unable to find a way to determine timezone])
813         fi
814 fi
815
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],
820 [
821         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
822         [[      #include <time.h> ]],
823         [[      char *buf;
824                 time_t date;
825                 ctime_r (&date, buf, 100); ]]
826         )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
827 ])
828
829 if test x"$ac_cv_ctime_r_three_args" = xyes ; then
830         AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
831 fi
832
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],
838 [
839         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
840         [[
841                 #include "confdefs.h"
842                 #include <sys/types.h>
843                 #include <sys/socket.h>
844                 #include <netinet/in.h>
845                 #include <netdb.h>
846                 #define BUFSIZE (sizeof(struct hostent)+10)
847         ]],
848         [[
849                 struct hostent hent;
850                 char buffer[BUFSIZE];
851                 int bufsize=BUFSIZE;
852                 int h_errno;
853                 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
854         ]]
855         )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
856 ])])
857
858 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
859         AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
860 fi
861
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],
867 [
868         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
869         [[
870                 #include "confdefs.h"
871                 #include <sys/types.h>
872                 #include <sys/socket.h>
873                 #include <netinet/in.h>
874                 #include <netdb.h>
875                 #define BUFSIZE (sizeof(struct hostent)+10)
876         ]],
877         [[
878                 struct hostent hent;
879                 char buffer[BUFSIZE];
880                 int bufsize=BUFSIZE;
881                 int h_errno;
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])
884 ])])
885
886 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
887         AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
888 fi
889
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>
897                 #endif
898         ]])
899 AC_CHECK_FUNCS(statvfs)
900
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>
905                 #endif
906         ]])
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>
911                 #endif
912         ]])
913 AC_CHECK_FUNCS(statfs)
914
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],
919 [
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>
925                 #include <netdb.h>
926                 #include <stddef.h>
927         ]],
928         [[      #ifndef NI_MAXHOST
929                 #define NI_MAXHOST      1025
930                 #endif
931
932                 #ifndef NI_MAXSERV
933                 #define NI_MAXSERV      32
934                 #endif
935
936                 struct addrinfo hints, *res;
937                 struct sockaddr_in6 sin6;
938                 int af = AF_INET6;
939                 char host[NI_MAXHOST];
940                 char serv[NI_MAXSERV];
941
942                 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
943                 freeaddrinfo (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])
946 ])
947
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])
952         fi
953         msg_ipv6=no
954 else
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
960                 msg_ipv6=yes
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>
967                         #include <netdb.h>
968                 ]],
969                 [[      struct addrinfo hints;
970                         hints.ai_flags = AI_ADDRCONFIG;
971                 ]]
972                 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
973         else
974                 msg_ipv6=no
975         fi
976 fi
977
978 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
979
980 dnl ******************************
981 dnl Calendar support
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])
988
989 if test "x${enable_calendar}" != "xno"; then
990         AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
991 fi
992 AM_CONDITIONAL(ENABLE_CALENDAR, [test x$enable_calendar = xyes])
993 AC_MSG_RESULT([$enable_calendar])
994 msg_calendar=$enable_calendar
995
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)"
1006 fi
1007
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.])])
1012 fi
1013 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1014
1015 dnl ******************************
1016 dnl NNTP support.
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])
1024         msg_nntp=yes
1025 else
1026         msg_nntp=no
1027 fi
1028 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1029
1030 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1031
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])
1039
1040 if test "x$enable_imap4" = "xyes"; then
1041         AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home])
1042         msg_imap4=yes
1043 else
1044         msg_imap4=no
1045 fi
1046 AM_CONDITIONAL(ENABLE_IMAP4, [test x$enable_imap4 = xyes])
1047
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])
1055
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])
1061         fi
1062         msg_imapx=yes
1063 else
1064         msg_imapx=no
1065 fi
1066 AM_CONDITIONAL(ENABLE_IMAPX, [test x$enable_imapx = xyes])
1067
1068 dnl ******************************
1069 dnl Hula support
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])
1075
1076 if test "x$enable_hula" = "xyes"; then
1077         AC_DEFINE(ENABLE_HULA,1,[Build Hula backend])
1078         msg_hula=yes
1079 else
1080         msg_hula=no
1081 fi
1082 AM_CONDITIONAL(ENABLE_HULA, [test x$enable_hula = xyes])
1083
1084 dnl ******************************
1085 dnl File locking
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])
1091
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])
1094         msg_dot=yes
1095 else
1096         msg_dot=no
1097 fi
1098
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])
1103
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])
1106         msg_file=fcntl
1107 else
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])
1110                 msg_file=flock
1111         else
1112                 msg_file=no
1113         fi
1114 fi
1115
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"
1122 fi
1123
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}])
1128
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])
1131 fi
1132
1133 AC_MSG_RESULT([$with_broken_spool])
1134
1135 dnl ******************************
1136 dnl Kerberos
1137 dnl ******************************
1138 AC_ARG_WITH([krb5],
1139         AS_HELP_STRING([--with-krb5=PATH],
1140         [Location of Kerberos 5 install dir]),
1141         [with_krb5="$withval"], [with_krb5="no"])
1142
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"])
1147
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=""])
1152
1153 dnl ******************************
1154 dnl Kerberos 5
1155 dnl ******************************
1156 msg_krb5="no"
1157 if test "x${with_krb5}" != "xno"; then
1158         LIBS_save="$LIBS"
1159
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],
1164         [
1165                 LIBS="$LIBS -L$with_krb5_libs $mitlibs"
1166                 AC_LINK_IFELSE([AC_LANG_CALL([], [krb5_init_context])],
1167                 [ac_cv_lib_kerberos5="$mitlibs"],
1168                 [
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"],
1172                         [
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"])
1176                         ])
1177                 ])
1178                 LIBS="$LIBS_save"
1179         ])
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"
1186                         else
1187                                 KRB5_CFLAGS="-I$with_krb5_includes"
1188                         fi
1189                         msg_krb5="yes (MIT)"
1190                 else
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"
1195                                 else
1196                                         KRB5_CFLAGS="-I$with_krb5_includes"
1197                                 fi
1198                                 msg_krb5="yes (Heimdal)"
1199                         else
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"
1203                                 else
1204                                         KRB5_CFLAGS="-I$with_krb5_includes"
1205                                 fi
1206                                 msg_krb5="yes (Sun)"
1207                         fi
1208                 fi
1209                 KRB5_LIBS="-L$with_krb5_libs $ac_cv_lib_kerberos5"
1210                 AC_MSG_RESULT([msg_krb5])
1211         else
1212                 dnl AC_MSG_CHECKING([for Kerberos 5])
1213                 AC_MSG_RESULT([no])
1214                 AC_MSG_ERROR([You specified with krb5, but it was not found.])
1215         fi
1216 else
1217         AC_MSG_WARN([krb5 support disabled])
1218 fi
1219
1220 AM_CONDITIONAL(ENABLE_KRB5, [test x$with_krb5 != xno])
1221
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>
1226                 #endif
1227         ]])
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>
1232                 #endif
1233         ]])
1234
1235 AC_SUBST(KRB5_CFLAGS)
1236 AC_SUBST(KRB5_LIBS)
1237
1238 dnl ******************************
1239 dnl Purify support
1240 dnl ******************************
1241 EVO_PURIFY_SUPPORT
1242
1243 dnl ******************************
1244 dnl Exchange debug
1245 dnl ******************************
1246 AC_ARG_ENABLE([e2k-debug],
1247         AS_HELP_STRING([--enable-e2kdebug],
1248         [Allow debugging]),
1249         [enable_e2kdebug=$enableval],[enable_e2kdebug="no"])
1250
1251 if test "$enable_e2kdebug" = "yes"; then
1252         AC_DEFINE(E2K_DEBUG, 1, [Define if you want E2K_DEBUG to be available])
1253 fi
1254
1255 dnl ******************************
1256 dnl LDAP support.
1257 dnl ******************************
1258 if test "$os_win32" != yes; then
1259         EVO_LDAP_CHECK(no)
1260         case $with_openldap in
1261         no)
1262                 msg_ldap=no
1263         ;;
1264         *)
1265                 case $with_static_ldap in
1266                 yes)
1267                         msg_ldap="$with_openldap (static)"
1268                         ;;
1269                 *)
1270                         msg_ldap="$with_openldap (dynamic)"
1271                         ;;
1272                 esac
1273         esac
1274
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
1279                 no)
1280                         msg_ldap=no
1281                         ;;
1282                 *)
1283                         case $with_static_sunldap in
1284                         yes)
1285                                 msg_ldap="$with_sunldap (static)"
1286                                 ;;
1287                         *)
1288                                 msg_ldap="$with_sunldap (dynamic)"
1289                                 ;;
1290                 esac
1291         esac
1292         else
1293                 with_sunldap=no
1294         fi
1295         AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1296
1297         SAVE_CFLAGS="$CFLAGS"
1298         SAVE_LIBS="$LIBS"
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"
1304         LIBS="$SAVE_LIBS"
1305         dnl You need to enable LDAP and Kerberos to enable Exchange support in e-d-s
1306         msg_no_ntlm="no"
1307         msg_exchange="no"
1308         if test "$msg_ldap" != "no" ; then
1309                 if test "$ac_cv_func_ldap_ntlm_bind" != no ; then
1310                         msg_exchange="yes"
1311                 else
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.
1314                         msg_no_ntlm="yes"
1315                 fi
1316         fi
1317 else
1318         dnl Win32 LDAP support
1319         LDAP_CFLAGS="-DLDAP_DEPRECATED"
1320         LDAP_LIBS="-lwldap32"
1321         AC_SUBST(LDAP_CFLAGS)
1322         AC_SUBST(LDAP_LIBS)
1323         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1324         AM_CONDITIONAL(ENABLE_LDAP, true)
1325         AM_CONDITIONAL(SUNLDAP, false)
1326         msg_ldap="yes"
1327         msg_no_ntlm="no"
1328         msg_exchange="yes"
1329 fi
1330
1331 DBUS_GLIB_REQUIRED=dbus_glib_minimum_version
1332 AC_SUBST(DBUS_GLIB_REQUIRED)
1333
1334 dnl ******************************
1335 dnl GObject marshalling
1336 dnl ******************************
1337 AM_PATH_GLIB_2_0
1338
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)
1342
1343 dnl ******************************
1344 dnl Posix thread support
1345 dnl ******************************
1346
1347 dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
1348 dnl GNOME_PTHREAD_CHECK
1349
1350 dnl if test "x$PTHREAD_LIB" = "x" ; then
1351 dnl     AC_MSG_ERROR([POSIX threads are currently required for Evolution])
1352 dnl fi
1353
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
1356
1357 EVO_PTHREAD_CHECK
1358
1359 THREADS_LIBS="$PTHREAD_LIB"
1360 THREADS_CFLAGS="$PTHREAD_CFLAGS"
1361
1362 AC_SUBST(THREADS_LIBS)
1363 AC_SUBST(THREADS_CFLAGS)
1364 AC_DEFINE(ENABLE_THREADS,1,[Required])
1365
1366 dnl ******************************
1367 dnl DBus stuff
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)
1372
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 "
1381 ])
1382
1383 dnl ******************************
1384 dnl libedataserver flags
1385 dnl ******************************
1386 E_DATA_SERVER_DEPS="libxml-2.0 libsoup-2.4 gconf-2.0 $mozilla_nspr"
1387
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)
1391
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"
1396
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)
1400
1401 E_BACKEND_DEPS="gobject-2.0 libxml-2.0 gmodule-2.0"
1402
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)
1409
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"
1414
1415 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1416 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1417 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1418
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"
1424
1425 dnl *****
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.
1431 dnl *****
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)
1436
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)
1440 fi
1441
1442 dnl ******************************
1443 dnl Google flags
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)
1449
1450 dnl ******************************
1451 dnl Groupwise flags
1452 dnl ******************************
1453 LIBSOUP_REQUIRED=libsoup_minimum_version
1454 AC_SUBST(LIBSOUP_REQUIRED)
1455
1456 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1457 AC_SUBST(SOUP_CFLAGS)
1458 AC_SUBST(SOUP_LIBS)
1459
1460 dnl ******************************
1461 dnl Camel flags
1462 dnl ******************************
1463 SQLITE_REQUIRED=sqlite_minimum_version
1464 AC_SUBST(SQLITE_REQUIRED)
1465
1466 zlib_found=false
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])
1472 fi
1473
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"])
1481
1482 if test "x$enable_largefile" != "xno"; then
1483         AC_SYS_LARGEFILE
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>
1488                 #include <fcntl.h>
1489         ]],
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>
1496                         #include <fcntl.h>
1497                 ]],
1498                 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1499                 [ac_cv_largefile64_source="unknown"])])
1500         ])
1501
1502         enable_largefile="no"
1503
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])
1509         fi
1510
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"
1514         fi
1515
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"
1519         fi
1520 else
1521         AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1522         LARGEFILE_CFLAGS=""
1523 fi
1524
1525 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1526
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)
1532
1533 dnl ******************************
1534 dnl Special directories
1535 dnl ******************************
1536
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,
1539 dnl etc)
1540
1541 privdatadir='${datadir}'/evolution-data-server-$BASE_VERSION
1542 AC_SUBST(privdatadir)
1543
1544 privincludedir='${includedir}'/evolution-data-server-$BASE_VERSION
1545 AC_SUBST(privincludedir)
1546
1547 privlibdir='${libdir}'/evolution-data-server-$BASE_VERSION
1548 AC_SUBST(privlibdir)
1549
1550 imagesdir='${datadir}'/pixmaps/evolution-data-server
1551 AC_SUBST(imagesdir)
1552
1553 extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
1554 AC_SUBST(extensiondir)
1555
1556 uidir="$privdatadir/ui"
1557 AC_SUBST(uidir)
1558
1559 if test $use_gweather = yes; then
1560         weatherdatadir="$privdatadir/weather"
1561         AC_SUBST(weatherdatadir)
1562 fi
1563
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)
1567
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)])
1574
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)
1579
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)
1585
1586 dnl ******************************
1587 dnl GConf stuff
1588 dnl ******************************
1589 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
1590 AM_GCONF_SOURCE_2
1591
1592 dnl ******************************
1593 dnl Gtk Doc stuff
1594 dnl ******************************
1595 GTK_DOC_CHECK(1.9)
1596
1597 dnl ******************************
1598 dnl Makefiles
1599 dnl ******************************
1600 export privlibdir
1601 export privincludedir
1602 export privdatadir
1603
1604 AC_CONFIG_FILES([
1605 Makefile
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
1623 art/Makefile
1624 calendar/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
1639 camel/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
1659 camel/camel.pc
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
1668 servers/Makefile
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
1681 win32/Makefile
1682 docs/Makefile
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
1694 po/Makefile.in
1695 ])
1696 AC_OUTPUT
1697
1698 echo "
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
1715 "
1716 if test "$msg_hula" = "yes"; then
1717         echo "Hula support:     $msg_hula"
1718 fi
1719
1720 if test "$msg_imapx" = "yes"; then
1721         echo "
1722         IMAPX support:          $msg_imapx
1723 "
1724 fi
1725
1726 if test "$msg_no_ntlm" != "no" ; then
1727         echo ""
1728         AC_MSG_WARN([
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
1733 ])
1734 fi