trust-prompt: Show a GcrCertificateWidget in the dialog.
[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], [11])
5 m4_define([eds_micro_version], [1])
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.12
15 m4_define([base_version], [3.12])
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.8])
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.Sources2"
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=18
110 LIBEDATASERVER_REVISION=0
111 LIBEDATASERVER_AGE=0
112
113 LIBECAL_CURRENT=16
114 LIBECAL_REVISION=0
115 LIBECAL_AGE=0
116
117 LIBEDATACAL_CURRENT=23
118 LIBEDATACAL_REVISION=0
119 LIBEDATACAL_AGE=0
120
121 LIBEDATABOOK_CURRENT=20
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=46
134 LIBCAMEL_REVISION=0
135 LIBCAMEL_AGE=0
136
137 LIBEBACKEND_CURRENT=7
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(
436                 [GTK], [gtk+-3.0 >= gdk_minimum_version],,
437                 [AC_MSG_ERROR([
438
439         gtk+-3.0 not found (or version < gdk_minimum_version)
440
441         If you want to disable GTK+ support,
442         please append --disable-gtk to configure.
443
444         ])])
445
446         PKG_CHECK_MODULES(
447                 [GCR], [gcr-3 >= gcr_minimum_version],,
448                 [AC_MSG_ERROR([
449
450         gcr-3.0 not found (or version < gcr_minimum_version)
451
452         If you want to disable gcr-3.0's GTK+ widgets,
453         please append --disable-gtk to configure.
454
455         ])])
456
457         AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
458 fi
459 AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
460
461 dnl *******************************
462 dnl Check for GNOME Online Accounts
463 dnl *******************************
464 AC_ARG_ENABLE([goa],
465         [AS_HELP_STRING([--enable-goa],
466         [enable GNOME Online Accounts support (default=yes)])],
467         [enable_goa=$enableval], [enable_goa=yes])
468 AC_MSG_CHECKING([if GNOME Online Accounts support is enabled])
469 AC_MSG_RESULT([$enable_goa])
470 if test "x$enable_goa" = xyes; then
471         PKG_CHECK_MODULES(
472                 [GOA], [goa-1.0 >= goa_minimum_version],,
473                 [AC_MSG_ERROR([
474
475         goa-1.0 not found (or version < goa_minimum_version)
476
477         If you want to disable GNOME Online Accounts support,
478         please append --disable-goa to configure.
479
480         ])])
481
482         AC_DEFINE(HAVE_GOA, 1, [Define to 1 if you have the goa-1.0 package.])
483 fi
484 AM_CONDITIONAL(HAVE_GOA, [test x$enable_goa = xyes])
485
486 dnl ********************************
487 dnl Check for Ubuntu Online Accounts
488 dnl ********************************
489 AC_ARG_ENABLE([uoa],
490         [AS_HELP_STRING([--enable-uoa],
491         [enable Ubuntu Online Accounts support (default=yes)])],
492         [enable_uoa=$enableval], [enable_uoa=yes])
493 AC_MSG_CHECKING([if Ubuntu Online Accounts support is enabled])
494 AC_MSG_RESULT([$enable_uoa])
495 if test "x$enable_uoa" = xyes; then
496         PKG_CHECK_MODULES(
497                 [LIBACCOUNTS_GLIB],
498                 [libaccounts-glib >= libaccounts_glib_minimum_version],,
499                 [AC_MSG_ERROR([
500
501         libaccounts-glib not found (or version < libaccounts_glib_minimum_version)
502
503         If you want to disable Ubuntu Online Accounts support,
504         please append --disable-uoa to configure.
505
506         ])])
507
508         PKG_CHECK_MODULES(
509                 [LIBSIGNON_GLIB],
510                 [libsignon-glib >= libsignon_glib_minimum_version],,
511                 [AC_MSG_ERROR([
512
513         libsignon-glib not found (or version < libsignon_glib_minimum_version)
514
515         If you want to disable Ubuntu Online Accounts support,
516         please append --disable-uoa to configure.
517
518         ])])
519
520         PKG_CHECK_MODULES(
521                 [JSON_GLIB], [json-glib-1.0],,
522                 [AC_MSG_ERROR([
523
524         json-glib-1.0 not found
525
526         If you want to disable Ubuntu Online Accounts support,
527         please append --disable-uoa to configure.
528
529         ])])
530
531         PKG_CHECK_MODULES(
532                 [REST], [rest-0.7],,
533                 [AC_MSG_ERROR([
534
535         librest-0.7 not found
536
537         If you want to disable Ubuntu Online Accounts support,
538         please append --disable-uoa to configure.
539
540         ])])
541
542         AC_DEFINE(HAVE_UOA, 1, [Have libaccounts-glib])
543 fi
544 AM_CONDITIONAL(HAVE_UOA, [test x$enable_uoa = xyes])
545
546 dnl ***********************************
547 dnl Check for GNOME Keyring.
548 dnl ***********************************
549 if test x$os_win32 = xno; then
550         PKG_CHECK_MODULES(LIBSECRET,
551                 [libsecret-unstable >= libsecret_minimum_version])
552 fi
553 AC_SUBST(LIBSECRET_CFLAGS)
554 AC_SUBST(LIBSECRET_LIBS)
555
556 dnl **********************************************************
557 dnl gcr-base is needed for secure password exchange over D-Bus
558 dnl **********************************************************
559 PKG_CHECK_MODULES(GCR_BASE, [gcr-base-3 >= gcr_minimum_version])
560 AC_SUBST(GCR_BASE_CFLAGS)
561 AC_SUBST(GCR_BASE_LIBS)
562
563 LIBICAL_REQUIRED=libical_minimum_version
564 AC_SUBST(LIBICAL_REQUIRED)
565
566 dnl ******************************
567 dnl regex check
568 dnl ******************************
569 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
570                         [REGEX_LIBS=-lregex
571                         AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
572                         [AC_MSG_ERROR([No regex library found])])])
573 AC_SUBST(REGEX_LIBS)
574
575 dnl ******************************
576 dnl libdb checking
577 dnl ******************************
578 AC_ARG_WITH([libdb],
579         AS_HELP_STRING([--with-libdb=PREFIX],
580         [Prefix where libdb is installed]),
581         [libdb_prefix="$withval"], [libdb_prefix='${prefix}'])
582
583 DB_CFLAGS="-I$libdb_prefix/include"
584 DB_LIBS="-L$libdb_prefix/lib -ldb"
585
586 AC_MSG_CHECKING([Berkeley DB])
587 save_cflags=$CFLAGS; CFLAGS=$DB_CFLAGS
588 save_libs=$LIBS; LIBS="$DB_LIBS"
589 AC_LINK_IFELSE([AC_LANG_PROGRAM(
590         [[#include <db.h>]],
591         [[db_create(NULL, NULL, 0)]])],
592         [AC_MSG_RESULT([yes])],
593         [AC_MSG_ERROR([Cannot find libdb])])
594 CFLAGS=$save_cflags
595 LIBS=$save_libs
596 AC_SUBST(DB_CFLAGS)
597 AC_SUBST(DB_LIBS)
598
599 dnl ******************************
600 dnl iconv checking
601 dnl ******************************
602 have_iconv="no"
603 save_LIBS="$LIBS"
604 LIBS="$LIBS -liconv"
605 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
606         AC_LINK_IFELSE([AC_LANG_PROGRAM(
607         [[
608                 #include <iconv.h>
609                 #include <stdlib.h>
610         ]],
611         [[
612                 iconv_t cd;
613                 cd = iconv_open ("UTF-8", "ISO-8859-1");
614         ]]
615         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
616
617 if test "x$ac_cv_libiconv" = "xyes"; then
618         ICONV_LIBS="-liconv"
619         if test "x$os_win32" = "xyes"; then
620                 dnl Don't pointlessly auto-export the global symbols
621                 dnl from a potentially static libiconv.a
622                 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
623         fi
624         have_iconv="yes"
625 else
626         LIBS="$save_LIBS"
627         AC_CHECK_FUNC(iconv, [have_iconv=yes], [have_iconv=no])
628 fi
629
630 if test "x$have_iconv" = "xyes"; then
631         if test "x$ac_cv_libiconv" = "xno"; then
632                 AC_CHECK_FUNCS(gnu_get_libc_version)
633         fi
634 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
635         AC_RUN_IFELSE([AC_LANG_SOURCE([[
636                 #include <iconv.h>
637                 #include <stdlib.h>
638                 #include <string.h>
639                 #ifdef HAVE_GNU_GET_LIBC_VERSION
640                 #include <gnu/libc-version.h>
641                 #endif
642                 int main() {
643                         char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
644                         char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
645                         char *transbuf = malloc (10), *trans = transbuf;
646                         iconv_t cd;
647                         size_t jp_len = strlen (jp), utf8_len = 10;
648                         size_t utf8_real_len = strlen (utf8);
649
650                         #ifdef HAVE_GNU_GET_LIBC_VERSION
651                         /* glibc 2.1.2's iconv is broken in hard to test ways. */
652                         if (!strcmp (gnu_get_libc_version (), "2.1.2"))
653                                 exit (1);
654                         #endif
655
656                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
657                         if (cd == (iconv_t) -1)
658                                 exit (1);
659                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
660                                 exit (1);
661                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
662                                 exit (1);
663                         return (0);}
664                 ]])
665         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
666 fi
667
668 if test "x$have_iconv" = "xno"; then
669         AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
670 fi
671 AC_SUBST(ICONV_LIBS)
672
673 CFLAGS="$CFLAGS -I$srcdir"
674
675 AC_MSG_CHECKING([preferred charset name formats for system iconv])
676 AC_RUN_IFELSE([AC_LANG_SOURCE([[
677         #define CONFIGURE_IN
678         #include "iconv-detect.c"
679         ]])],
680         [AC_MSG_RESULT([found])],
681         [AC_MSG_RESULT([not found])
682                 AC_MSG_WARN([
683                 *** The iconv-detect program was unable to determine the
684                 *** preferred charset name formats recognized by your
685                 *** iconv library. It is suggested that you install a
686                 *** working iconv library such as the one found at
687                 *** ftp://ftp.gnu.org/pub/gnu/libiconv
688         ])],
689         [if test "x$os_win32" = xyes; then
690                 AC_MSG_RESULT([using known win32 result])
691                 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
692                 echo  >>iconv-detect.h
693                 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
694                 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
695                 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
696         else
697                 AC_MSG_RESULT([unknown])
698                 AC_MSG_WARN([
699                 *** We can't determine the preferred charset name formats
700                 *** recognized by your iconv library. You are
701                 *** cross-compiling and supposed to know what you are doing.
702                 *** Please construct the iconv-detect.h file manually.
703                 ])
704         fi
705 ])
706
707 CFLAGS="$save_CFLAGS"
708 LIBS="$save_LIBS"
709
710 AC_ARG_ENABLE([backtraces],
711         [AS_HELP_STRING([--enable-backtraces],
712         [enable backtraces for camel_pointer_tracker (default=no)])],
713         [enable_backtraces=$enableval], [enable_backtraces=no])
714
715 if test "x$enable_backtraces" = xyes; then
716         dnl ****************************
717         dnl Check for backtrace_symbols function and dwfl from elfutils
718         dnl ****************************
719         AC_MSG_CHECKING([libc backtrace_symbols function])
720         AC_LINK_IFELSE([AC_LANG_PROGRAM(
721                 [[#include <execinfo.h>]],
722                 [[{ void *bt[1]; backtrace_symbols (bt, backtrace(bt, 1)); }]])],
723                 [AC_DEFINE(HAVE_BACKTRACE_SYMBOLS, 1, [libc provides backtrace_symbols function]) ac_cv_have_bsf=yes],[ac_cv_have_bsf=no])
724         AC_MSG_RESULT([$ac_cv_have_bsf])
725
726         if test "x$ac_cv_have_bsf" = xyes; then
727                 LIBS="$LIBS -ldw"
728
729                 AC_MSG_CHECKING([elfutils/libdwfl])
730                 AC_LINK_IFELSE([AC_LANG_PROGRAM(
731                         [[#include <elfutils/libdwfl.h>]],
732                         [[{
733                                 Dwfl *dwfl;
734                                 Dwfl_Module *module;
735                                 Dwarf_Addr module_low_addr;
736                                 Dwfl_Line *line;
737
738                                 dwfl_standard_find_debuginfo;
739                                 dwfl_linux_proc_find_elf;
740                                 dwfl_begin (NULL);
741                                 dwfl_linux_proc_report (NULL, 1);
742                                 dwfl_report_end (NULL, NULL, NULL);
743                                 dwfl_end (NULL);
744                                 dwfl_module_addrname (NULL, NULL);
745                                 dwfl_module_getsrc (NULL, NULL);
746                                 dwfl_lineinfo (NULL, NULL, NULL, NULL, NULL, NULL);
747                                 DWARF_CB_ABORT; DWARF_CB_OK;
748                                 dwfl_getmodules (NULL, NULL, NULL, 0);
749                         }]])],
750                         [AC_DEFINE(HAVE_ELFUTILS_LIBDWFL, 1, [have elfutils/libdwfl.h functions]) ac_cv_have_elfdwfl=yes],[ac_cv_have_elfdwfl=no])
751                 AC_MSG_RESULT([$ac_cv_have_elfdwfl])
752
753                 LIBS="$save_LIBS"
754
755                 if test "x$ac_cv_have_elfdwfl" = xyes; then
756                         LIBDWFL_LIBS="-ldw"
757                         AC_SUBST(LIBDWFL_LIBS)
758                 fi
759         fi
760 fi
761
762 dnl ******************************
763 dnl Check for nl_langinfo features
764 dnl ******************************
765 EVO_CHECK_LANGINFO([CODESET])
766 EVO_CHECK_LANGINFO([_NL_ADDRESS_COUNTRY_AB2])
767
768 dnl *******************************************************
769 dnl Check to see if strftime supports the use of %l and %k
770 dnl *******************************************************
771 AC_MSG_CHECKING([for %l and %k support in strftime])
772 AC_RUN_IFELSE([AC_LANG_SOURCE(
773         [[      #include <stdlib.h>
774                 #include <string.h>
775                 #include <time.h>
776                 int main(int argc, char **argv) {
777                 char buf[10];
778                 time_t rawtime;
779                 struct tm *timeinfo;
780
781                 time(&rawtime);
782                 timeinfo=localtime(&rawtime);
783                 buf[0] = '\0';
784                 strftime(buf, 10, "%lx%k", timeinfo);
785
786                 if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
787                         exit(1);
788                 else
789                         exit(0);
790                 return 0;
791                 }
792         ]]
793         )],[AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
794 AC_MSG_RESULT([$ac_cv_lkstrftime])
795
796 dnl ********************************************************************************
797 dnl security extension support (SSL and S/MIME)
798 dnl
799 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
800 dnl needed by Camel (SSL and S/MIME).
801 dnl
802 dnl The Evolution security extensions are only built if these libraries are found
803 dnl ********************************************************************************
804 msg_smime="no"
805
806 AC_ARG_ENABLE([smime],
807         AS_HELP_STRING([--enable-smime],
808         [Enable SMIME support through Mozilla nss @<:@default=yes@:>@ ]),
809         [enable_smime="$enableval"],[enable_smime="yes"])
810
811 AC_ARG_WITH([nspr-includes],
812         AS_HELP_STRING([--with-nspr-includes],
813         [Prefix of Mozilla nspr4 includes.]),
814         [with_nspr_includes="$withval"])
815
816 AC_ARG_WITH([nspr-libs],
817         AS_HELP_STRING([--with-nspr-libs],
818         [Prefix of Mozilla nspr4 libs.]),
819         [with_nspr_libs="$withval"])
820
821 AC_ARG_WITH([nss-includes],
822         AS_HELP_STRING([--with-nss-includes],
823         [Prefix of Mozilla nss3 includes.]),
824         [with_nss_includes="$withval"])
825
826 AC_ARG_WITH([nss-libs],
827         AS_HELP_STRING([--with-nss-libs],
828         [Prefix of Mozilla nss3 libs.]),
829         [with_nss_libs="$withval"])
830
831 if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}"; then
832         check_manually="yes"
833 else
834         check_manually="no"
835 fi
836
837 dnl check if pkg-config files exist (which are only shipped by distributions, not upstream)
838 if test "x${check_manually}" = "xno"; then
839         AC_MSG_CHECKING(Mozilla NSPR pkg-config module name)
840         mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
841         for pc in $mozilla_nspr_pcs; do
842                 if $PKG_CONFIG --exists $pc; then
843                         AC_MSG_RESULT($pc)
844                         mozilla_nspr=$pc
845                         break;
846                 fi
847         done
848
849         AC_MSG_CHECKING(Mozilla NSS pkg-config module name)
850         mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
851         for pc in $mozilla_nss_pcs; do
852                 if $PKG_CONFIG --exists $pc; then
853                         AC_MSG_RESULT($pc)
854                         mozilla_nss=$pc
855                         break;
856                 fi
857         done
858
859         if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
860                 if test "x$enable_smime" = "xyes"; then
861                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
862                         msg_smime="yes"
863                 fi
864                 MANUAL_NSPR_CFLAGS=""
865                 MANUAL_NSPR_LIBS=""
866                 MANUAL_NSS_CFLAGS=""
867                 MANUAL_NSS_LIBS=""
868         else
869                 check_manually="yes"
870                 mozilla_nspr=""
871                 mozilla_nss=""
872         fi
873 fi
874
875 if test "x${check_manually}" = "xyes"; then
876 dnl ******************
877 dnl Check for NSPR 4
878 dnl ******************
879         AC_MSG_CHECKING([for Mozilla nspr4 includes])
880                 CPPFLAGS_save="$CPPFLAGS"
881                 if test -n "$with_nspr_includes"; then
882                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
883                 fi
884
885                 AC_CHECK_HEADERS(nspr.h prio.h,
886                 [moz_nspr_includes="yes"],[moz_nspr_includes="no"])
887                 CPPFLAGS="$CPPFLAGS_save"
888
889                 if test "x${moz_nspr_includes}" = "xyes"; then
890                         MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
891                 else
892                         AC_MSG_FAILURE([NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR.])
893                 fi
894         AC_MSG_RESULT([$moz_nspr_includes])
895
896         AC_MSG_CHECKING([for Mozilla nspr libraries])
897                 CFLAGS_save="$CFLAGS"
898                 LDFLAGS_save="$LDFLAGS"
899                 LIBS_save="$LIBS"
900                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
901
902                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
903                 LIBS="$nsprlibs"
904                 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
905                 if test -n "${with_nspr_libs}"; then
906                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
907                 else
908                         LDFLAGS="$LDFLAGS"
909                 fi
910
911                 AC_LINK_IFELSE([AC_LANG_CALL([],[PR_Init])],
912                 [moz_nspr_libs="yes"],[moz_nspr_libs="no"])
913
914                 CFLAGS="$CFLAGS_save"
915                 LDFLAGS="$LDFLAGS_save"
916                 LIBS="$LIBS_save"
917
918                 if test "x${moz_nspr_libs}" = "xyes"; then
919                         if test -n "${with_nspr_libs}"; then
920                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
921                         else
922                                 MANUAL_NSPR_LIBS="$nsprlibs"
923                         fi
924                 else
925                         AC_MSG_FAILURE([NSPR libs not found. Use --with-nspr-libs to specify the libdir of NSPR.])
926                 fi
927         AC_MSG_RESULT([$moz_nspr_libs])
928
929 dnl *****************
930 dnl Check for NSS 3
931 dnl *****************
932         AC_MSG_CHECKING([for Mozilla nss3 includes])
933                 CPPFLAGS_save="$CPPFLAGS"
934                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
935
936                 AC_CHECK_HEADERS(nss.h ssl.h smime.h,
937                 [moz_nss_includes="yes"],[moz_nss_includes="no"])
938                 CPPFLAGS="$CPPFLAGS_save"
939
940                 if test "x${moz_nss_includes}" = "xyes"; then
941                         MANUAL_NSS_CFLAGS="-I$with_nss_includes"
942                 else
943                         AC_MSG_FAILURE([NSS headers not found. Use --with-nss-includes to specify the include dir of NSS.])
944                 fi
945         AC_MSG_RESULT($moz_nss_includes)
946
947         AC_MSG_CHECKING([for Mozilla nss libraries])
948                 LDFLAGS_save="$LDFLAGS"
949                 LIBS_save="$LIBS"
950                 nsslibs="-lssl3 -lsmime3 -lnss3"
951
952                 LIBS="$nsslibs $nsprlibs"
953                 dnl Test to protect from giving libtool an -L , which results in failure (used below,too)
954                 if test -n "${with_nss_libs}"; then
955                         LDFLAGS="$LDFLAGS -L$with_nss_libs $MANUAL_NSPR_LIBS"
956                 else
957                         LDFLAGS="$LDFLAGS $LDFLAGS_NSPR $MANUAL_NSPR_LIBS"
958                 fi
959
960                 AC_LINK_IFELSE([AC_LANG_CALL([],[NSS_Init])],
961                 [moz_nss_libs="yes"],[moz_nss_libs="no"])
962                 LDFLAGS="$LDFLAGS_save"
963                 LIBS="$LIBS_save"
964
965                 if test "x${moz_nss_libs}" = "xyes"; then
966                         if test "x${enable_smime}" = "xyes"; then
967                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
968                                 msg_smime="yes"
969                         fi
970                         if test -n "${with_nss_libs}"; then
971                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
972                         else
973                                 MANUAL_NSS_LIBS="$nsslibs"
974                         fi
975                 else
976                         AC_MSG_FAILURE([NSS libs not found. Use --with-nss-libs to specify the libdir of NSS.])
977                 fi
978         AC_MSG_RESULT([$moz_nss_libs])
979
980         MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
981         MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
982 fi
983
984 AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno")
985
986 dnl For pkgconfig files.
987 AC_SUBST(mozilla_nss)
988 AC_SUBST(mozilla_nspr)
989
990 AC_SUBST(MANUAL_NSPR_CFLAGS)
991 AC_SUBST(MANUAL_NSPR_LIBS)
992 AC_SUBST(MANUAL_NSS_CFLAGS)
993 AC_SUBST(MANUAL_NSS_LIBS)
994
995 dnl ******************************
996 dnl system mail stuff
997 dnl ******************************
998 AC_PATH_PROG(SENDMAIL, sendmail, [/usr/sbin/sendmail], [/usr/sbin:/usr/lib])
999 AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
1000
1001 AC_MSG_CHECKING([system mail directory])
1002 if test -d /var/mail -a '!' -h /var/mail ; then
1003         system_mail_dir="/var/mail"
1004 else
1005         system_mail_dir="/var/spool/mail"
1006 fi
1007 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
1008
1009 case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
1010         d??????rw?)
1011                 CAMEL_LOCK_HELPER_USER=""
1012                 CAMEL_LOCK_HELPER_GROUP=""
1013                 system_mail_perm="world writable"
1014         ;;
1015         d???rw????)
1016                 CAMEL_LOCK_HELPER_USER=""
1017                 CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
1018                 system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
1019         ;;
1020         drw???????)
1021                 CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
1022                 CAMEL_LOCK_HELPER_GROUP=""
1023                 system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
1024         ;;
1025         *)
1026                 CAMEL_LOCK_HELPER_USER=""
1027                 CAMEL_LOCK_HELPER_GROUP=""
1028                 system_mail_perm="???"
1029         ;;
1030 esac
1031
1032 AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
1033 AC_SUBST(CAMEL_LOCK_HELPER_USER)
1034 AC_SUBST(CAMEL_LOCK_HELPER_GROUP)
1035
1036 dnl ******************************
1037 dnl Timezone checks
1038 dnl ******************************
1039 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
1040         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1041         [[      #include <time.h>       ]],
1042         [[
1043                 struct tm tm;
1044                 tm.tm_gmtoff = 1;
1045         ]]
1046         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
1047 if test "x$ac_cv_struct_tm_gmtoff" = "xyes"; then
1048         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
1049 else
1050         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
1051                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1052                 [[      #include <time.h> ]],
1053                 [[      timezone = 1;   ]]
1054                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
1055         if test "x$ac_cv_var_timezone" = "xyes"; then
1056                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
1057                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
1058                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1059                         [[      #include <time.h>       ]],
1060                         [[      altzone = 1; ]]
1061                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
1062                 if test "x$ac_cv_var_altzone" = "xyes"; then
1063                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
1064                 fi
1065         else
1066                 AC_MSG_ERROR([unable to find a way to determine timezone])
1067         fi
1068 fi
1069
1070 dnl ******************************
1071 dnl ctime_r prototype
1072 dnl ******************************
1073 AC_CACHE_CHECK([if ctime_r wants three arguments], [ac_cv_ctime_r_three_args],
1074 [
1075         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1076         [[      #include <time.h> ]],
1077         [[      char *buf;
1078                 time_t date;
1079                 ctime_r (&date, buf, 100); ]]
1080         )],[ac_cv_ctime_r_three_args=yes],[ac_cv_ctime_r_three_args=no])
1081 ])
1082
1083 if test "x$ac_cv_ctime_r_three_args" = "xyes" ; then
1084         AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
1085 fi
1086
1087 dnl ******************************
1088 dnl gethostbyname_r prototype
1089 dnl ******************************
1090 AC_CHECK_FUNCS(gethostbyname_r,[
1091 AC_CACHE_CHECK([if gethostbyname_r wants five arguments], [ac_cv_gethostbyname_r_five_args],
1092 [
1093         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1094         [[
1095                 #include "confdefs.h"
1096                 #include <sys/types.h>
1097                 #include <sys/socket.h>
1098                 #include <netinet/in.h>
1099                 #include <netdb.h>
1100                 #define BUFSIZE (sizeof(struct hostent)+10)
1101         ]],
1102         [[
1103                 struct hostent hent;
1104                 char buffer[BUFSIZE];
1105                 int bufsize=BUFSIZE;
1106                 int h_errno;
1107                 (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
1108         ]]
1109         )],[ac_cv_gethostbyname_r_five_args=yes],[ac_cv_gethostbyname_r_five_args=no])
1110 ])])
1111
1112 if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
1113         AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
1114 fi
1115
1116 dnl ******************************
1117 dnl gethostbyaddr_r prototype
1118 dnl ******************************
1119 AC_CHECK_FUNCS(gethostbyaddr_r,[
1120 AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], [ac_cv_gethostbyaddr_r_seven_args],
1121 [
1122         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1123         [[
1124                 #include "confdefs.h"
1125                 #include <sys/types.h>
1126                 #include <sys/socket.h>
1127                 #include <netinet/in.h>
1128                 #include <netdb.h>
1129                 #define BUFSIZE (sizeof(struct hostent)+10)
1130         ]],
1131         [[
1132                 struct hostent hent;
1133                 char buffer[BUFSIZE];
1134                 int bufsize=BUFSIZE;
1135                 int h_errno;
1136                 (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ]]
1137         )],[ac_cv_gethostbyaddr_r_seven_args=yes],[ac_cv_gethostbyaddr_r_seven_args=no])
1138 ])])
1139
1140 if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
1141         AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
1142 fi
1143
1144 dnl ******************************
1145 dnl stat(v)fs location/type
1146 dnl ******************************
1147 AC_CHECK_HEADER([sys/statvfs.h],
1148         [AC_DEFINE([HAVE_SYS_STATVFS_H], 1, [Have <sys/statvfs.h>])],,
1149         [[      #if HAVE_SYS_STATVFS_H
1150                 #include <sys/statvfs.h>
1151                 #endif
1152         ]])
1153 AC_CHECK_FUNCS(statvfs)
1154
1155 AC_CHECK_HEADER([sys/param.h],
1156         [AC_DEFINE([HAVE_SYS_PARAM_H], 1, [Have <sys/param.h>])],,
1157         [[      #if HAVE_SYS_PARAM_H
1158                 #include <sys/param.h>
1159                 #endif
1160         ]])
1161 AC_CHECK_HEADER([sys/mount.h],
1162         [AC_DEFINE([HAVE_SYS_MOUNT_H], 1, [Have <sys/mount.h>])],,
1163         [[      #if HAVE_SYS_MOUNT_H
1164                 #include <sys/mount.h>
1165                 #endif
1166         ]])
1167 AC_CHECK_FUNCS(statfs)
1168
1169 dnl ******************************
1170 dnl IPv6 support and getaddrinfo calls
1171 dnl ******************************
1172 AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], [ac_cv_have_addrinfo],
1173 [
1174         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1175         [[      #include "confdefs.h"
1176                 #include <sys/types.h>
1177                 #include <sys/socket.h>
1178                 #include <netinet/in.h>
1179                 #include <netdb.h>
1180                 #include <stddef.h>
1181         ]],
1182         [[      #ifndef NI_MAXHOST
1183                 #define NI_MAXHOST      1025
1184                 #endif
1185
1186                 #ifndef NI_MAXSERV
1187                 #define NI_MAXSERV      32
1188                 #endif
1189
1190                 struct addrinfo hints, *res;
1191                 struct sockaddr_in6 sin6;
1192                 int af = AF_INET6;
1193                 char host[NI_MAXHOST];
1194                 char serv[NI_MAXSERV];
1195
1196                 getaddrinfo ("www.ximian.com", NULL, &hints, &res);
1197                 freeaddrinfo (res);
1198                 getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ]]
1199         )],[ac_cv_have_addrinfo=yes],[ac_cv_have_addrinfo=no])
1200 ])
1201
1202 if test "x$ac_cv_have_addrinfo" = "xno" ; then
1203         AC_DEFINE(NEED_ADDRINFO,1,[Enable getaddrinfo emulation])
1204         if test "x$enable_ipv6" = "xyes" ; then
1205                 AC_MSG_ERROR([system doesn't support necessary interfaces for ipv6 support])
1206         fi
1207         msg_ipv6="no"
1208 else
1209         AC_ARG_ENABLE([ipv6],
1210         AS_HELP_STRING([--enable-ipv6=no/yes],
1211         [Enable support for resolving IPv6 addresses.]),
1212         [enable_ipv6=$enableval],[enable_ipv6=yes])
1213         if test "x$enable_ipv6" = "xyes"; then
1214                 msg_ipv6="yes"
1215                 AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
1216                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1217                 [[      #include "confdefs.h"
1218                         #include <sys/types.h>
1219                         #include <sys/socket.h>
1220                         #include <netinet/in.h>
1221                         #include <netdb.h>
1222                 ]],
1223                 [[      struct addrinfo hints;
1224                         hints.ai_flags = AI_ADDRCONFIG;
1225                 ]]
1226                 )],[AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])],[])
1227         else
1228                 msg_ipv6="no"
1229         fi
1230 fi
1231
1232 AM_CONDITIONAL(ENABLE_IPv6, [test "x$enable_ipv6" = "xyes"])
1233
1234 AC_CHECK_HEADER([wspiapi.h],
1235         [AC_DEFINE([HAVE_WSPIAPI_H], 1, [Have <wspiapi.h>])],,)
1236
1237 dnl **********************************
1238 dnl Weather calendar backend support
1239 dnl **********************************
1240 AC_MSG_CHECKING([if we should build the weather calendar backend])
1241 AC_ARG_ENABLE([weather],
1242         [AS_HELP_STRING([--enable-weather],
1243         [Build the weather calendar backend (default=yes)])],
1244         [use_gweather=$enableval], [use_gweather=yes])
1245
1246 AC_MSG_RESULT([$use_gweather])
1247 if test "x$use_gweather" = "xyes"; then
1248         PKG_CHECK_MODULES(
1249                 [LIBGWEATHER], [gweather-3.0 >= gweather_minimum_version],[],
1250                 [AC_MSG_ERROR([
1251
1252         gweather-3.0 not found (or version < gweather_minimum_version)
1253
1254         If you want to disable weather calendar support,
1255         please append --disable-weather to configure.
1256
1257         ])])
1258 fi
1259 AM_CONDITIONAL(ENABLE_WEATHER, [test $use_gweather = yes])
1260
1261 dnl ******************************
1262 dnl NNTP support.
1263 dnl ******************************
1264 AC_ARG_ENABLE([nntp],
1265         AS_HELP_STRING([--enable-nntp],
1266         [Build Usenet news (NNTP) backend]),
1267         [enable_nntp=$enableval],[enable_nntp=yes])
1268 if test "x$enable_nntp" = "xyes"; then
1269         AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend])
1270         msg_nntp="yes"
1271 else
1272         msg_nntp="no"
1273 fi
1274 AM_CONDITIONAL(ENABLE_NNTP, [test x$enable_nntp = xyes])
1275
1276 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
1277
1278 dnl ******************************
1279 dnl File locking
1280 dnl ******************************
1281 AC_ARG_ENABLE([dot-locking],
1282         AS_HELP_STRING([--enable-dot-locking=yes/no],
1283         [Enable support for locking mail files with dot locking]),
1284         [enable_dot_locking=$enableval],[enable_dot_locking=yes])
1285
1286 if test "x$os_win32" != "xyes" -a "x$enable_dot_locking" = "xyes"; then
1287         AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
1288         msg_dot="yes"
1289 else
1290         msg_dot="no"
1291 fi
1292
1293 AC_ARG_ENABLE([file-locking],
1294         AS_HELP_STRING([--enable-file-locking=fcntl/flock/no],
1295         [Enable support for locking mail files with file locking]),
1296         [],[enable_file_locking=fcntl])
1297
1298 if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xfcntl"; then
1299         AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
1300         msg_file="fcntl"
1301 else
1302         if test "x$os_win32" != "xyes" -a "x$enable_file_locking" = "xflock"; then
1303                 AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
1304                 msg_file="flock"
1305         else
1306                 msg_file="no"
1307         fi
1308 fi
1309
1310 dnl ******************************
1311 dnl sendmail operation
1312 dnl ******************************
1313 AC_MSG_CHECKING([for SunOS broken spool format])
1314 if test "x$host_os" = "xsunos" ; then
1315         with_broken_spool="yes"
1316 fi
1317
1318 AC_ARG_WITH([broken-spool],
1319         AS_HELP_STRING([--with-broken-spool=yes/no],
1320         [Using SunOS/Solaris sendmail which has a broken spool format]),
1321         [with_broken_spool=$enableval],[with_broken_spool=${with_broken_spool:=no}])
1322
1323 if test "x$with_broken_spool" = "xyes"; then
1324         AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
1325 fi
1326
1327 AC_MSG_RESULT([$with_broken_spool])
1328
1329 dnl ***********
1330 dnl Kerberos 5
1331 dnl ***********
1332 EVO_KRB5_SUPPORT(no)
1333
1334 dnl ******************************
1335 dnl Purify support
1336 dnl ******************************
1337 EVO_PURIFY_SUPPORT
1338
1339 dnl ******************************
1340 dnl LDAP support.
1341 dnl ******************************
1342 if test "x$os_win32" != "xyes"; then
1343         EVO_LDAP_CHECK(no)
1344         case $with_openldap in
1345         no)
1346                 msg_ldap="no"
1347         ;;
1348         *)
1349                 case $with_static_ldap in
1350                 yes)
1351                         msg_ldap="$with_openldap (static)"
1352                         ;;
1353                 *)
1354                         msg_ldap="$with_openldap (dynamic)"
1355                         ;;
1356                 esac
1357         esac
1358
1359 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
1360         if test "x$with_openldap" = "xno" ; then
1361                 EVO_SUNLDAP_CHECK(no)
1362                 case $with_sunldap in
1363                 no)
1364                         msg_ldap="no"
1365                         ;;
1366                 *)
1367                         case $with_static_sunldap in
1368                         yes)
1369                                 msg_ldap="$with_sunldap (static)"
1370                                 ;;
1371                         *)
1372                                 msg_ldap="$with_sunldap (dynamic)"
1373                                 ;;
1374                 esac
1375         esac
1376         else
1377                 with_sunldap="no"
1378         fi
1379         AM_CONDITIONAL(SUNLDAP, [test "$with_sunldap" != no])
1380
1381         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
1382 else
1383         dnl Win32 LDAP support
1384         LDAP_CFLAGS="-DLDAP_DEPRECATED"
1385         LDAP_LIBS="-lwldap32"
1386         AC_SUBST(LDAP_CFLAGS)
1387         AC_SUBST(LDAP_LIBS)
1388         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
1389         AM_CONDITIONAL(ENABLE_LDAP, true)
1390         AM_CONDITIONAL(SUNLDAP, false)
1391         msg_ldap="yes"
1392 fi
1393
1394 dnl ******************************
1395 dnl Utility macro to set compiler flags for a specific lib.
1396 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1397 dnl ******************************
1398 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1399         PKG_CHECK_MODULES([$1], [$2])
1400         $1_CFLAGS="[$]$1_CFLAGS $3 "
1401         $1_LIBS="[$]$1_LIBS $4 "
1402 ])
1403
1404 dnl ******************************
1405 dnl sqlite3 flags
1406 dnl ******************************
1407 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= sqlite_minimum_version])
1408
1409 if test "x$enable_maintainer_mode" = "xyes" ; then
1410         EVO_SET_COMPILE_FLAGS(FACTORY_GTK, "gtk+-3.0")
1411         AC_SUBST(FACTORY_GTK_CFLAGS)
1412         AC_SUBST(FACTORY_GTK_LIBS)
1413 fi
1414
1415 dnl ******************************
1416 dnl libedataserver flags
1417 dnl ******************************
1418 E_DATA_SERVER_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libxml-2.0 libsoup-2.4 $mozilla_nspr"
1419
1420 EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $MANUAL_NSPR_CFLAGS, $MANUAL_NSPR_LIBS)
1421 AC_SUBST(E_DATA_SERVER_CFLAGS)
1422 AC_SUBST(E_DATA_SERVER_LIBS)
1423
1424 dnl ******************************
1425 dnl libebackend flags
1426 dnl ******************************
1427 E_BACKEND_DEPS="gio-2.0 gmodule-2.0 libsecret-1 libsoup-2.4 libxml-2.0"
1428
1429 EVO_SET_COMPILE_FLAGS(E_BACKEND, $E_BACKEND_DEPS)
1430 AC_SUBST(E_BACKEND_CFLAGS)
1431 AC_SUBST(E_BACKEND_LIBS)
1432
1433 dnl ******************************
1434 dnl evolution-addressbook flags
1435 dnl ******************************
1436 EVOLUTION_ADDRESSBOOK_DEPS="gio-2.0 libxml-2.0 libsoup-2.4 libsecret-1"
1437
1438 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
1439 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
1440 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
1441
1442 dnl ******************************
1443 dnl evolution-calendar flags
1444 dnl ******************************
1445 EVOLUTION_CALENDAR_DEPS="gio-2.0 libical >= libical_minimum_version libsoup-2.4 libxml-2.0 libsecret-1"
1446
1447 dnl *****
1448 dnl libical.pc from libical-0.43 has a bug in it's CFlags.
1449 dnl It wants apps to include <libical/ical*.h> but it's CFlags make it difficult
1450 dnl to differentiate between <libical/ical.h> and <ical.h>
1451 dnl We have fixed all our instances to use <libical/ical.h>. Until the .pc from
1452 dnl libical is fixed, we have to work-around the buggy CFlags.
1453 dnl *****
1454         LIBICAL_EXTRA_CFLAGS=" -I`$PKG_CONFIG --variable=includedir libical` "
1455         LIBICAL_EXTRA_LIBS=""
1456         AC_SUBST(LIBICAL_EXTRA_CFLAGS)
1457         AC_SUBST(LIBICAL_EXTRA_LIBS)
1458
1459         EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
1460         AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
1461         AC_SUBST(EVOLUTION_CALENDAR_LIBS)
1462
1463         dnl ****************************
1464         dnl Check for ical_set_unknown_token_handling_setting function
1465         dnl ****************************
1466         AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1467         save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
1468         save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
1469         AC_LINK_IFELSE([AC_LANG_PROGRAM(
1470                 [[#include <libical/ical.h>]],
1471                 [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1472                 [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])
1473         CFLAGS=$save_cflags
1474         LIBS=$save_libs
1475         AC_MSG_RESULT([$ac_cv_have_iuth])
1476
1477 dnl ******************************
1478 dnl Google flags
1479 dnl ******************************
1480 LIBGDATA_REQUIRED=libgdata_minimum_version
1481 AC_SUBST(LIBGDATA_REQUIRED)
1482 AC_ARG_ENABLE([google],
1483         [AS_HELP_STRING([--enable-google],
1484         [enable Google Contacts support (default=yes)])],
1485         [enable_google=$enableval], [enable_google=yes])
1486 AC_MSG_CHECKING([if Google Contacts support is enabled])
1487 AC_MSG_RESULT([$enable_google])
1488 if test "x$enable_google" = xyes; then
1489         EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= libgdata_minimum_version)
1490         AC_SUBST(GDATA_CFLAGS)
1491         AC_SUBST(GDATA_LIBS)
1492
1493         AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if you have the google-1.0 package.])
1494 fi
1495 AM_CONDITIONAL(HAVE_GOOGLE, [test x$enable_google = xyes])
1496
1497 EVO_SET_COMPILE_FLAGS(SOUP, libsoup-2.4)
1498 AC_SUBST(SOUP_CFLAGS)
1499 AC_SUBST(SOUP_LIBS)
1500
1501 dnl ******************************
1502 dnl Camel flags
1503 dnl ******************************
1504 SQLITE_REQUIRED=sqlite_minimum_version
1505 AC_SUBST(SQLITE_REQUIRED)
1506
1507 zlib_found="false"
1508 dnl deflateInit is a #define, use deflateEnd instead
1509 AC_CHECK_LIB([z], [deflateEnd], [AC_CHECK_HEADER(zlib.h, [zlib_found=true])])
1510
1511 if test "x$zlib_found" = "xfalse"; then
1512         AC_MSG_ERROR([*** zlib is required])
1513 fi
1514
1515 dnl ******************************
1516 dnl Checks for large file support
1517 dnl ******************************
1518 AC_ARG_ENABLE([largefile],
1519         AS_HELP_STRING([--enable-largefile],
1520         [enable support for large files [[default=yes]]]),
1521         [],[enable_largefile="yes"])
1522
1523 if test "x$enable_largefile" != "xno"; then
1524         AC_SYS_LARGEFILE
1525         AC_CACHE_CHECK([for _LARGEFILE64_SOURCE value needed for large files], [ac_cv_largefile64_source],
1526         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1527         [[      #include <sys/types.h>
1528                 #include <sys/stat.h>
1529                 #include <fcntl.h>
1530         ]],
1531         [[      int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);  ]]
1532         )],[ac_cv_largefile64_source="no"],
1533                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1534                 [[      #define _LARGEFILE64_SOURCE
1535                         #include <sys/types.h>
1536                         #include <sys/stat.h>
1537                         #include <fcntl.h>
1538                 ]],
1539                 [[ int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644); ]])],[ac_cv_largefile64_source="yes"],
1540                 [ac_cv_largefile64_source="unknown"])])
1541         ])
1542
1543         enable_largefile="no"
1544
1545         if test "x$ac_cv_largefile64_source" = "xyes"; then
1546                 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE"
1547                 enable_largefile="yes"
1548         elif test "x$ac_cv_largefile64_source" = "xunknown"; then
1549                 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1550         fi
1551
1552         if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
1553                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES"
1554                 enable_largefile="yes"
1555         fi
1556
1557         if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
1558                 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
1559                 enable_largefile="yes"
1560         fi
1561 else
1562         AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
1563         LARGEFILE_CFLAGS=""
1564 fi
1565
1566 AM_CONDITIONAL(ENABLE_LARGEFILE, [test "x$enable_largefile" = "xyes"])
1567
1568 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)
1569 AC_SUBST(CAMEL_CFLAGS)
1570 AC_SUBST(CAMEL_LIBS)
1571
1572 dnl ******************************
1573 dnl Special directories
1574 dnl ******************************
1575
1576 dnl If you add something here, consider whether or not you also
1577 dnl need to add it to one or more .pc.in files (for Connector,
1578 dnl etc)
1579
1580 privdatadir='${datadir}'/evolution-data-server
1581 AC_SUBST(privdatadir)
1582
1583 privincludedir='${includedir}'/evolution-data-server
1584 AC_SUBST(privincludedir)
1585
1586 privlibdir='${libdir}'/evolution-data-server
1587 AC_SUBST(privlibdir)
1588
1589 imagesdir='${datadir}'/pixmaps/evolution-data-server
1590 AC_SUBST(imagesdir)
1591
1592 moduledir='${privlibdir}'/registry-modules
1593 AC_SUBST(moduledir)
1594
1595 ebook_backenddir='${privlibdir}'/addressbook-backends
1596 AC_SUBST(ebook_backenddir)
1597
1598 ecal_backenddir='${privlibdir}'/calendar-backends
1599 AC_SUBST(ecal_backenddir)
1600
1601 ro_sourcesdir='${privdatadir}'/ro-sources
1602 AC_SUBST(ro_sourcesdir)
1603
1604 rw_sourcesdir='${privdatadir}'/rw-sources
1605 AC_SUBST(rw_sourcesdir)
1606
1607 if test "x$use_gweather" = "xyes"; then
1608         weatherdatadir="$privdatadir/weather"
1609         AC_SUBST(weatherdatadir)
1610 fi
1611
1612 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
1613 camel_providerdir='${privlibdir}'/camel-providers
1614 AC_SUBST(camel_providerdir)
1615
1616 dnl *******************
1617 dnl D-BUS service stuff
1618 dnl *******************
1619 m4_pattern_allow([AM_V_GEN])
1620 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)|" $< > $@'
1621 AC_SUBST(EVO_SUBST_SERVICE_RULE)
1622
1623 dnl ******************************
1624 dnl GLib stuff
1625 dnl ******************************
1626 GLIB_GSETTINGS
1627 AM_PATH_GLIB_2_0
1628
1629 dnl ******************************
1630 dnl gperf stuff
1631 dnl ******************************
1632 AC_PATH_PROG(GPERF, gperf, [no])
1633 if test "x$GPERF" = "xno"; then
1634   AC_MSG_ERROR([You need gperf to build evolution-data-server])
1635 fi
1636
1637 GOBJECT_INTROSPECTION_CHECK([0.9.12])
1638
1639 dnl ******************************
1640 dnl Vala binding
1641 dnl ******************************
1642 AC_ARG_ENABLE(vala-bindings,
1643         AC_HELP_STRING([--enable-vala-bindings],
1644         [build the EXPERIMENTAL Vala bindings]),
1645         enable_vala_bindings=$enableval,
1646         enable_vala_bindings=no)
1647
1648 if test x$enable_vala_bindings = xyes; then
1649   if test "x$INTROSPECTION_SCANNER" = x; then
1650     AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])
1651   fi
1652
1653   AM_PROG_VALAC([0.13.0])
1654   have_vala=yes
1655
1656   AC_PATH_PROG(VALAC, valac, valac)
1657   AC_SUBST(VALAC)
1658   AC_SUBST(VALAFLAGS)
1659
1660   AC_PATH_PROG([VAPIGEN], [vapigen], [false])
1661
1662   if test "x$VAPIGEN" = "xfalse"; then
1663     AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])
1664   fi
1665
1666   AC_SUBST(VAPIGEN)
1667 fi
1668
1669 AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"])
1670 AC_SUBST(HAVE_VALA)
1671
1672 dnl ******************************
1673 dnl Makefiles
1674 dnl ******************************
1675 export privlibdir
1676 export privincludedir
1677 export privdatadir
1678
1679 AC_CONFIG_FILES([
1680 Makefile
1681 evolution-data-server-zip
1682 evolution-data-server.pc
1683 addressbook/Makefile
1684 addressbook/libebook/Makefile
1685 addressbook/libebook/libebook.pc
1686 addressbook/libebook-contacts/Makefile
1687 addressbook/libebook-contacts/libebook-contacts.pc
1688 addressbook/libedata-book/Makefile
1689 addressbook/libedata-book/libedata-book.pc
1690 addressbook/libegdbus/Makefile
1691 addressbook/backends/Makefile
1692 addressbook/backends/file/Makefile
1693 addressbook/backends/ldap/Makefile
1694 addressbook/backends/google/Makefile
1695 addressbook/backends/google/tests/Makefile
1696 addressbook/backends/webdav/Makefile
1697 art/Makefile
1698 calendar/Makefile
1699 calendar/libecal/Makefile
1700 calendar/libecal/libecal.pc
1701 calendar/libedata-cal/Makefile
1702 calendar/libedata-cal/libedata-cal.pc
1703 calendar/libegdbus/Makefile
1704 calendar/backends/Makefile
1705 calendar/backends/caldav/Makefile
1706 calendar/backends/file/Makefile
1707 calendar/backends/http/Makefile
1708 calendar/backends/contacts/Makefile
1709 calendar/backends/weather/Makefile
1710 camel/Makefile
1711 camel/providers/Makefile
1712 camel/providers/imapx/Makefile
1713 camel/providers/local/Makefile
1714 camel/providers/nntp/Makefile
1715 camel/providers/pop3/Makefile
1716 camel/providers/sendmail/Makefile
1717 camel/providers/smtp/Makefile
1718 camel/tests/Makefile
1719 camel/tests/folder/Makefile
1720 camel/tests/lib/Makefile
1721 camel/tests/message/Makefile
1722 camel/tests/mime-filter/Makefile
1723 camel/tests/misc/Makefile
1724 camel/tests/smime/Makefile
1725 camel/camel.pc
1726 data/Makefile
1727 libebackend/Makefile
1728 libebackend/libebackend.pc
1729 libedataserver/Makefile
1730 libedataserver/eds-version.h
1731 libedataserver/libedataserver.pc
1732 modules/Makefile
1733 modules/cache-reaper/Makefile
1734 modules/gnome-online-accounts/Makefile
1735 modules/google-backend/Makefile
1736 modules/owncloud-backend/Makefile
1737 modules/ubuntu-online-accounts/Makefile
1738 modules/ubuntu-online-accounts/calendar.service-type.in
1739 modules/ubuntu-online-accounts/contacts.service-type.in
1740 modules/ubuntu-online-accounts/evolution-data-server.application.in
1741 modules/ubuntu-online-accounts/evolution-data-server-uoa.desktop.in
1742 modules/ubuntu-online-accounts/google-calendar.service.in
1743 modules/ubuntu-online-accounts/google-contacts.service.in
1744 modules/ubuntu-online-accounts/google-gmail.service.in
1745 modules/ubuntu-online-accounts/mail.service-type.in
1746 modules/ubuntu-online-accounts/yahoo-calendar.service.in
1747 modules/ubuntu-online-accounts/yahoo-mail.service.in
1748 modules/trust-prompt/Makefile
1749 modules/yahoo-backend/Makefile
1750 private/Makefile
1751 services/Makefile
1752 services/evolution-addressbook-factory/Makefile
1753 services/evolution-calendar-factory/Makefile
1754 services/evolution-source-registry/Makefile
1755 services/evolution-user-prompter/Makefile
1756 tests/Makefile
1757 tests/libebook/Makefile
1758 tests/libebook-contacts/Makefile
1759 tests/libebook/client/Makefile
1760 tests/libebook/vcard/Makefile
1761 tests/libecal/Makefile
1762 tests/libecal/client/Makefile
1763 tests/libedata-cal/Makefile
1764 tests/libedataserver/Makefile
1765 tests/test-server-utils/Makefile
1766 tests/test-server-utils/services/Makefile
1767 tests/test-server-utils/services/org.gnome.evolution.dataserver.AddressBook.service
1768 tests/test-server-utils/services/org.gnome.evolution.dataserver.Calendar.service
1769 tests/test-server-utils/services/org.gnome.evolution.dataserver.Sources.service
1770 docs/Makefile
1771 docs/reference/Makefile
1772 docs/reference/addressbook/Makefile
1773 docs/reference/addressbook/libebook/Makefile
1774 docs/reference/addressbook/libebook-contacts/Makefile
1775 docs/reference/addressbook/libedata-book/Makefile
1776 docs/reference/calendar/Makefile
1777 docs/reference/calendar/libecal/Makefile
1778 docs/reference/calendar/libedata-cal/Makefile
1779 docs/reference/camel/Makefile
1780 docs/reference/libedataserver/Makefile
1781 docs/reference/libebackend/Makefile
1782 docs/reference/private/Makefile
1783 po/Makefile.in
1784 vala/Makefile
1785 ])
1786 AC_OUTPUT
1787
1788 echo "
1789         evolution-data-server has been configured as follows:
1790         Weather calendar:       $use_gweather
1791         Mail Directory:         $system_mail_dir, $system_mail_perm
1792         LDAP support:           $msg_ldap
1793         NNTP support:           $msg_nntp
1794         Kerberos 5:             $msg_krb5
1795         SMIME support:          $msg_smime
1796         IPv6 support:           $msg_ipv6
1797         Phone number support:   $msg_phonenumber
1798         Dot Locking:            $msg_dot
1799         File Locking:           $msg_file
1800         Large files:            $enable_largefile
1801         Gtk Doc:                $enable_gtk_doc
1802         Introspection:          $enable_introspection
1803         Vala bindings:          $enable_vala_bindings
1804         GNOME Online Accounts   $enable_goa
1805         Ubuntu Online Accounts  $enable_uoa
1806         Google Contacts         $enable_google
1807         GTK+:                   $enable_gtk
1808         Code coverage (gcov):   $enable_code_coverage
1809         Strict building:        $enable_strict
1810 "