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