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