Revert accidential commit from a761eade
[platform/upstream/evolution-data-server.git] / configure.ac
1
2 dnl Evolution-Data-Server version
3 m4_define([eds_major_version], [3])
4 m4_define([eds_minor_version], [7])
5 m4_define([eds_micro_version], [5])
6
7 m4_define([eds_version],
8         [eds_major_version.eds_minor_version.eds_micro_version])
9
10 dnl Base Version: This is for API/version tracking for things like
11 dnl Bonobo server files.  This should always be the major/minor of
12 dnl the stable version or stable version to be.  Note, this is set
13 dnl the way it is so that GETTEXT_PACKAGE will be parsed correctly.
14 BASE_VERSION=3.8
15 m4_define([base_version], [3.8])
16
17 dnl This number is meaningless, but we're now stuck with it in our
18 dnl library names for backward compatibility.
19 m4_define([api_version], [1.2])
20
21 dnl Autoconf / Automake Initialization
22 AC_PREREQ(2.62)
23 AC_INIT([evolution-data-server],[eds_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution-Data-Server])
24 AM_INIT_AUTOMAKE([gnu 1.10 tar-ustar dist-xz no-dist-gzip -Wall -Wno-portability foreign])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_SRCDIR(README)
27 AC_CONFIG_HEADERS(config.h)
28
29 dnl This is for the autoconf tests only - it set's the language we use
30 AC_LANG(C)
31
32 dnl Automake 1.11 - Silent Build Rules
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
34
35 dnl Required Package Versions
36
37 dnl Keep these two definitions in agreement.
38 m4_define([glib_minimum_version], [2.34])
39 m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
40
41 dnl Keep these two definitions in agreement.
42 m4_define([gdk_minimum_version], [3.2])
43 m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
44
45 dnl Keep these two definitions in agreement.
46 m4_define([soup_minimum_version], [2.40.3])
47 m4_define([soup_encoded_version], [SOUP_VERSION_2_40])
48
49 m4_define([gcr_minimum_version], [3.4])
50 m4_define([libsecret_minimum_version], [0.5])
51 m4_define([libxml_minimum_version], [2.0.0])            dnl XXX Just a Guess
52 m4_define([libgdata_minimum_version], [0.10])
53 m4_define([sqlite_minimum_version], [3.5])
54 m4_define([libical_minimum_version], [0.43])
55
56 dnl Optional Packages
57 m4_define([goa_minimum_version], [3.2])
58 m4_define([gweather_minimum_version], [3.5.0])
59
60 AC_SUBST([BASE_VERSION],[base_version])
61 AC_SUBST([API_VERSION],[api_version])
62 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
63 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
64
65 EDS_MAJOR_VERSION=eds_major_version
66 EDS_MINOR_VERSION=eds_minor_version
67 EDS_MICRO_VERSION=eds_micro_version
68
69 GLIB_GSETTINGS
70
71 dnl ******************************
72 dnl D-Bus versioning
73 dnl ******************************
74 ADDRESS_BOOK_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.AddressBook4"
75 CALENDAR_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Calendar3"
76 SOURCES_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.Sources1"
77 USER_PROMPTER_DBUS_SERVICE_NAME="org.gnome.evolution.dataserver.UserPrompter0"
78
79 AC_DEFINE_UNQUOTED(
80        ADDRESS_BOOK_DBUS_SERVICE_NAME,
81        ["$ADDRESS_BOOK_DBUS_SERVICE_NAME"],
82        [D-Bus service name for the address book factory])
83
84 AC_DEFINE_UNQUOTED(
85        CALENDAR_DBUS_SERVICE_NAME,
86        ["$CALENDAR_DBUS_SERVICE_NAME"],
87        [D-Bus service name for the calendar factory])
88
89 AC_DEFINE_UNQUOTED(
90         SOURCES_DBUS_SERVICE_NAME,
91         ["$SOURCES_DBUS_SERVICE_NAME"],
92         [D-Bus service name for the source registry])
93
94 AC_DEFINE_UNQUOTED(
95         USER_PROMPTER_DBUS_SERVICE_NAME,
96         ["$USER_PROMPTER_DBUS_SERVICE_NAME"],
97         [D-Bus service name for the user prompter])
98
99 AC_SUBST(ADDRESS_BOOK_DBUS_SERVICE_NAME)
100 AC_SUBST(CALENDAR_DBUS_SERVICE_NAME)
101 AC_SUBST(SOURCES_DBUS_SERVICE_NAME)
102 AC_SUBST(USER_PROMPTER_DBUS_SERVICE_NAME)
103
104 dnl ******************************
105 dnl Libtool versioning
106 dnl ******************************
107 LIBEDATASERVER_CURRENT=17
108 LIBEDATASERVER_REVISION=0
109 LIBEDATASERVER_AGE=0
110
111 LIBECAL_CURRENT=15
112 LIBECAL_REVISION=0
113 LIBECAL_AGE=0
114
115 LIBEDATACAL_CURRENT=20
116 LIBEDATACAL_REVISION=0
117 LIBEDATACAL_AGE=0
118
119 LIBEDATABOOK_CURRENT=16
120 LIBEDATABOOK_REVISION=0
121 LIBEDATABOOK_AGE=0
122
123 LIBEBOOK_CURRENT=17
124 LIBEBOOK_REVISION=1
125 LIBEBOOK_AGE=3
126
127 LIBCAMEL_CURRENT=43
128 LIBCAMEL_REVISION=0
129 LIBCAMEL_AGE=0
130
131 LIBEBACKEND_CURRENT=6
132 LIBEBACKEND_REVISION=0
133 LIBEBACKEND_AGE=0
134
135 AC_SUBST(EDS_MAJOR_VERSION)
136 AC_SUBST(EDS_MINOR_VERSION)
137 AC_SUBST(EDS_MICRO_VERSION)
138 AC_SUBST(LIBEDATASERVER_CURRENT)
139 AC_SUBST(LIBEDATASERVER_REVISION)
140 AC_SUBST(LIBEDATASERVER_AGE)
141 AC_SUBST(LIBECAL_CURRENT)
142 AC_SUBST(LIBECAL_REVISION)
143 AC_SUBST(LIBECAL_AGE)
144 AC_SUBST(LIBEDATACAL_CURRENT)
145 AC_SUBST(LIBEDATACAL_REVISION)
146 AC_SUBST(LIBEDATACAL_AGE)
147 AC_SUBST(LIBEBOOK_CURRENT)
148 AC_SUBST(LIBEBOOK_REVISION)
149 AC_SUBST(LIBEBOOK_AGE)
150 AC_SUBST(LIBEDATABOOK_CURRENT)
151 AC_SUBST(LIBEDATABOOK_REVISION)
152 AC_SUBST(LIBEDATABOOK_AGE)
153 AC_SUBST(LIBCAMEL_CURRENT)
154 AC_SUBST(LIBCAMEL_REVISION)
155 AC_SUBST(LIBCAMEL_AGE)
156 AC_SUBST(LIBEBACKEND_CURRENT)
157 AC_SUBST(LIBEBACKEND_REVISION)
158 AC_SUBST(LIBEBACKEND_AGE)
159
160 dnl **************************************
161 dnl Put the ACLOCAL flags in the Makefile
162 dnl **************************************
163 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
164
165 dnl ******************************
166 dnl Compiler Warning Flags
167 dnl ******************************
168 AS_COMPILER_FLAGS(WARNING_FLAGS,
169         "-Wall -Wextra
170         -Wdeprecated-declarations
171         -Wno-missing-field-initializers
172         -Wno-sign-compare
173         -Wno-unused-parameter
174         -Wdeclaration-after-statement
175         -Werror-implicit-function-declaration
176         -Wformat-security -Winit-self
177         -Wmissing-declarations -Wmissing-include-dirs
178         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
179         -Wredundant-decls -Wundef -Wwrite-strings")
180 AC_SUBST(WARNING_FLAGS)
181
182 dnl Other useful compiler warnings for test builds only.
183 dnl These may produce warnings we have no control over,
184 dnl or false positives we don't always want to see.
185 dnl
186 dnl     -Wformat-nonliteral
187 dnl     -Wmissing-format-attribute
188 dnl     -Wshadow
189 dnl     -Wstrict-aliasing=2
190
191 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
192
193 dnl *******************************
194 dnl Check for --enable-strict
195 dnl *******************************
196 AC_ARG_ENABLE([strict],
197         [AS_HELP_STRING([--enable-strict],
198         [enable strict building, like without deprecated symbols (default=auto); auto enables strict building only if .git subdirectory exists])],
199         [enable_strict=$enableval], [enable_strict=auto])
200
201 AC_MSG_CHECKING([if strict building is enabled])
202 if test "x$enable_strict" = xauto; then
203         dnl Be strict when compiling with .git subdirectory
204         if test -d .git ; then
205                 enable_strict=yes
206         else
207                 enable_strict=no
208         fi
209 fi
210 AC_MSG_RESULT([$enable_strict])
211
212 if test "x$enable_strict" = xyes; then
213         AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
214 fi
215
216 dnl Warn about API usage that violates our minimum requirements.
217 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
218 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
219 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
220
221 dnl These will suppress warnings about newly-deprecated symbols.  Ideally
222 dnl these settings should match our minimum requirements and we will clean
223 dnl up any new deprecation warnings after bumping our minimum requirements.
224 dnl But if the warnings get to be overwhelming, use fixed versions instead.
225 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
226 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"
227 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
228
229 AC_SUBST(AM_CPPFLAGS)
230
231 dnl ******************************
232 dnl Initialize maintainer mode
233 dnl ******************************
234 AM_MAINTAINER_MODE([enable])
235
236 if test "x$enable_maintainer_mode" = "xyes" ; then
237         AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
238 fi
239
240 AC_PROG_CC
241 AC_PROG_CPP
242 AC_C_INLINE
243 AM_PROG_CC_C_O
244 AC_PROG_INSTALL
245 AC_PROG_LN_S
246 AC_PROG_MAKE_SET
247
248 dnl For gen-western-table.py
249 AM_PATH_PYTHON
250
251 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
252 dnl behavior that -- according to the C99 standard -- is supposed to be
253 dnl undefined.  We may still have aliasing abuses lying around that rely
254 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
255 dnl optimization until we can find and fix all the abuses.
256 dnl (AC_PROG_CC must run first to set the GCC variable.)
257 dnl XXX This really belongs in AM_CFLAGS.
258 if test "x${GCC}" = "xyes"; then
259         CFLAGS="$CFLAGS -fno-strict-aliasing"
260 fi
261
262 dnl ******************************
263 dnl I18N stuff
264 dnl ******************************
265 IT_PROG_INTLTOOL([0.35.5])
266
267 GETTEXT_PACKAGE=evolution-data-server-$BASE_VERSION
268 AC_SUBST(GETTEXT_PACKAGE)
269 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
270
271 localedir='$(prefix)/$(DATADIRNAME)/locale'
272 AC_SUBST(localedir)
273
274 dnl ******************************
275 dnl libphonenumber support
276 dnl ******************************
277
278 dnl The EVO_PHONENUMBER_SUPPORT macro calls AC_PROG_CXX if libphonenumber
279 dnl support got requested. Therefore this macro must be expanded before
280 dnl the libtool macros. Feel free to move back to the other optional
281 dnl dependencies if you know how to fix the autoconf issue, or if you
282 dnl concluded that C++ actually is pretty awesome and should be a hard
283 dnl dependency.
284 EVO_PHONENUMBER_SUPPORT
285
286 dnl ******************************
287 dnl Initialize libtool
288 dnl ******************************
289 LT_PREREQ(2.2)
290 LT_INIT(disable-static win32-dll)
291
292 PKG_PROG_PKG_CONFIG
293
294 dnl This relies on $SED, which is defined in ltmain.sh, which
295 dnl is invoked by LT_INIT (at least I think that's how it works).
296 GNOME_CODE_COVERAGE
297
298 dnl ******************************
299 dnl Gtk Doc stuff
300 dnl ******************************
301 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
302
303 dnl The private D-Bus documentation is for developers only.
304 AC_ARG_WITH([private-docs],
305         AS_HELP_STRING([--with-private-docs],
306         [Build documentation for private libraries ]
307         [(requires --enable-gtk-doc) [default=no]],),
308         [with_private_docs="$withval"],[with_private_docs="no"])
309 AM_CONDITIONAL(WITH_PRIVATE_DOCS, [test x$with_private_docs = xyes])
310
311 dnl This must appear after AC_CANONICAL_HOST, which defines $host.
312 case "$host" in
313 *openbsd*|*freebsd*)
314         dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
315         ;;
316 *)
317         LDFLAGS="$LDFLAGS -Wl,--no-undefined"
318         ;;
319 esac
320
321 dnl ******************************
322 dnl Check for Win32
323 dnl ******************************
324 AC_MSG_CHECKING([for Win32])
325 case "$host" in
326 *-mingw*)
327         os_win32='yes'
328         NO_UNDEFINED='-no-undefined'
329         SOCKET_LIBS='-lws2_32 -ldnsapi'
330         DL_LIB=''
331         LIBEXECDIR_IN_SERVER_FILE='../../../libexec'
332         AC_CACHE_VAL(ac_cv_have_addrinfo, [ac_cv_have_addrinfo=yes])
333         AC_DEFINE(_WIN32_WINNT, 0x501, [To get getaddrinfo etc declarations])
334         ;;
335 *openbsd*|*freebsd*)
336         os_win32='no'
337         NO_UNDEFINED=''
338         SOCKET_LIBS=''
339         DL_LIB=''
340         LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
341         ;;
342 *)
343         os_win32='no'
344         NO_UNDEFINED=''
345         SOCKET_LIBS=''
346         DL_LIB='-ldl'
347         LIBEXECDIR_IN_SERVER_FILE="$libexecdir"
348         ;;
349 esac
350 AC_MSG_RESULT([$os_win32])
351 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
352 AC_SUBST(NO_UNDEFINED)
353 AC_SUBST(SOCKET_LIBS)
354 AC_SUBST(LIBEXECDIR_IN_SERVER_FILE)
355
356 dnl **************************************
357 dnl Check for posix compatible sys/wait.h
358 dnl **************************************
359 AC_HEADER_SYS_WAIT
360
361 dnl ************************************
362 dnl Check for posix compatible alloca()
363 dnl ************************************
364 AC_FUNC_ALLOCA
365
366 dnl ******************************
367 dnl Checks for functions
368 dnl ******************************
369 AC_CHECK_FUNCS(fsync strptime strtok_r nl_langinfo)
370
371 dnl ***********************************
372 dnl Check for base dependencies early.
373 dnl ***********************************
374 PKG_CHECK_MODULES(GNOME_PLATFORM,
375         [gio-2.0 >= glib_minimum_version
376         gmodule-2.0 >= glib_minimum_version
377         libxml-2.0 >= libxml_minimum_version
378         libsoup-2.4 >= soup_minimum_version])
379
380 if test x$os_win32 = xno; then
381         PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
382 fi
383
384 dnl *************************
385 dnl Check for GTK+
386 dnl *************************
387 AC_ARG_ENABLE([gtk],
388         [AS_HELP_STRING([--enable-gtk],
389         [enable GTK+ (default=yes)])],
390         [enable_gtk=$enableval], [enable_gtk=yes])
391 AC_MSG_CHECKING([if GTK+ support is enabled])
392 AC_MSG_RESULT([$enable_gtk])
393 if test "x$enable_gtk" = xyes; then
394         PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= gdk_minimum_version],,
395         [AC_MSG_ERROR([
396
397         gtk+-3.0 not found (or version < gdk_minimum_version)
398
399         If you want to disable GTK+ support,
400         please append --disable-gtk to configure.
401         ])])
402
403         AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
404 fi
405 AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
406
407 dnl *******************************
408 dnl Check for GNOME Online Accounts
409 dnl *******************************
410 AC_ARG_ENABLE([goa],
411         [AS_HELP_STRING([--enable-goa],
412         [enable GNOME Online Accounts support (default=yes)])],
413         [enable_goa=$enableval], [enable_goa=yes])
414 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
415 AC_MSG_RESULT([$enable_goa])
416 if test "x$enable_goa" = xyes; then
417         PKG_CHECK_MODULES([GOA], [goa-1.0 >= goa_minimum_version],,
418         [AC_MSG_ERROR([
419
420         goa-1.0 not found (or version < goa_minimum_version)
421
422         If you want to disable GNOME Online Accounts support,
423         please append --disable-goa to configure.
424         ])])
425
426         AC_DEFINE(HAVE_GOA, 1, [Define to 1 if you have the goa-1.0 package.])
427 fi
428 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
429
430 dnl GoaPasswordBased was introduced in version 3.5.
431 if `$PKG_CONFIG --atleast-version=3.5 goa-1.0`; then
432         AC_DEFINE(HAVE_GOA_PASSWORD_BASED,1,[Have GoaPasswordBased in goa-1.0])
433 fi
434
435 dnl ***********************************
436 dnl Check for GNOME Keyring.
437 dnl ***********************************
438 if test x$os_win32 = xno; then
439         PKG_CHECK_MODULES(LIBSECRET,
440                 [libsecret-unstable >= libsecret_minimum_version])
441 fi
442 AC_SUBST(LIBSECRET_CFLAGS)
443 AC_SUBST(LIBSECRET_LIBS)
444
445 dnl **********************************************************
446 dnl gcr-base is needed for secure password exchange over D-Bus
447 dnl **********************************************************
448 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
449 AC_SUBST(GCR_BASE_CFLAGS)
450 AC_SUBST(GCR_BASE_LIBS)
451
452 LIBICAL_REQUIRED=libical_minimum_version
453 AC_SUBST(LIBICAL_REQUIRED)
454
455 dnl ******************************
456 dnl regex check
457 dnl ******************************
458 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
459                         [REGEX_LIBS=-lregex
460                         AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
461                         [AC_MSG_ERROR([No regex library found])])])
462 AC_SUBST(REGEX_LIBS)
463
464 dnl ******************************
465 dnl libdb checking
466 dnl ******************************
467 AC_ARG_WITH([libdb],
468         AS_HELP_STRING([--with-libdb=PREFIX],
469         [Prefix where libdb is installed]),
470         [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
471
472 DB_CFLAGS="-I$libdb_prefix/include"
473 DB_LIBS="-L$libdb_prefix/lib -ldb"
474
475 AC_MSG_CHECKING([Berkeley DB])
476 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
477 save_libs=$LIBS; LIBS="$DB_LIBS"
478 AC_LINK_IFELSE([AC_LANG_PROGRAM(
479         [[#include <db.h>]],
480         [[db_create(NULL, NULL, 0)]])],
481         [AC_MSG_RESULT([yes])],
482         [AC_MSG_ERROR([Cannot find libdb])])
483 CFLAGS=$save_cflags
484 LIBS=$save_libs
485 AC_SUBST(DB_CFLAGS)
486 AC_SUBST(DB_LIBS)
487
488 dnl ******************************
489 dnl iconv checking
490 dnl ******************************
491 have_iconv="no"
492 save_LIBS="$LIBS"
493 LIBS="$LIBS -liconv"
494 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
495         AC_LINK_IFELSE([AC_LANG_PROGRAM(
496         [[
497                 #include <iconv.h>
498                 #include <stdlib.h>
499         ]],
500         [[
501                 iconv_t cd;
502                 cd = iconv_open ("UTF-8", "ISO-8859-1");
503         ]]
504         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
505
506 if test "x$ac_cv_libiconv" = "xyes"; then
507         ICONV_LIBS="-liconv"
508         if test "x$os_win32" = "xyes"; then
509                 dnl Don't pointlessly auto-export the global symbols
510                 dnl from a potentially static libiconv.a
511                 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
512         fi
513         have_iconv="yes"
514 else
515         LIBS="$save_LIBS"
516         AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
517 fi
518
519 if test "x$have_iconv" = "xyes"; then
520         if test "x$ac_cv_libiconv" = "xno"; then
521                 AC_CHECK_FUNCS(gnu_get_libc_version)
522         fi
523 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
524         AC_RUN_IFELSE([AC_LANG_SOURCE([[
525                 #include <iconv.h>
526                 #include <stdlib.h>
527                 #include <string.h>
528                 #ifdef HAVE_GNU_GET_LIBC_VERSION
529                 #include <gnu/libc-version.h>
530                 #endif
531                 int main() {
532                         char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
533                         char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
534                         char *transbuf = malloc (10), *trans = transbuf;
535                         iconv_t cd;
536                         size_t jp_len = strlen (jp), utf8_len = 10;
537                         size_t utf8_real_len = strlen (utf8);
538
539                         #ifdef HAVE_GNU_GET_LIBC_VERSION
540                         /* glibc 2.1.2's iconv is broken in hard to test ways. */
541                         if (!strcmp (gnu_get_libc_version (), "2.1.2"))
542                                 exit (1);
543                         #endif
544
545                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
546                         if (cd == (iconv_t) -1)
547                                 exit (1);
548                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
549                                 exit (1);
550                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
551                                 exit (1);
552                         return (0);}
553                 ]])
554         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
555 fi
556
557 if test "x$have_iconv" = "xno"; then
558         AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
559 fi
560 AC_SUBST(ICONV_LIBS)
561
562 CFLAGS="$CFLAGS -I$srcdir"
563
564 AC_MSG_CHECKING([preferred charset name formats for system iconv])
565 AC_RUN_IFELSE([AC_LANG_SOURCE([[
566         #define CONFIGURE_IN
567         #include "iconv-detect.c"
568         ]])],
569         [AC_MSG_RESULT([found])],
570         [AC_MSG_RESULT([not found])
571                 AC_MSG_WARN([
572                 *** The iconv-detect program was unable to determine the
573                 *** preferred charset name formats recognized by your
574                 *** iconv library. It is suggested that you install a
575                 *** working iconv library such as the one found at
576                 *** ftp://ftp.gnu.org/pub/gnu/libiconv
577         ])],
578         [if test "x$os_win32" = xyes; then
579                 AC_MSG_RESULT([using known win32 result])
580                 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
581                 echo  >>iconv-detect.h
582                 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
583                 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
584                 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
585         else
586                 AC_MSG_RESULT([unknown])
587                 AC_MSG_WARN([
588                 *** We can't determine the preferred charset name formats
589                 *** recognized by your iconv library. You are
590                 *** cross-compiling and supposed to know what you are doing.
591                 *** Please construct the iconv-detect.h file manually.
592                 ])
593         fi
594 ])
595
596 CFLAGS="$save_CFLAGS"
597 LIBS="$save_LIBS"
598
599 AC_ARG_ENABLE([backtraces],
600         [AS_HELP_STRING([--enable-backtraces],
601         [enable backtraces for camel_pointer_tracker (default=no)])],
602         [enable_backtraces=$enableval], [enable_backtraces=no])
603
604 if test "x$enable_backtraces" = xyes; then
605         dnl ****************************
606         dnl Check for backtrace_symbols function and dwfl from elfutils
607         dnl ****************************
608         AC_MSG_CHECKING([libc backtrace_symbols function])
609         AC_LINK_IFELSE([AC_LANG_PROGRAM(
610                 [[#include <execinfo.h>]],
611                 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
612                 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
613         AC_MSG_RESULT([$ac_cv_have_bsf])
614
615         if test "x$ac_cv_have_bsf" = xyes; then
616                 LIBS="$LIBS -ldw"
617
618                 AC_MSG_CHECKING([elfutils/libdwfl])
619                 AC_LINK_IFELSE([AC_LANG_PROGRAM(
620                         [[#include <elfutils/libdwfl.h>]],
621                         [[{
622                                 Dwfl *dwfl;
623                                 Dwfl_Module *module;
624                                 Dwarf_Addr module_low_addr;
625                                 Dwfl_Line *line;
626
627                                 dwfl_standard_find_debuginfo;
628                                 dwfl_linux_proc_find_elf;
629                                 dwfl_begin (NULL);
630                                 dwfl_linux_proc_report (NULL, 1);
631                                 dwfl_report_end (NULL, NULL, NULL);
632                                 dwfl_end (NULL);
633                                 dwfl_module_addrname (NULL, NULL);
634                                 dwfl_module_getsrc (NULL, NULL);
635                                 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
636                                 DWARF_CB_ABORT; DWARF_CB_OK;
637                                 dwfl_getmodules (NULL, NULL, NULL, 0);
638                         }]])],
639                         [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
640                 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
641
642                 LIBS="$save_LIBS"
643
644                 if test "x$ac_cv_have_elfdwfl" = xyes; then
645                         LIBDWFL_LIBS="-ldw"
646                         AC_SUBST(LIBDWFL_LIBS)
647                 fi
648         fi
649 fi
650
651 dnl ******************************
652 dnl Check for nl_langinfo features
653 dnl ******************************
654 EVO_CHECK_LANGINFO([CODESET])
655 EVO_CHECK_LANGINFO([_NL_ADDRESS_COUNTRY_AB2])
656
657 dnl *******************************************************
658 dnl Check to see if strftime supports the use of %l and %k
659 dnl *******************************************************
660 AC_MSG_CHECKING([for %l and %k support in strftime])
661 AC_RUN_IFELSE([AC_LANG_SOURCE(
662         [[      #include <stdlib.h>
663                 #include <string.h>
664                 #include <time.h>
665                 int main(int argc, char **argv) {
666                 char buf[10];
667                 time_t rawtime;
668                 struct tm *timeinfo;
669
670                 time(&rawtime);
671                 timeinfo=localtime(&rawtime);
672                 buf[0] = '\0';
673                 strftime(buf, 10, "%lx%k", timeinfo);
674
675                 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
676                         exit(1);
677                 else
678                         exit(0);
679                 return 0;
680                 }
681         ]]
682         )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
683 AC_MSG_RESULT([$ac_cv_lkstrftime])
684
685 dnl ********************************************************************************
686 dnl security extension support (SSL and S/MIME)
687 dnl
688 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
689 dnl needed by Camel (SSL and S/MIME).
690 dnl
691 dnl The Evolution security extensions are only built if these libraries are found
692 dnl ********************************************************************************
693 msg_smime="no"
694
695 AC_ARG_ENABLE([smime],
696         AS_HELP_STRING([--enable-smime],
697         [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
698         [enable_smime="$enableval"],[enable_smime="yes"])
699
700 AC_ARG_WITH([nspr-includes],
701         AS_HELP_STRING([--with-nspr-includes],
702         [Prefix of Mozilla nspr4 includes.]),
703         [with_nspr_includes="$withval"])
704
705 AC_ARG_WITH([nspr-libs],
706         AS_HELP_STRING([--with-nspr-libs],
707         [Prefix of Mozilla nspr4 libs.]),
708         [with_nspr_libs="$withval"])
709
710 AC_ARG_WITH([nss-includes],
711         AS_HELP_STRING([--with-nss-includes],
712         [Prefix of Mozilla nss3 includes.]),
713         [with_nss_includes="$withval"])
714
715 AC_ARG_WITH([nss-libs],
716         AS_HELP_STRING([--with-nss-libs],
717         [Prefix of Mozilla nss3 libs.]),
718         [with_nss_libs="$withval"])
719
720 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
721         check_manually="yes"
722 else
723         check_manually="no"
724 fi
725
726 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
727 if test "x${check_manually}" = "xno"; then
728         AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
729         mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
730         for pc in $mozilla_nspr_pcs; do
731                 if $PKG_CONFIG --exists $pc; then
732                         AC_MSG_RESULT($pc)
733                         mozilla_nspr=$pc
734                         break;
735                 fi
736         done
737
738         AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
739         mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
740         for pc in $mozilla_nss_pcs; do
741                 if $PKG_CONFIG --exists $pc; then
742                         AC_MSG_RESULT($pc)
743                         mozilla_nss=$pc
744                         break;
745                 fi
746         done
747
748         if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
749                 if test "x$enable_smime" = "xyes"; then
750                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
751                         msg_smime="yes"
752                 fi
753                 MANUAL_NSPR_CFLAGS=""
754                 MANUAL_NSPR_LIBS=""
755                 MANUAL_NSS_CFLAGS=""
756                 MANUAL_NSS_LIBS=""
757         else
758                 check_manually="yes"
759                 mozilla_nspr=""
760                 mozilla_nss=""
761         fi
762 fi
763
764 if test "x${check_manually}" = "xyes"; then
765 dnl ******************
766 dnl Check for NSPR 4
767 dnl ******************
768         AC_MSG_CHECKING([for Mozilla nspr4 includes])
769                 CPPFLAGS_save="$CPPFLAGS"
770                 if test -n "$with_nspr_includes"; then
771                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
772                 fi
773
774                 AC_CHECK_HEADERS(nspr.h prio.h,
775                 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
776                 CPPFLAGS="$CPPFLAGS_save"
777
778                 if test "x${moz_nspr_includes}" = "xyes"; then
779                         MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
780                 else
781                         AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
782                 fi
783         AC_MSG_RESULT([$moz_nspr_includes])
784
785         AC_MSG_CHECKING([for Mozilla nspr libraries])
786                 CFLAGS_save="$CFLAGS"
787                 LDFLAGS_save="$LDFLAGS"
788                 LIBS_save="$LIBS"
789                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
790
791                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
792                 LIBS="$nsprlibs"
793                 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
794                 if test -n "${with_nspr_libs}"; then
795                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
796                 else
797                         LDFLAGS="$LDFLAGS"
798                 fi
799
800                 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
801                 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
802
803                 CFLAGS="$CFLAGS_save"
804                 LDFLAGS="$LDFLAGS_save"
805                 LIBS="$LIBS_save"
806
807                 if test "x${moz_nspr_libs}" = "xyes"; then
808                         if test -n "${with_nspr_libs}"; then
809                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
810                         else
811                                 MANUAL_NSPR_LIBS="$nsprlibs"
812                         fi
813                 else
814                         AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
815                 fi
816         AC_MSG_RESULT([$moz_nspr_libs])
817
818 dnl *****************
819 dnl Check for NSS 3
820 dnl *****************
821         AC_MSG_CHECKING([for Mozilla nss3 includes])
822                 CPPFLAGS_save="$CPPFLAGS"
823                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
824
825                 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
826                 [moz_nss_includes="yes"],[moz_nss_includes="no"])
827                 CPPFLAGS="$CPPFLAGS_save"
828
829                 if test "x${moz_nss_includes}" = "xyes"; then
830                         MANUAL_NSS_CFLAGS="-I$with_nss_includes"
831                 else
832                         AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
833                 fi
834         AC_MSG_RESULT($moz_nss_includes)
835
836         AC_MSG_CHECKING([for Mozilla nss libraries])
837                 LDFLAGS_save="$LDFLAGS"
838                 LIBS_save="$LIBS"
839                 nsslibs="-lssl3 -lsmime3 -lnss3"
840
841                 LIBS="$nsslibs $nsprlibs"
842                 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
843                 if test -n "${with_nss_libs}"; then
844                         LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
845                 else
846                         LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
847                 fi
848
849                 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
850                 [moz_nss_libs="yes"],[moz_nss_libs="no"])
851                 LDFLAGS="$LDFLAGS_save"
852                 LIBS="$LIBS_save"
853
854                 if test "x${moz_nss_libs}" = "xyes"; then
855                         if test "x${enable_smime}" = "xyes"; then
856                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
857                                 msg_smime="yes"
858                         fi
859                         if test -n "${with_nss_libs}"; then
860                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
861                         else
862                                 MANUAL_NSS_LIBS="$nsslibs"
863                         fi
864                 else
865                         AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
866                 fi
867         AC_MSG_RESULT([$moz_nss_libs])
868
869         MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
870         MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
871 fi
872
873 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
874
875 dnl For pkgconfig files.
876 AC_SUBST(mozilla_nss)
877 AC_SUBST(mozilla_nspr)
878
879 AC_SUBST(MANUAL_NSPR_CFLAGS)
880 AC_SUBST(MANUAL_NSPR_LIBS)
881 AC_SUBST(MANUAL_NSS_CFLAGS)
882 AC_SUBST(MANUAL_NSS_LIBS)
883
884 dnl ******************************
885 dnl system mail stuff
886 dnl ******************************
887 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
888 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
889
890 AC_MSG_CHECKING([system mail directory])
891 if test -d /var/mail -a '!' -h /var/mail ; then
892         system_mail_dir="/var/mail"
893 else
894         system_mail_dir="/var/spool/mail"
895 fi
896 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
897
898 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
899         d??????rw?)
900                 CAMEL_LOCK_HELPER_USER=""
901                 CAMEL_LOCK_HELPER_GROUP=""
902                 system_mail_perm="world writable"
903         ;;
904         d???rw????)
905                 CAMEL_LOCK_HELPER_USER=""
906                 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
907                 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
908         ;;
909         drw???????)
910                 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
911                 CAMEL_LOCK_HELPER_GROUP=""
912                 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
913         ;;
914         *)
915                 CAMEL_LOCK_HELPER_USER=""
916                 CAMEL_LOCK_HELPER_GROUP=""
917                 system_mail_perm="???"
918         ;;
919 esac
920
921 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
922 AC_SUBST(CAMEL_LOCK_HELPER_USER)
923 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
924
925 dnl ******************************
926 dnl Timezone checks
927 dnl ******************************
928 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
929         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
930         [[      #include <time.h>       ]],
931         [[
932                 struct tm tm;
933                 tm.tm_gmtoff = 1;
934         ]]
935         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
936 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
937         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
938 else
939         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
940                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
941                 [[      #include <time.h> ]],
942                 [[      timezone = 1;   ]]
943                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
944         if test "x$ac_cv_var_timezone" = "xyes"; then
945                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
946                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
947                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
948                         [[      #include <time.h>       ]],
949                         [[      altzone = 1; ]]
950                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
951                 if test "x$ac_cv_var_altzone" = "xyes"; then
952                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
953                 fi
954         else
955                 AC_MSG_ERROR([unable to find a way to determine timezone])
956         fi
957 fi
958
959 dnl ******************************
960 dnl ctime_r prototype
961 dnl ******************************
962 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
963 [
964         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
965         [[      #include <time.h> ]],
966         [[      char *buf;
967                 time_t date;
968                 ctime_r (&date, buf, 100); ]]
969         )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
970 ])
971
972 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
973         AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
974 fi
975
976 dnl ******************************
977 dnl gethostbyname_r prototype
978 dnl ******************************
979 AC_CHECK_FUNCS(gethostbyname_r,[
980 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
981 [
982         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
983         [[
984                 #include "confdefs.h"
985                 #include <sys/types.h>
986                 #include <sys/socket.h>
987                 #include <netinet/in.h>
988                 #include <netdb.h>
989                 #define BUFSIZE (sizeof(struct hostent)+10)
990         ]],
991         [[
992                 struct hostent hent;
993                 char buffer[BUFSIZE];
994                 int bufsize=BUFSIZE;
995                 int h_errno;
996                 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
997         ]]
998         )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
999 ])])
1000
1001 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
1002         AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
1003 fi
1004
1005 dnl ******************************
1006 dnl gethostbyaddr_r prototype
1007 dnl ******************************
1008 AC_CHECK_FUNCS(gethostbyaddr_r,[
1009 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
1010 [
1011         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1012         [[
1013                 #include "confdefs.h"
1014                 #include <sys/types.h>
1015                 #include <sys/socket.h>
1016                 #include <netinet/in.h>
1017                 #include <netdb.h>
1018                 #define BUFSIZE (sizeof(struct hostent)+10)
1019         ]],
1020         [[
1021                 struct hostent hent;
1022                 char buffer[BUFSIZE];
1023                 int bufsize=BUFSIZE;
1024                 int h_errno;
1025                 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1026         )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1027 ])])
1028
1029 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1030         AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1031 fi
1032
1033 dnl ******************************
1034 dnl stat(v)fs location/type
1035 dnl ******************************
1036 AC_CHECK_HEADER([sys/statvfs.h],
1037         [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1038         [[      #if HAVE_SYS_STATVFS_H
1039                 #include <sys/statvfs.h>
1040                 #endif
1041         ]])
1042 AC_CHECK_FUNCS(statvfs)
1043
1044 AC_CHECK_HEADER([sys/param.h],
1045         [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1046         [[      #if HAVE_SYS_PARAM_H
1047                 #include <sys/param.h>
1048                 #endif
1049         ]])
1050 AC_CHECK_HEADER([sys/mount.h],
1051         [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1052         [[      #if HAVE_SYS_MOUNT_H
1053                 #include <sys/mount.h>
1054                 #endif
1055         ]])
1056 AC_CHECK_FUNCS(statfs)
1057
1058 dnl ******************************
1059 dnl IPv6 support and getaddrinfo calls
1060 dnl ******************************
1061 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1062 [
1063         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1064         [[      #include "confdefs.h"
1065                 #include <sys/types.h>
1066                 #include <sys/socket.h>
1067                 #include <netinet/in.h>
1068                 #include <netdb.h>
1069                 #include <stddef.h>
1070         ]],
1071         [[      #ifndef NI_MAXHOST
1072                 #define NI_MAXHOST      1025
1073                 #endif
1074
1075                 #ifndef NI_MAXSERV
1076                 #define NI_MAXSERV      32
1077                 #endif
1078
1079                 struct addrinfo hints, *res;
1080                 struct sockaddr_in6 sin6;
1081                 int af = AF_INET6;
1082                 char host[NI_MAXHOST];
1083                 char serv[NI_MAXSERV];
1084
1085                 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1086                 freeaddrinfo (res);
1087                 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1088         )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1089 ])
1090
1091 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1092         AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1093         if test "x$enable_ipv6" = "xyes" ; then
1094                 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1095         fi
1096         msg_ipv6="no"
1097 else
1098         AC_ARG_ENABLE([ipv6],
1099         AS_HELP_STRING([--enable-ipv6=no/yes],
1100         [Enable support for resolving IPv6 addresses.]),
1101         [enable_ipv6=$enableval],[enable_ipv6=yes])
1102         if test "x$enable_ipv6" = "xyes"; then
1103                 msg_ipv6="yes"
1104                 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1105                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1106                 [[      #include "confdefs.h"
1107                         #include <sys/types.h>
1108                         #include <sys/socket.h>
1109                         #include <netinet/in.h>
1110                         #include <netdb.h>
1111                 ]],
1112                 [[      struct addrinfo hints;
1113                         hints.ai_flags = AI_ADDRCONFIG;
1114                 ]]
1115                 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1116         else
1117                 msg_ipv6="no"
1118         fi
1119 fi
1120
1121 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1122
1123 AC_CHECK_HEADER([wspiapi.h],
1124         [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1125
1126 dnl **********************************
1127 dnl Weather calendar backend support
1128 dnl **********************************
1129 AC_MSG_CHECKING([if we should build the weather calendar backend])
1130 AC_ARG_ENABLE([weather],
1131         [AS_HELP_STRING([--enable-weather],
1132         [Build the weather calendar backend (default=yes)])],
1133         [use_gweather=$enableval], [use_gweather=yes])
1134
1135 AC_MSG_RESULT([$use_gweather])
1136 if test "x$use_gweather" = "xyes"; then
1137         PKG_CHECK_MODULES([LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1138         [AC_MSG_ERROR([The weather calendar backend requires GWeather >= gweather_minimum_version. Alternatively, you may specify --disable-weather as a configure option to avoid building the backend.])])
1139 fi
1140 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1141
1142 dnl ******************************
1143 dnl NNTP support.
1144 dnl ******************************
1145 AC_ARG_ENABLE([nntp],
1146         AS_HELP_STRING([--enable-nntp],
1147         [Build Usenet news (NNTP) backend]),
1148         [enable_nntp=$enableval],[enable_nntp=yes])
1149 if test "x$enable_nntp" = "xyes"; then
1150         AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1151         msg_nntp="yes"
1152 else
1153         msg_nntp="no"
1154 fi
1155 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1156
1157 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1158
1159 dnl ******************************
1160 dnl File locking
1161 dnl ******************************
1162 AC_ARG_ENABLE([dot-locking],
1163         AS_HELP_STRING([--enable-dot-locking=yes/no],
1164         [Enable support for locking mail files with dot locking]),
1165         [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1166
1167 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1168         AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1169         msg_dot="yes"
1170 else
1171         msg_dot="no"
1172 fi
1173
1174 AC_ARG_ENABLE([file-locking],
1175         AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1176         [Enable support for locking mail files with file locking]),
1177         [],[enable_file_locking=fcntl])
1178
1179 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1180         AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1181         msg_file="fcntl"
1182 else
1183         if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1184                 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1185                 msg_file="flock"
1186         else
1187                 msg_file="no"
1188         fi
1189 fi
1190
1191 dnl ******************************
1192 dnl sendmail operation
1193 dnl ******************************
1194 AC_MSG_CHECKING([for SunOS broken spool format])
1195 if test "x$host_os" = "xsunos" ; then
1196         with_broken_spool="yes"
1197 fi
1198
1199 AC_ARG_WITH([broken-spool],
1200         AS_HELP_STRING([--with-broken-spool=yes/no],
1201         [Using SunOS/Solaris sendmail which has a broken spool format]),
1202         [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1203
1204 if test "x$with_broken_spool" = "xyes"; then
1205         AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1206 fi
1207
1208 AC_MSG_RESULT([$with_broken_spool])
1209
1210 dnl ******************************
1211 dnl DBus call timeout
1212 dnl ******************************
1213
1214 AC_ARG_WITH([dbus-call-timeout],
1215         AS_HELP_STRING([--with-dbus-call-timeout=miliseconds],
1216         [Default timeout used when invoking g_dbus_proxy_call() family functions in EBook and ECal library (default=-1)]),
1217         [ac_cv_dbus_call_timeout=$withval],[ac_cv_dbus_call_timeout=-1])
1218
1219 DEFAULT_EDS_DBUS_TIMEOUT=$ac_cv_dbus_call_timeout
1220 AC_SUBST(DEFAULT_EDS_DBUS_TIMEOUT)
1221
1222 dnl ***********
1223 dnl Kerberos 5
1224 dnl ***********
1225 EVO_KRB5_SUPPORT(no)
1226
1227 dnl ******************************
1228 dnl Purify support
1229 dnl ******************************
1230 EVO_PURIFY_SUPPORT
1231
1232 dnl ******************************
1233 dnl LDAP support.
1234 dnl ******************************
1235 if test "x$os_win32" != "xyes"; then
1236         EVO_LDAP_CHECK(no)
1237         case $with_openldap in
1238         no)
1239                 msg_ldap="no"
1240         ;;
1241         *)
1242                 case $with_static_ldap in
1243                 yes)
1244                         msg_ldap="$with_openldap (static)"
1245                         ;;
1246                 *)
1247                         msg_ldap="$with_openldap (dynamic)"
1248                         ;;
1249                 esac
1250         esac
1251
1252 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1253         if test "x$with_openldap" = "xno" ; then
1254                 EVO_SUNLDAP_CHECK(no)
1255                 case $with_sunldap in
1256                 no)
1257                         msg_ldap="no"
1258                         ;;
1259                 *)
1260                         case $with_static_sunldap in
1261                         yes)
1262                                 msg_ldap="$with_sunldap (static)"
1263                                 ;;
1264                         *)
1265                                 msg_ldap="$with_sunldap (dynamic)"
1266                                 ;;
1267                 esac
1268         esac
1269         else
1270                 with_sunldap="no"
1271         fi
1272         AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1273
1274         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1275 else
1276         dnl Win32 LDAP support
1277         LDAP_CFLAGS="-DLDAP_DEPRECATED"
1278         LDAP_LIBS="-lwldap32"
1279         AC_SUBST(LDAP_CFLAGS)
1280         AC_SUBST(LDAP_LIBS)
1281         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1282         AM_CONDITIONAL(ENABLE_LDAP, true)
1283         AM_CONDITIONAL(SUNLDAP, false)
1284         msg_ldap="yes"
1285 fi
1286
1287 dnl ******************************
1288 dnl GObject marshalling
1289 dnl ******************************
1290 AM_PATH_GLIB_2_0
1291
1292 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1293 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1294 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1295
1296 dnl ******************************
1297 dnl Utility macro to set compiler flags for a specific lib.
1298 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1299 dnl ******************************
1300 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1301         PKG_CHECK_MODULES([$1], [$2])
1302         $1_CFLAGS="[$]$1_CFLAGS $3 "
1303         $1_LIBS="[$]$1_LIBS $4 "
1304 ])
1305
1306 dnl ******************************
1307 dnl sqlite3 flags
1308 dnl ******************************
1309 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1310
1311 if test "x$enable_maintainer_mode" = "xyes" ; then
1312         EVO_SET_COMPILE_FLAGS(FACTORY_GTK, "gtk+-3.0")
1313         AC_SUBST(FACTORY_GTK_CFLAGS)
1314         AC_SUBST(FACTORY_GTK_LIBS)
1315 fi
1316
1317 dnl ******************************
1318 dnl libedataserver flags
1319 dnl ******************************
1320 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libxml-2.0 libsoup-2.4 $mozilla_nspr"
1321
1322 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1323 AC_SUBST(E_DATA_SERVER_CFLAGS)
1324 AC_SUBST(E_DATA_SERVER_LIBS)
1325
1326 dnl ******************************
1327 dnl libebackend flags
1328 dnl ******************************
1329 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libsoup-2.4 libxml-2.0"
1330
1331 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1332 AC_SUBST(E_BACKEND_CFLAGS)
1333 AC_SUBST(E_BACKEND_LIBS)
1334
1335 dnl ******************************
1336 dnl evolution-addressbook flags
1337 dnl ******************************
1338 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 libsoup-2.4 libsecret-1"
1339
1340 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1341 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1342 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1343
1344 dnl ******************************
1345 dnl evolution-calendar flags
1346 dnl ******************************
1347 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libsoup-2.4 libxml-2.0 libsecret-1"
1348
1349 dnl *****
1350 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1351 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1352 dnl to differentiate between <libical/ical.h> and <ical.h>
1353 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1354 dnl libical is fixed, we have to work-around the buggy CFlags.
1355 dnl *****
1356         LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1357         LIBICAL_EXTRA_LIBS=""
1358         AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1359         AC_SUBST(LIBICAL_EXTRA_LIBS)
1360
1361         EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1362         AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1363         AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1364
1365         dnl ****************************
1366         dnl Check for ical_set_unknown_token_handling_setting function
1367         dnl ****************************
1368         AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1369         save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1370         save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1371         AC_LINK_IFELSE([AC_LANG_PROGRAM(
1372                 [[#include <libical/ical.h>]],
1373                 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1374                 [AC_DEFINE(HAVE_ICAL_UNKNOWN_TOKEN_HANDLING, 1, [libical provides ical_set_unknown_token_handling_setting function]) ac_cv_have_iuth=yes],[ac_cv_have_iuth=no])
1375         CFLAGS=$save_cflags
1376         LIBS=$save_libs
1377         AC_MSG_RESULT([$ac_cv_have_iuth])
1378
1379 dnl ******************************
1380 dnl Google flags
1381 dnl ******************************
1382 LIBGDATA_REQUIRED=libgdata_minimum_version
1383 AC_SUBST(LIBGDATA_REQUIRED)
1384 AC_ARG_ENABLE([google],
1385         [AS_HELP_STRING([--enable-google],
1386         [enable Google Contacts support (default=yes)])],
1387         [enable_google=$enableval], [enable_google=yes])
1388 AC_MSG_CHECKING([if Google Contacts support is enabled])
1389 AC_MSG_RESULT([$enable_google])
1390 if test "x$enable_google" = xyes; then
1391         EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= libgdata_minimum_version)
1392         AC_SUBST(GDATA_CFLAGS)
1393         AC_SUBST(GDATA_LIBS)
1394
1395         AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if you have the google-1.0 package.])
1396 fi
1397 AM_CONDITIONAL(HAVE_GOOGLE, [test x$enable_google = xyes])
1398
1399 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1400 AC_SUBST(SOUP_CFLAGS)
1401 AC_SUBST(SOUP_LIBS)
1402
1403 dnl ******************************
1404 dnl Camel flags
1405 dnl ******************************
1406 SQLITE_REQUIRED=sqlite_minimum_version
1407 AC_SUBST(SQLITE_REQUIRED)
1408
1409 zlib_found="false"
1410 dnl deflateInit is a #define, use deflateEnd instead
1411 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1412
1413 if test "x$zlib_found" = "xfalse"; then
1414         AC_MSG_ERROR([*** zlib is required])
1415 fi
1416
1417 dnl ******************************
1418 dnl Checks for large file support
1419 dnl ******************************
1420 AC_ARG_ENABLE([largefile],
1421         AS_HELP_STRING([--enable-largefile],
1422         [enable support for large files [[default=no]]]),
1423         [],[enable_largefile="yes"])
1424
1425 if test "x$enable_largefile" != "xno"; then
1426         AC_SYS_LARGEFILE
1427         AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1428         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1429         [[      #include <sys/types.h>
1430                 #include <sys/stat.h>
1431                 #include <fcntl.h>
1432         ]],
1433         [[      int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);  ]]
1434         )],[ac_cv_largefile64_source="no"],
1435                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1436                 [[      #define _LARGEFILE64_SOURCE
1437                         #include <sys/types.h>
1438                         #include <sys/stat.h>
1439                         #include <fcntl.h>
1440                 ]],
1441                 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1442                 [ac_cv_largefile64_source="unknown"])])
1443         ])
1444
1445         enable_largefile="no"
1446
1447         if test "x$ac_cv_largefile64_source" = "xyes"; then
1448                 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1449                 enable_largefile="yes"
1450         elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1451                 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1452         fi
1453
1454         if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1455                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1456                 enable_largefile="yes"
1457         fi
1458
1459         if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1460                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1461                 enable_largefile="yes"
1462         fi
1463 else
1464         AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1465         LARGEFILE_CFLAGS=""
1466 fi
1467
1468 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1469
1470 EVO_SET_COMPILE_FLAGS(CAMEL, gio-2.0 gmodule-2.0 $mozilla_nss sqlite3 >= sqlite_minimum_version, $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $LARGEFILE_CFLAGS, -lz $KRB5_LIBS $MANUAL_NSS_LIBS)
1471 AC_SUBST(CAMEL_CFLAGS)
1472 AC_SUBST(CAMEL_LIBS)
1473
1474 dnl ******************************
1475 dnl Special directories
1476 dnl ******************************
1477
1478 dnl If you add something here, consider whether or not you also
1479 dnl need to add it to one or more .pc.in files (for Connector,
1480 dnl etc)
1481
1482 privdatadir='${datadir}'/evolution-data-server
1483 AC_SUBST(privdatadir)
1484
1485 privincludedir='${includedir}'/evolution-data-server
1486 AC_SUBST(privincludedir)
1487
1488 privlibdir='${libdir}'/evolution-data-server
1489 AC_SUBST(privlibdir)
1490
1491 imagesdir='${datadir}'/pixmaps/evolution-data-server
1492 AC_SUBST(imagesdir)
1493
1494 moduledir='${privlibdir}'/registry-modules
1495 AC_SUBST(moduledir)
1496
1497 ebook_backenddir='${privlibdir}'/addressbook-backends
1498 AC_SUBST(ebook_backenddir)
1499
1500 ecal_backenddir='${privlibdir}'/calendar-backends
1501 AC_SUBST(ecal_backenddir)
1502
1503 ro_sourcesdir='${privdatadir}'/ro-sources
1504 AC_SUBST(ro_sourcesdir)
1505
1506 rw_sourcesdir='${privdatadir}'/rw-sources
1507 AC_SUBST(rw_sourcesdir)
1508
1509 if test "x$use_gweather" = "xyes"; then
1510         weatherdatadir="$privdatadir/weather"
1511         AC_SUBST(weatherdatadir)
1512 fi
1513
1514 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1515 camel_providerdir='${privlibdir}'/camel-providers
1516 AC_SUBST(camel_providerdir)
1517
1518 dnl *******************
1519 dnl D-BUS service stuff
1520 dnl *******************
1521 m4_pattern_allow([AM_V_GEN])
1522 EVO_SUBST_SERVICE_RULE='%.service: %.service.in Makefile ; $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" -e s"|\@ADDRESS_BOOK_DBUS_SERVICE_NAME\@|$(ADDRESS_BOOK_DBUS_SERVICE_NAME)|" -e "s|\@CALENDAR_DBUS_SERVICE_NAME\@|$(CALENDAR_DBUS_SERVICE_NAME)|" -e "s|\@SOURCES_DBUS_SERVICE_NAME\@|$(SOURCES_DBUS_SERVICE_NAME)|" -e "s|\@USER_PROMPTER_DBUS_SERVICE_NAME\@|$(USER_PROMPTER_DBUS_SERVICE_NAME)|" $< > $@'
1523 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1524
1525 dnl ******************************
1526 dnl GLib stuff
1527 dnl ******************************
1528 GLIB_GSETTINGS
1529 AM_PATH_GLIB_2_0
1530
1531 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines
1532 EVO_MARSHAL_RULE=$srcdir/marshal.mk
1533 AC_SUBST_FILE(EVO_MARSHAL_RULE)
1534
1535 dnl ******************************
1536 dnl gperf stuff
1537 dnl ******************************
1538 AC_PATH_PROG(GPERF, gperf, [no])
1539 if test "x$GPERF" = "xno"; then
1540   AC_MSG_ERROR([You need gperf to build evolution-data-server])
1541 fi
1542
1543 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1544
1545 dnl ******************************
1546 dnl Vala binding
1547 dnl ******************************
1548 AC_ARG_ENABLE(vala-bindings,
1549         AC_HELP_STRING([--enable-vala-bindings],
1550         [build the EXPERIMENTAL Vala bindings]),
1551         enable_vala_bindings=$enableval,
1552         enable_vala_bindings=no)
1553
1554 if test x$enable_vala_bindings = xyes; then
1555   if test "x$INTROSPECTION_SCANNER" = x; then
1556     AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1557   fi
1558
1559   AM_PROG_VALAC([0.13.0])
1560   have_vala=yes
1561
1562   AC_PATH_PROG(VALAC, valac, valac)
1563   AC_SUBST(VALAC)
1564   AC_SUBST(VALAFLAGS)
1565
1566   AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1567
1568   if test "x$VAPIGEN" = "xfalse"; then
1569     AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1570   fi
1571
1572   AC_SUBST(VAPIGEN)
1573 fi
1574
1575 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1576 AC_SUBST(HAVE_VALA)
1577
1578 dnl ******************************
1579 dnl Makefiles
1580 dnl ******************************
1581 export privlibdir
1582 export privincludedir
1583 export privdatadir
1584
1585 AC_CONFIG_FILES([
1586 Makefile
1587 evolution-data-server-zip
1588 evolution-data-server.pc
1589 addressbook/Makefile
1590 addressbook/libebook/Makefile
1591 addressbook/libebook/libebook.pc
1592 addressbook/libedata-book/Makefile
1593 addressbook/libedata-book/libedata-book.pc
1594 addressbook/libegdbus/Makefile
1595 addressbook/backends/Makefile
1596 addressbook/backends/file/Makefile
1597 addressbook/backends/ldap/Makefile
1598 addressbook/backends/google/Makefile
1599 addressbook/backends/google/tests/Makefile
1600 addressbook/backends/webdav/Makefile
1601 art/Makefile
1602 calendar/Makefile
1603 calendar/libecal/Makefile
1604 calendar/libecal/libecal.pc
1605 calendar/libedata-cal/Makefile
1606 calendar/libedata-cal/libedata-cal.pc
1607 calendar/libegdbus/Makefile
1608 calendar/backends/Makefile
1609 calendar/backends/caldav/Makefile
1610 calendar/backends/file/Makefile
1611 calendar/backends/http/Makefile
1612 calendar/backends/contacts/Makefile
1613 calendar/backends/weather/Makefile
1614 camel/Makefile
1615 camel/providers/Makefile
1616 camel/providers/imapx/Makefile
1617 camel/providers/local/Makefile
1618 camel/providers/nntp/Makefile
1619 camel/providers/pop3/Makefile
1620 camel/providers/sendmail/Makefile
1621 camel/providers/smtp/Makefile
1622 camel/tests/Makefile
1623 camel/tests/folder/Makefile
1624 camel/tests/lib/Makefile
1625 camel/tests/message/Makefile
1626 camel/tests/mime-filter/Makefile
1627 camel/tests/misc/Makefile
1628 camel/tests/smime/Makefile
1629 camel/camel.pc
1630 data/Makefile
1631 libebackend/Makefile
1632 libebackend/libebackend.pc
1633 libedataserver/Makefile
1634 libedataserver/eds-version.h
1635 libedataserver/libedataserver.pc
1636 modules/Makefile
1637 modules/cache-reaper/Makefile
1638 modules/gnome-online-accounts/Makefile
1639 modules/google-backend/Makefile
1640 modules/trust-prompt/Makefile
1641 modules/yahoo-backend/Makefile
1642 private/Makefile
1643 services/Makefile
1644 services/evolution-addressbook-factory/Makefile
1645 services/evolution-calendar-factory/Makefile
1646 services/evolution-source-registry/Makefile
1647 services/evolution-user-prompter/Makefile
1648 tests/Makefile
1649 tests/libebook/Makefile
1650 tests/libebook/client/Makefile
1651 tests/libebook/vcard/Makefile
1652 tests/libecal/Makefile
1653 tests/libecal/client/Makefile
1654 tests/libedata-cal/Makefile
1655 tests/libedataserver/Makefile
1656 tests/test-server-utils/Makefile
1657 tests/test-server-utils/services/Makefile
1658 tests/test-server-utils/services/org.gnome.evolution.dataserver.AddressBook.service
1659 tests/test-server-utils/services/org.gnome.evolution.dataserver.Calendar.service
1660 tests/test-server-utils/services/org.gnome.evolution.dataserver.Sources.service
1661 docs/Makefile
1662 docs/reference/Makefile
1663 docs/reference/addressbook/Makefile
1664 docs/reference/addressbook/libebook/Makefile
1665 docs/reference/addressbook/libedata-book/Makefile
1666 docs/reference/calendar/Makefile
1667 docs/reference/calendar/libecal/Makefile
1668 docs/reference/calendar/libedata-cal/Makefile
1669 docs/reference/camel/Makefile
1670 docs/reference/libedataserver/Makefile
1671 docs/reference/libebackend/Makefile
1672 docs/reference/private/Makefile
1673 po/Makefile.in
1674 vala/Makefile
1675 ])
1676 AC_OUTPUT
1677
1678 echo "
1679         evolution-data-server has been configured as follows:
1680         Weather calendar:       $use_gweather
1681         Mail Directory:         $system_mail_dir, $system_mail_perm
1682         LDAP support:           $msg_ldap
1683         NNTP support:           $msg_nntp
1684         Kerberos 5:             $msg_krb5
1685         SMIME support:          $msg_smime
1686         IPv6 support:           $msg_ipv6
1687         Phone number support:   $msg_phonenumber
1688         Dot Locking:            $msg_dot
1689         File Locking:           $msg_file
1690         Large files:            $enable_largefile
1691         Gtk Doc:                $enable_gtk_doc
1692         Introspection:          $enable_introspection
1693         Vala bindings:          $enable_vala_bindings
1694         GNOME Online Accounts   $enable_goa
1695         Google Contacts         $enable_google
1696         GTK+:                   $enable_gtk
1697         Code coverage (gcov):   $enable_code_coverage
1698         Strict building:        $enable_strict
1699 "