Updated Brazilian Portuguese translation
[evolution.git] / configure.ac
blobb268d9acb14a5bc6fa16c5b0f7a13b60651bc605
1 dnl Evolution Versions
2 m4_define([evo_major_version], [3])
3 m4_define([evo_minor_version], [19])
4 m4_define([evo_micro_version], [91])
5 m4_define([evo_version],
6         [evo_major_version.evo_minor_version.evo_micro_version])
7 m4_define([evo_stable_version],
8         [m4_if(m4_eval(evo_minor_version % 2), [1],
9         [evo_major_version.m4_eval(evo_minor_version - 1)],
10         [evo_version])])
12 dnl Base Version: This is for API/version tracking for things like
13 dnl Bonobo server files.  This should always be the major/minor of
14 dnl the stable version or stable version to be.  Note, this is set
15 dnl the way it is so that GETTEXT_PACKAGE will be parsed correctly.
16 BASE_VERSION=3.20
17 m4_define([base_version], [3.20])
19 dnl Autoconf / Automake Initialization
20 AC_PREREQ([2.64])
21 AC_INIT([evolution],[evo_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution],[evolution],[http://wiki.gnome.org/Apps/Evolution/])
22 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip subdir-objects -Wall -Wno-portability foreign tar-ustar])
23 AC_CONFIG_MACRO_DIR([m4])
24 AC_CONFIG_HEADERS(config.h)
25 AC_CONFIG_SRCDIR(README)
27 dnl This is for the autoconf tests only - it set's the language we use
28 AC_LANG(C)
30 dnl Automake 1.11 - Silent Build Rules
31 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33 dnl Required Packages
35 dnl Keep these two definitions in agreement.
36 m4_define([glib_minimum_version], [2.40.0])
37 m4_define([glib_encoded_version], [GLIB_VERSION_2_40])
39 dnl Keep these two definitions in agreement.
40 m4_define([gdk_minimum_version], [3.10.0])
41 m4_define([gdk_encoded_version], [GDK_VERSION_3_10])
43 dnl Keep these two definitions in agreement.
44 m4_define([soup_minimum_version], [2.42])
45 m4_define([soup_encoded_version], [SOUP_VERSION_2_42])
47 m4_define([eds_minimum_version], [evo_version])
48 m4_define([gdk_pixbuf_minimum_version], [2.24.0])
49 m4_define([gcr_minimum_version], [3.4])
50 m4_define([enchant_minimum_version], [1.1.7])
51 m4_define([gnome_desktop_minimum_version], [2.91.3])
52 m4_define([gsettings_desktop_schemas_minimum_version], [2.91.92])
53 m4_define([webkitgtk_minimum_version], [2.2.0])
54 m4_define([libxml_minimum_version], [2.7.3])
55 m4_define([shared_mime_info_minimum_version], [0.22])
56 m4_define([libpst_minimum_version], [0.6.54])
58 dnl Optional Packages
59 m4_define([champlain_minimum_version], [0.12])
60 m4_define([clutter_gtk_minimum_version], [0.90])
61 m4_define([geocode_glib_minimum_version], [3.10])
62 m4_define([gladeui_minimum_version], [3.10.0])
63 m4_define([gweather_minimum_version], [3.10])
64 m4_define([gnome_autoar_minimum_version], [0.1])
65 m4_define([libcanberra_gtk_minimum_version], [0.25])
66 m4_define([libnotify_minimum_version], [0.7])
68 dnl ******************************
69 dnl Initialize maintainer mode
70 dnl ******************************
71 AM_MAINTAINER_MODE([enable])
73 dnl ******************************
74 dnl Compiler Warning Flags
75 dnl ******************************
76 proposed_warning_flags=
78 if test "x$enable_maintainer_mode" = "xyes" ; then
79         proposed_warning_flags="-Wall -Wextra -Wdeprecated-declarations"
80 else
81         proposed_warning_flags="-Wno-deprecated-declarations"
84 AS_COMPILER_FLAGS(WARNING_FLAGS,
85         "$proposed_warning_flags
86         -Wno-missing-field-initializers
87         -Wno-sign-compare
88         -Wno-unused-parameter
89         -Wdeclaration-after-statement
90         -Werror-implicit-function-declaration
91         -Wformat -Wformat-security -Winit-self
92         -Wmissing-declarations -Wmissing-include-dirs
93         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
94         -Wredundant-decls -Wundef -Wwrite-strings")
95 AC_SUBST(WARNING_FLAGS)
97 dnl Other useful compiler warnings for test builds only.
98 dnl These may produce warnings we have no control over,
99 dnl or false positives we don't always want to see.
101 dnl     -Wmissing-format-attribute
102 dnl     -Wshadow
103 dnl     -Wformat-nonliteral
104 dnl     -Wstrict-aliasing=2
106 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
108 if test "x$enable_maintainer_mode" = "xyes" ; then
109          AM_CPPFLAGS="$AM_CPPFLAGS -DEDS_DISABLE_DEPRECATED"
112 dnl Warn about API usage that violates our minimum requirements.
113 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
114 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
115 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
117 dnl These will suppress warnings about newly-deprecated symbols.  Ideally
118 dnl these settings should match our minimum requirements and we will clean
119 dnl up any new deprecation warnings after bumping our minimum requirements.
120 dnl But if the warnings get to be overwhelming, use fixed versions instead.
121 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
122 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2"
123 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
125 AC_SUBST(AM_CPPFLAGS)
127 AC_CANONICAL_HOST
128 AC_DEFINE_UNQUOTED(VERSION_COMMENT, "", [Define if you want a comment appended to the version number])
130 dnl This must stay after AC_CANONICAL_HOST, which defines $host.
131 case "$host" in
132 *openbsd*|*freebsd*)
133         dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
134         ;;
136         LDFLAGS="$LDFLAGS -Wl,--no-undefined"
137         ;;
138 esac
141 dnl *************************************
142 dnl Put the ACLOCAL flags in the Makefile
143 dnl *************************************
144 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
146 if test "$evo_version" != "$evo_stable_version"; then
147         AC_DEFINE(STABLE_VERSION, ["evo_stable_version"],
148                 [Define to the latest stable version if this version is unstable])
151 AC_SUBST([BASE_VERSION], [base_version])
152 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
154 AC_SUBST([EVO_MAJOR_VERSION], [evo_major_version])
155 AC_SUBST([EVO_MINOR_VERSION], [evo_minor_version])
156 AC_SUBST([EVO_MICRO_VERSION], [evo_micro_version])
158 AC_PROG_CC
159 AC_C_INLINE
160 AC_PROG_CPP
161 AM_PROG_CC_C_O
162 AC_PROG_INSTALL
163 AC_PROG_LN_S
164 AC_PROG_MAKE_SET
165 AC_PROG_AWK
166 AC_PATH_PROG([PERL], [perl])
167 AC_SUBST(PERL)
169 AC_ARG_PROGRAM
171 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
172 dnl behavior that -- according to the C99 standard -- is supposed to be
173 dnl undefined.  We may still have aliasing abuses lying around that rely
174 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
175 dnl optimzation until we can find and fix all the abuses.
176 dnl (AC_PROG_CC must run first to set the GCC variable.)
177 dnl XXX This really belongs in AM_CFLAGS.
178 if test "x${GCC}" = "xyes"; then
179         CFLAGS="$CFLAGS -fno-strict-aliasing"
182 GLIB_GSETTINGS
184 dnl ******************************
185 dnl I18N stuff
186 dnl ******************************
187 IT_PROG_INTLTOOL([0.40.0])
189 GETTEXT_PACKAGE=evolution-$BASE_VERSION
190 AC_SUBST(GETTEXT_PACKAGE)
191 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
193 dnl ******************************
194 dnl Initialize libtool
195 dnl ******************************
196 LT_PREREQ(2.2)
197 LT_INIT(disable-static win32-dll)
199 PKG_PROG_PKG_CONFIG
201 GNOME_CODE_COVERAGE
203 dnl ********************************************
204 dnl User / Developer Documentation
205 dnl ********************************************
206 YELP_HELP_INIT
207 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
209 dnl ******************************
210 dnl Win32
211 dnl ******************************
212 AC_MSG_CHECKING([for Win32])
213 case "$host" in
214 *-mingw*)
215         os_win32=yes
216         NO_UNDEFINED='-no-undefined'
217         SOEXT='.dll'
218         DL_LIB=''
219         SOFTOKN3_LIB=''
220         CHAMPLAIN_REQUIREMENT=''
221         GIO_UNIX_REQUIREMENT=''
222         ;;
223 *openbsd*|*freebsd*)
224         os_win32=no
225         NO_UNDEFINED=''
226         SOEXT='.so'
227         SA_JUNK_PLUGIN=sa-junk-plugin
228         BF_JUNK_PLUGIN=bogo-junk-plugin
229         DL_LIB=''
230         SOFTOKN3_LIB='-lsoftokn3'
231         GIO_UNIX_REQUIREMENT='gio-unix-2.0'
232         ;;
234         os_win32=no
235         NO_UNDEFINED='-no-undefined'
236         SOEXT='.so'
237         DL_LIB='-ldl'
238         SOFTOKN3_LIB='-lsoftokn3'
239         GIO_UNIX_REQUIREMENT='gio-unix-2.0'
240         ;;
241 esac
242 AC_MSG_RESULT([$os_win32])
243 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
244 AC_SUBST(NO_UNDEFINED)
245 AC_SUBST(SOEXT)
247 MATH_LIB="-lm"
248 AC_SUBST(MATH_LIB)
250 if test "$os_win32" = "yes"; then
251         AC_CHECK_TOOL(WINDRES, windres, :)
252 else
253         WINDRES=":"
256 AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
258 AC_SUBST(WINDRES)
260 dnl **********************************
261 dnl Check for functions
262 dnl **********************************
263 AC_CHECK_FUNCS(nl_langinfo)
265 dnl **********************************
266 dnl Check for nl_langinfo features
267 dnl **********************************
268 EVO_CHECK_LANGINFO([_NL_MEASUREMENT_MEASUREMENT])
270 dnl **********************************
271 dnl Check for base dependencies early.
272 dnl **********************************
273 PKG_CHECK_MODULES([GNOME_PLATFORM],
274         [gio-2.0 >= glib_minimum_version
275          gmodule-2.0 >= glib_minimum_version
276          cairo-gobject
277          gtk+-3.0 >= gdk_minimum_version
278          gail-3.0 >= gdk_minimum_version
279          gdk-pixbuf-2.0 >= gdk_pixbuf_minimum_version
280          gcr-3 >= gcr_minimum_version
281          libxml-2.0 >= libxml_minimum_version
282          shared-mime-info >= shared_mime_info_minimum_version
283          gsettings-desktop-schemas >= gsettings_desktop_schemas_minimum_version
284          webkitgtk-3.0 >= webkitgtk_minimum_version
285          $GIO_UNIX_REQUIREMENT])
287 GNOME_DESKTOP_DEPENDENCY=""
288 AC_ARG_ENABLE([gnome-desktop],
289         [AS_HELP_STRING([--enable-gnome-desktop],
290         [Enable GNOME desktop dependency for thumbnails @<:@default=yes@:>@])],
291         [enable_gnome_desktop="$enableval"], [enable_gnome_desktop=yes])
293 if test "$enable_gnome_desktop" = "yes"; then
294         GNOME_DESKTOP_DEPENDENCY=gnome-desktop-3.0
295         PKG_CHECK_MODULES([GNOME_DESKTOP], [$GNOME_DESKTOP_DEPENDENCY >= gnome_desktop_minimum_version])
296         GNOME_PLATFORM_CFLAGS="$GNOME_PLATFORM_CFLAGS $GNOME_DESKTOP_CFLAGS"
297         GNOME_PLATFORM_LIBS="$GNOME_PLATFORM_LIBS $GNOME_DESKTOP_LIBS"
298         AC_DEFINE(HAVE_GNOME_DESKTOP, 1, [gnome-desktop])
300 AC_SUBST(GNOME_DESKTOP_DEPENDENCY)
301 AC_SUBST(GNOME_PLATFORM_CFLAGS)
302 AC_SUBST(GNOME_PLATFORM_LIBS)
304 PKG_CHECK_MODULES([EVOLUTION_DATA_SERVER],
305         [camel-1.2 >= eds_minimum_version
306          libebook-1.2 >= eds_minimum_version
307          libecal-1.2 >= eds_minimum_version
308          libedataserver-1.2 >= eds_minimum_version
309          libedataserverui-1.2 >= eds_minimum_version
310          libebackend-1.2 >= eds_minimum_version])
311 AC_SUBST(EVOLUTION_DATA_SERVER_CFLAGS)
312 AC_SUBST(EVOLUTION_DATA_SERVER_LIBS)
314 dnl **************************************************
315 dnl wait.h is not available on win32
316 dnl **************************************************
318 AC_CHECK_HEADERS(sys/wait.h, AC_DEFINE(HAVE_SYS_WAIT_H, 1, [Have <sys/wait.h>]))
320 dnl ****************
321 dnl Enchant Library
322 dnl ****************
323 PKG_CHECK_MODULES([ENCHANT],
324         [enchant >= enchant_minimum_version])
325 AC_SUBST(ENCHANT_CFLAGS)
326 AC_SUBST(ENCHANT_LIBS)
328 dnl ******************************
329 dnl Canberra / Canberra-GTK Sound
330 dnl ******************************
331 AC_ARG_ENABLE([canberra],
332         [AS_HELP_STRING([--enable-canberra],
333         [Enable Canberra and Canberra-GTK sound @<:@default=yes@:>@])],
334         [enable_canberra="$enableval"], [enable_canberra=yes])
336 if test $enable_canberra = yes; then
337         PKG_CHECK_MODULES(
338                 [CANBERRA],
339                 [libcanberra-gtk3 >= libcanberra_gtk_minimum_version],,
340                 [AC_MSG_ERROR([
342         libcanberra-gtk3 not found (or version < libcanberra_gtk_minimum_version)
344         If you want to disable support for event sounds,
345         please append --disable-canberra to configure.
347         ])])
349         AC_DEFINE(HAVE_CANBERRA, 1, [Define if using Canberra and Canberra-GTK for sound])
351 AC_SUBST(CANBERRA_CFLAGS)
352 AC_SUBST(CANBERRA_LIBS)
354 dnl ***********************************
355 dnl Archives Integration / gnome-autoar
356 dnl ***********************************
357 AC_ARG_ENABLE([autoar],
358         [AS_HELP_STRING([--enable-autoar],
359         [Enable archives support in attachments @<:@default=yes@:>@])],
360         [enable_autoar="$enableval"], [enable_autoar=yes])
362 if test x"$enable_autoar" = xyes; then
363         PKG_CHECK_MODULES(
364                 [AUTOAR],
365                 [gnome-autoar >= gnome_autoar_minimum_version
366                  gnome-autoar-gtk >= gnome_autoar_minimum_version],,
367                 [AC_MSG_ERROR([
369         gnome-autoar or gnome-autoar-gtk not found
370         (or version < gnome_autoar_minimum_version)
372         If you want to disable support for automatic archives handling,
373         please append --disable-autoar to configure.
375         ])])
377         AC_DEFINE(HAVE_AUTOAR, 1, [Define if gnome-autoar is enabled])
379 AC_SUBST(AUTOAR_CFLAGS)
380 AC_SUBST(AUTOAR_LIBS)
382 dnl ******************
383 dnl User Documentation
384 dnl ******************
385 AC_MSG_CHECKING([whether to build user documentation])
386 AC_ARG_WITH([help],
387         [AS_HELP_STRING([--with-help],
388         [Build user documentation [default=yes]])],
389         [with_help="$withval"],[with_help="yes"])
390 AM_CONDITIONAL(WITH_HELP, test "x$with_help" != "xno")
391 AC_MSG_RESULT([$with_help])
393 dnl ******************************
394 dnl iconv checking
395 dnl ******************************
396 have_iconv=no
397 save_LIBS="$LIBS"
398 LIBS="$LIBS -liconv"
399 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
400         AC_LINK_IFELSE([AC_LANG_PROGRAM(
401         [[
402                 #include <iconv.h>
403                 #include <stdlib.h>
404         ]],
405         [[      iconv_t cd;
406                 cd = iconv_open ("UTF-8", "ISO-8859-1");
407         ]]
408         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
410 if test $ac_cv_libiconv = yes; then
411         ICONV_LIBS="-liconv"
412         if test $os_win32 = yes; then
413                 dnl Don't pointlessly auto-export the global symbols
414                 dnl from a potentially static libiconv.a
415                 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
416         fi
417         have_iconv=yes
418 else
419         LIBS="$save_LIBS"
420         AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
423 if test $have_iconv = yes; then
424         if test $ac_cv_libiconv = no; then
425                 AC_CHECK_FUNCS(gnu_get_libc_version)
426         fi
427 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
428         AC_RUN_IFELSE([AC_LANG_SOURCE([[
429                 #include <iconv.h>
430                 #include <stdlib.h>
431                 #include <string.h>
432                 #ifdef HAVE_GNU_GET_LIBC_VERSION
433                 #include <gnu/libc-version.h>
434                 #endif
435                 int main() {
436                         char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
437                         char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
438                         char *transbuf = malloc (10), *trans = transbuf;
439                         iconv_t cd;
440                         size_t jp_len = strlen (jp), utf8_len = 10;
441                         size_t utf8_real_len = strlen (utf8);
443                         #ifdef HAVE_GNU_GET_LIBC_VERSION
444                         /* glibc 2.1.2's iconv is broken in hard to test ways. */
445                         if (!strcmp (gnu_get_libc_version (), "2.1.2"))
446                                 exit (1);
447                         #endif
449                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
450                         if (cd == (iconv_t) -1)
451                                 exit (1);
452                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
453                                 exit (1);
454                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
455                                 exit (1);
456                         return (0);}
457                 ]])
458         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
461 if test "$have_iconv" = no; then
462         AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
464 AC_SUBST(ICONV_LIBS)
466 save_CFLAGS="$CFLAGS"
467 CFLAGS="$CFLAGS -I$srcdir"
469 AC_MSG_CHECKING([preferred charset name formats for system iconv])
470 AC_RUN_IFELSE([AC_LANG_SOURCE([[
471         #define CONFIGURE_IN
472         #include "iconv-detect.c"
473         ]])],
474         [AC_MSG_RESULT([found])],
475         [AC_MSG_RESULT([not found])
476                 AC_MSG_WARN([
477                 *** The iconv-detect program was unable to determine the
478                 *** preferred charset name formats recognized by your
479                 *** iconv library. It is suggested that you install a
480                 *** working iconv library such as the one found at
481                 *** ftp://ftp.gnu.org/pub/gnu/libiconv
482         ])],
483         [if test x$os_win32 = xyes; then
484                 AC_MSG_RESULT([using known win32 result])
485                 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
486                 echo  >>iconv-detect.h
487                 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
488                 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
489                 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
490         else
491                 AC_MSG_RESULT([unknown])
492                 AC_MSG_WARN([
493                 *** We can't determine the preferred charset name formats
494                 *** recognized by your iconv library. You are
495                 *** cross-compiling and supposed to know what you are doing.
496                 *** Please construct the iconv-detect.h file manually.
497                 ])
498         fi
501 CFLAGS="$save_CFLAGS"
502 LIBS="$save_LIBS"
504 dnl **************
505 dnl waitpid() etc
506 dnl **************
507 AC_HEADER_SYS_WAIT
509 dnl ***************
510 dnl Purify support
511 dnl ***************
512 EVO_PURIFY_SUPPORT
514 dnl ***************
515 dnl Timezone checks
516 dnl ***************
517 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
518         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
519         [[      #include <time.h>       ]],
520         [[
521                 struct tm tm;
522                 tm.tm_gmtoff = 1;
523         ]]
524         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
525 if test $ac_cv_struct_tm_gmtoff = yes; then
526         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
527 else
528         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
529                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
530                 [[      #include <time.h> ]],
531                 [[      timezone = 1;   ]]
532                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
533         if test $ac_cv_var_timezone = yes; then
534                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
535                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
536                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
537                         [[      #include <time.h>       ]],
538                         [[      altzone = 1; ]]
539                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
540                 if test $ac_cv_var_altzone = yes; then
541                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
542                 fi
543         else
544                 AC_MSG_ERROR([unable to find a way to determine timezone])
545         fi
549 AC_CHECK_FUNCS(mkdtemp)
551 dnl **************************************************
552 dnl iso-codes
553 dnl **************************************************
554 AC_MSG_CHECKING([for iso-codes package])
555 have_iso_codes=no
556 if $PKG_CONFIG --exists iso-codes; then
557         if $PKG_CONFIG iso-codes --atleast-version=0.49; then
558                 have_iso_codes=yes
559                 AC_MSG_RESULT([$have_iso_codes])
560         else
561                 AC_MSG_WARN([iso-codes detected, but version 0.49 or later is required due to licensing])
562         fi
563 else
564         AC_MSG_RESULT([$have_iso_codes])
567 if test "x$have_iso_codes" = "xyes"; then
568         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
569         if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null 2>&1 && \
570                 $PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null 2>&1 ; then
571                         result=yes
572         else
573                 result=no
574                 have_iso_codes=no
575         fi
576         AC_MSG_RESULT([$result])
579 if test "x$have_iso_codes" = "xyes"; then
580         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
581                 ["`$PKG_CONFIG --variable=prefix iso-codes`"],
582                 [ISO codes prefix])
583         AC_DEFINE([HAVE_ISO_CODES], [1],
584                 [Define if you have the iso-codes package])
587 dnl **************************************************
588 dnl Accessibility support
589 dnl **************************************************
590 PKG_CHECK_MODULES([A11Y], [atk])
591 AC_SUBST(A11Y_CFLAGS)
592 AC_SUBST(A11Y_LIBS)
594 dnl **************************************************
595 dnl XF86 multimedia keys support
596 dnl **************************************************
597 have_xfree=no
598 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
599         [[ #include <X11/XF86keysym.h> ]],[[]])],
600         [have_xfree=yes]
602 AC_MSG_CHECKING([for X11 XFree86 headers])
603 AC_MSG_RESULT([$have_xfree])
604 if test x"$have_xfree" = "xyes" ; then
605         AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
608 dnl **************************************************
609 dnl LDAP support.
610 dnl **************************************************
611 if test "$os_win32" != yes; then
612         EVO_LDAP_CHECK(no)
613         case $with_openldap in
614         no)
615                 msg_ldap=no
616                 ;;
617         *)
618                 case $with_static_ldap in
619                 yes)
620                         msg_ldap="yes (static)"
621                 ;;
622                 *)
623                         msg_ldap="yes (dynamic)"
624                         ;;
625                 esac
626         esac
628         SAVE_CFLAGS="$CFLAGS"
629         SAVE_LIBS="$LIBS"
630         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
631         CFLAGS="$CFLAGS $LDAP_CFLAGS"
632         LIBS="$LIBS $LDAP_LIBS"
633         AC_CHECK_FUNCS(ldap_ntlm_bind)
634         CFLAGS="$SAVE_CFLAGS"
635         LIBS="$SAVE_LIBS"
636 dnl Win32 support
637 else
638         LDAP_CFLAGS="-DLDAP_DEPRECATED"
639         LDAP_LIBS="-lwldap32"
640         AC_SUBST(LDAP_CFLAGS)
641         AC_SUBST(LDAP_LIBS)
642         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
643         AM_CONDITIONAL(ENABLE_LDAP, true)
644         msg_ldap="yes"
647 dnl **************************************************
648 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
649 dnl **************************************************
650 if test "$with_openldap" = no ; then
651         EVO_SUNLDAP_CHECK(no)
652         case $with_sunldap in
653         no)
654                 msg_ldap=no
655                 ;;
656         *)
657                 case $with_static_sunldap in
658                 yes)
659                         msg_ldap="$with_sunldap (static)"
660                         ;;
661                 *)
662                         msg_ldap="$with_sunldap (dynamic)"
663                         ;;
664                 esac
665         esac
666 else
667         with_sunldap=no
669 AM_CONDITIONAL(SUNLDAP, [test x$with_sunldap != xno])
671 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
673 dnl ********************************************************************************
674 dnl security extension support (SSL and S/MIME)
676 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
677 dnl needed by Camel (SSL and S/MIME).
679 dnl The Evolution security extensions are only built if these libraries are found
680 dnl ********************************************************************************
681 msg_ssl="no"
682 msg_smime="no"
684 dnl these 2 enable's are inverses of each other
686 AC_ARG_ENABLE([nss],
687         AS_HELP_STRING([--enable-nss=@<:@yes/no/static@:>@],
688         [Attempt to use Mozilla libnss for SSL support.]),
689         [enable_nss=$enableval],[enable_nss=yes])
691 AC_ARG_ENABLE([smime],
692         AS_HELP_STRING([--enable-smime],
693         [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
694         [enable_smime=$enableval],[enable_smime=yes])
696 AC_ARG_WITH([nspr-includes],
697         AS_HELP_STRING([--with-nspr-includes=PATH],
698         [Location of Mozilla nspr4 includes.]))
700 AC_ARG_WITH([nspr-libs],
701         AS_HELP_STRING([--with-nspr-libs=PATH],
702         [Location of Mozilla nspr4 libs.]))
704 AC_ARG_WITH([nss-includes],
705         AS_HELP_STRING([--with-nss-includes=PATH],
706         [Location of Mozilla nss3 includes.]))
708 AC_ARG_WITH([nss-libs],
709         AS_HELP_STRING([--with-nss-libs=PATH],
710         [Location of Mozilla nss3 libs.]))
712 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
713         if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}" || test "x${enable_nss}" = "xstatic"; then
714                 check_manually="yes"
715         else
716                 check_manually="no"
717         fi
719         if test "x${check_manually}" = "xno"; then
720                 AC_MSG_CHECKING([Mozilla NSPR pkg-config module name])
721                 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
722                 for pc in $mozilla_nspr_pcs; do
723                         if $PKG_CONFIG --exists $pc; then
724                                 AC_MSG_RESULT([$pc])
725                                 mozilla_nspr=$pc
726                                 break;
727                         fi
728                 done
730                 AC_MSG_CHECKING([Mozilla NSS pkg-config module name])
731                 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
732                 for pc in $mozilla_nss_pcs; do
733                         if $PKG_CONFIG --exists $pc; then
734                                 AC_MSG_RESULT([$pc])
735                                 mozilla_nss=$pc
736                                 break;
737                         fi
738                 done
740                 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
741                         msg_ssl="yes (Mozilla NSS)"
742                         if test "x$enable_smime" = "xyes"; then
743                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
744                                 msg_smime="yes (Mozilla NSS)"
745                         fi
746                         AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
747                         AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
748                         AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"`$PKG_CONFIG --variable=libdir $mozilla_nss`",[Define to the full path of mozilla nss library])
749                         MANUAL_NSPR_CFLAGS=""
750                         MANUAL_NSPR_LIBS=""
751                         MANUAL_NSS_CFLAGS=""
752                         MANUAL_NSS_LIBS=""
753                 else
754                         check_manually="yes"
755                         mozilla_nspr=""
756                         mozilla_nss=""
757                 fi
758         fi
760         if test "x${check_manually}" = "xyes"; then
761                 mozilla_nss=""
762                 have_nspr_includes="no"
763                 if test "x${with_nspr_includes}" != "xno"; then
764                         CPPFLAGS_save="$CPPFLAGS"
766                         AC_MSG_CHECKING([for Mozilla nspr4 includes in $with_nspr_includes])
767                         AC_MSG_RESULT([""])
769                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
770                         AC_CHECK_HEADERS([nspr.h prio.h],[ moz_nspr_includes="yes" ],,
771                         [[
772                                 #if HAVE_NSPR_H
773                                 #include <nspr.h>
774                                 #include <prio.h>
775                                 #endif
776                         ]])
777                         CPPFLAGS="$CPPFLAGS_save"
779                         if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
780                                 have_nspr_includes="yes"
781                                 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
782                         fi
783                 else
784                         AC_MSG_CHECKING([for Mozilla nspr4 includes])
785                         AC_MSG_RESULT([no])
786                 fi
788                 have_nspr_libs="no"
789                 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
790                         CFLAGS_save="$CFLAGS"
791                         LDFLAGS_save="$LDFLAGS"
793                         if test "$enable_nss" = "static"; then
794                                 if test -z "${with_nspr_libs}"; then
795                                         AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
796                                         [Please specify the path to libnspr4.a]
797                                         [Example: --with-nspr-libs=/usr/lib])
798                                 else
799                                         nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a"
800                                 fi
801                         else
802                                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
803                         fi
805                         AC_CACHE_CHECK([for Mozilla nspr libraries], [ac_cv_moz_nspr_libs],
806                         [
807                                 LIBS_save="$LIBS"
808                                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
810                                 if test "x${with_nspr_libs}" != "x"; then
811                                         LIBS="$nsprlibs"
812                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
813                                 else
814                                         LIBS="$nsprlibs"
815                                         LDFLAGS="$LDFLAGS"
816                                 fi
818                                 AC_LINK_IFELSE([AC_LANG_CALL([], [PR_Init])],
819                                 [ac_cv_moz_nspr_libs="yes"], [ac_cv_moz_nspr_libs="no"])
820                                 CFLAGS="$CFLAGS_save"
821                                 LDFLAGS="$LDFLAGS_save"
822                                 LIBS="$LIBS_save"
823                         ])
824                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
825                                 have_nspr_libs="yes"
826                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
827                         else
828                                 MANUAL_NSPR_CLFAGS=""
829                         fi
830                 else
831                         AC_MSG_CHECKING([for Mozilla nspr4 libraries])
832                         AC_MSG_RESULT([no])
833                 fi
835                 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
836                         CPPFLAGS_save="$CPPFLAGS"
838                         AC_MSG_CHECKING([for Mozilla nss3 includes in $with_nss_includes])
839                         AC_MSG_RESULT([""])
841                         if test "x${with_nspr_includes}" != "x"; then
842                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
843                         else
844                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
845                         fi
847                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
848                                 [ have_nss_includes="yes" ],
849                                 [ have_nss_includes="no" ],
850                                 [
851                                         #if HAVE_NSPR_H
852                                         #include <nss.h>
853                                         #include <ssl.h>
854                                         #include <smime.h>
855                                         #endif
856                                 ])
858                         CPPFLAGS="$CPPFLAGS_save"
860                         if test "x${have_nss_includes}" = "xyes"; then
861                                 have_nss_includes="yes"
862                                 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
863                         else
864                                 MANUAL_NSPR_CFLAGS=""
865                                 MANUAL_NSPR_LIBS=""
866                         fi
867                 else
868                         AC_MSG_CHECKING([for Mozilla nss3 includes])
869                         AC_MSG_RESULT([no])
870                 fi
872                 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
873                         LDFLAGS_save="$LDFLAGS"
875                         if test "$enable_nss" = "static"; then
876                                 if test -z "${with_nss_libs}"; then
877                                         AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
878                                         [Please specify the path to libnss3.a]
879                                         [Example: --with-nspr-libs=/usr/lib/mozilla])
880                                 else
881                                         nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
882                                         case "$host" in
883                                                 *solaris*)
884                                                 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
885                                         ;;
886                                         esac
887                                 fi
888                         else
889                                 nsslibs="-lssl3 -lsmime3 -lnss3"
890                         fi
892                         AC_CACHE_CHECK([for Mozilla nss libraries], [ac_cv_moz_nss_libs],
893                         [
894                                 LIBS_save="$LIBS"
895                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
896                                 LIBS="$nsslibs $nsprlibs"
897                                 AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
898                                 [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
899                                 if test "$ac_cv_moz_nss_libs" = no; then
900                                         nsslibs="-lssl3 -lsmime3 -lnss3"
901                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
902                                         AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
903                                         [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
904                                 fi
905                                 LDFLAGS="$LDFLAGS_save"
906                                 LIBS="$LIBS_save"
907                         ])
908                         if test "$ac_cv_moz_nss_libs" != no; then
909                                 AC_DEFINE(HAVE_NSS)
910                                 AC_DEFINE(HAVE_SSL)
911                                 AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"$with_nss_libs", [Define to the full path of mozilla nss library])
912                                 if test "$enable_nss" = "static"; then
913                                         msg_ssl="yes (Mozilla NSS:static)"
914                                 else
915                                         msg_ssl="yes (Mozilla NSS)"
916                                 fi
917                                 dnl static_nss
918                                 if test "$enable_smime" = "yes"; then
919                                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
920                                         msg_smime="yes (Mozilla NSS)"
921                                 fi
922                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
923                         else
924                                 MANUAL_NSS_CFLAGS=""
925                                 MANUAL_NSPR_CFLAGS=""
926                                 MANUAL_NSPR_LIBS=""
927                         fi
928                 else
929                         AC_MSG_CHECKING([for Mozilla nss libraries])
930                         AC_MSG_RESULT([no])
931                 fi
933                 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
934                 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
935         fi
938 AM_CONDITIONAL(ENABLE_SMIME, [test "x$msg_smime" != "xno"])
940 AC_SUBST(MANUAL_NSPR_CFLAGS)
941 AC_SUBST(MANUAL_NSPR_LIBS)
942 AC_SUBST(MANUAL_NSS_CFLAGS)
943 AC_SUBST(MANUAL_NSS_LIBS)
945 dnl ******************************
946 dnl libcryptui, aka Seahorse
947 dnl ******************************
948 AC_ARG_ENABLE([libcryptui],
949         [AS_HELP_STRING([--enable-libcryptui],
950         [Enable libcryptui usage @<:@default=yes@:>@])],
951         [enable_libcryptui="$enableval"], [enable_libcryptui=yes])
953 if test "x$enable_libcryptui" = "xyes"; then
954         PKG_CHECK_MODULES(
955                 [LIBCRYPTUI],
956                 [cryptui-0.0],,
957                 [AC_MSG_ERROR([
959         cryptui-0.0 not found
961         If you want to disable support libcryptui usage,
962         please append --disable-libcryptui to configure.
964         ])])
966         AC_DEFINE(HAVE_LIBCRYPTUI, 1, [Define if using libcryptui])
967 else
968         enable_libcryptui=no
970 AC_SUBST(LIBCRYPTUI_CFLAGS)
971 AC_SUBST(LIBCRYPTUI_LIBS)
973 dnl *****************
974 dnl killall or pkill?
975 dnl *****************
977 case "$host" in
978 *solaris*)
979         KILL_PROCESS_CMD="/usr/bin/pkill -x"
980         ;;
982         AC_PATH_PROGS(KILL_PROCESS_CMD, killall pkill)
983         ;;
984 esac
985 if test -z "$KILL_PROCESS_CMD"; then
986         AC_MSG_WARN([Could not find a command to kill a process by name])
987 else
988         AC_DEFINE_UNQUOTED([KILL_PROCESS_CMD], "$KILL_PROCESS_CMD",
989                 [Command to kill processes by name])
992 dnl *******************
993 dnl GObject marshalling
994 dnl *******************
995 AM_PATH_GLIB_2_0
997 dnl *****************************************************************
998 dnl Utility macro to set compiler flags for a specific lib.
999 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
1000 dnl *****************************************************************
1001 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
1002         PKG_CHECK_MODULES([$1], [$2])
1003         $1_CFLAGS="[$]$1_CFLAGS $3"
1004         $1_LIBS="[$]$1_LIBS $4"
1007 dnl ******************************
1008 dnl TNEF implementation
1009 dnl ******************************
1010 AC_MSG_CHECKING([for yTNEF])
1011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1012         [[
1013                 #include <stdio.h>
1014                 #include <ytnef.h>
1015         ]],
1016         [[      TNEFStruct *tnef;       ]]
1017         )],     [tnef_ok=yes], [tnef_ok=no])
1018 if test "$tnef_ok" = "yes"; then
1019         AC_MSG_RESULT([yes])
1020         TNEF_CFLAGS="-DHAVE_YTNEF_H"
1021         AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])
1022         
1023 else
1024         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1025         [[
1026                 #include <stdio.h>
1027                 #include <libytnef/ytnef.h>
1028         ]],
1029         [[      TNEFStruct *tnef;       ]]
1030         )], [tnef_ok=yes], [tnef_ok=no])
1031         if test "$tnef_ok" = "yes"; then
1032                 AC_MSG_RESULT([yes])
1033                 TNEF_CFLAGS="-DHAVE_LIBYTNEF_YTNEF_H"
1034                 AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])            
1035         else
1036                 AC_MSG_RESULT([no])
1037                 TNEF_CFLAGS=""
1038         fi
1040 AM_CONDITIONAL([ENABLE_TNEF], [test "$tnef_ok" = "yes"])
1041 AC_SUBST(TNEF_CFLAGS)
1043 if test "x$mozilla_nss" != "x"; then
1044         EVO_SET_COMPILE_FLAGS(MOZILLA_NSS, $mozilla_nss)
1045         MOZILLA_L_DIR=`${PKG_CONFIG} --libs-only-L $mozilla_nss`
1046 else
1047         if test "x$MOZILLA_MANUAL_LIBS" != "x"; then
1048                 MOZILLA_L_DIR="-L$with_nss_lib"
1049         fi
1052 dnl **********************************
1053 dnl Check for Bogofilter (spam filter)
1054 dnl **********************************
1055 AC_ARG_WITH([bogofilter],
1056         [AS_HELP_STRING([--with-bogofilter=yes/no/COMMAND],
1057         [enable spam filtering using Bogofilter (default=yes)])],
1058         [with_bogofilter=$withval], [with_bogofilter=yes])
1059 if test "x$with_bogofilter" != "xyes" -a "x$with_bogofilter" != "xno" ; then
1060         BOGOFILTER=$with_bogofilter
1061         with_bogofilter=yes
1063 AC_MSG_CHECKING([if Bogofilter support is enabled])
1064 AC_MSG_RESULT([$with_bogofilter])
1065 msg_bogofilter="$with_bogofilter"
1066 if test "x$with_bogofilter" = "xyes"; then
1067         AC_ARG_VAR([BOGOFILTER], [Bogofilter spam filtering program])
1068         if test "x$BOGOFILTER" = "x" ; then
1069                 BOGOFILTER="/usr/bin/bogofilter"
1070         fi
1071         AC_DEFINE_UNQUOTED(
1072                 BOGOFILTER_COMMAND, "$BOGOFILTER",
1073                 [Bogofilter spam filtering program])
1074         msg_bogofilter="$msg_bogofilter ($BOGOFILTER)"
1076 AM_CONDITIONAL([WITH_BOGOFILTER], [test "x$with_bogofilter" = "xyes"])
1078 dnl ************************************
1079 dnl Check for SpamAssassin (spam filter)
1080 dnl ************************************
1081 AC_ARG_WITH([spamassassin],
1082         [AS_HELP_STRING([--with-spamassassin=yes/no/COMMAND],
1083         [enable spam filtering using SpamAssassin (default=yes)])],
1084         [with_spamassassin=$withval], [with_spamassassin=yes])
1085 if test "x$with_spamassassin" != "xyes" -a "x$with_spamassassin" != "xno" ; then
1086         SPAMASSASSIN=$with_spamassassin
1087         with_spamassassin=yes
1089 AC_MSG_CHECKING([if SpamAssassin support is enabled])
1090 AC_MSG_RESULT([$with_spamassassin])
1091 msg_spamassassin="$with_spamassassin"
1092 if test "x$with_spamassassin" = "xyes"; then
1093         AC_ARG_VAR([SPAMASSASSIN], [SpamAssassin spam filtering program])
1094         if test "x$SPAMASSASSIN" = "x" ; then
1095                 SPAMASSASSIN="/usr/bin/spamassassin"
1096         fi
1097         AC_DEFINE_UNQUOTED(
1098                 SPAMASSASSIN_COMMAND, "$SPAMASSASSIN",
1099                 [SpamAssassin spam filtering program])
1101         AC_ARG_WITH([sa-learn],
1102                 AS_HELP_STRING([--with-sa-learn=COMMAND],
1103                 [Full path command where sa-learn is located; (default=/usr/bin/sa-learn)]),
1104                 [with_sa_learn="$withval"], [with_sa_learn=""])
1106         AC_ARG_VAR([SA_LEARN], [SpamAssassin spam training program])
1107         if test "x$with_sa_learn" != "x" ; then
1108                 SA_LEARN="$with_sa_learn"
1109         elif test "x$SA_LEARN" = "x" ; then
1110                 SA_LEARN="/usr/bin/sa-learn"
1111         fi
1112         AC_DEFINE_UNQUOTED(
1113                 SA_LEARN_COMMAND, "$SA_LEARN",
1114                 [SpamAssassin spam training program])
1116         msg_spamassassin="$msg_spamassassin ($SPAMASSASSIN $SA_LEARN)"
1118 AM_CONDITIONAL([WITH_SPAMASSASSIN], [test "x$with_spamassassin" = "xyes"])
1120 dnl ******************************
1121 dnl CERT_UI Flags
1122 dnl ******************************
1124 dnl Here we want the Mozilla flags to go *before* the other ones,
1125 dnl especially the mozilla-nss -I flags to go before the gnutls ones,
1126 dnl as both gnutls and mozilla-nss have a header called "pkcs12.h" which is
1127 dnl included in smime/lib/e-pkcs12.c. It wants the Mozilla NSS one.
1129 CERT_UI_CFLAGS="$MANUAL_NSS_CFLAGS $MOZILLA_NSS_CFLAGS"
1130 CERT_UI_LIBS="$MOZILLA_L_DIR $MANUAL_NSS_LIBS $MOZILLA_NSS_LIBS"
1131 AC_SUBST(CERT_UI_CFLAGS)
1132 AC_SUBST(CERT_UI_LIBS)
1134 dnl ***************
1135 dnl Libnotify Flags
1136 dnl ***************
1137 LIBNOTIFY_CFLAGS=
1138 LIBNOTIFY_LIBS=
1139 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= libnotify_minimum_version], [HAVE_LIBNOTIFY="yes"], [HAVE_LIBNOTIFY="no"])
1140 if test "x$HAVE_LIBNOTIFY" = "xyes"; then
1141         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if you have libnotify])
1142         libnotify="libnotify"
1143 else
1144         libnotify=""
1146 AC_SUBST(LIBNOTIFY_CFLAGS)
1147 AC_SUBST(LIBNOTIFY_LIBS)
1149 dnl **************
1150 dnl Calendar Flags
1151 dnl **************
1152 PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= soup_minimum_version])
1153 AC_SUBST(LIBSOUP_CFLAGS)
1154 AC_SUBST(LIBSOUP_LIBS)
1156 dnl ****************************
1157 dnl Check for ical_set_unknown_token_handling_setting function
1158 dnl ****************************
1159 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1160 save_cflags=$CFLAGS; CFLAGS="$EVOLUTION_DATA_SERVER_CFLAGS"
1161 save_libs=$LIBS; LIBS="$EVOLUTION_DATA_SERVER_LIBS"
1162 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1163         [[#include <libical/ical.h>]],
1164         [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1165         [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])
1166 CFLAGS=$save_cflags
1167 LIBS=$save_libs
1168 AC_MSG_RESULT([$ac_cv_have_iuth])
1170 dnl ****************************
1171 dnl Check for icaltzutil_set_exact_vtimezones_support function
1172 dnl ****************************
1173 AC_MSG_CHECKING([icaltzutil_set_exact_vtimezones_support function])
1174 save_cflags=$CFLAGS; CFLAGS="$EVOLUTION_DATA_SERVER_CFLAGS"
1175 save_libs=$LIBS; LIBS="$EVOLUTION_DATA_SERVER_LIBS"
1176 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1177         [[#include <libical/ical.h>]],
1178         [[icaltzutil_set_exact_vtimezones_support (0)]])],
1179         [AC_DEFINE(HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT, 1, [libical provides icaltzutil_set_exact_vtimezones_support function]) ac_cv_have_isevs=yes],[ac_cv_have_isevs=no])
1180 CFLAGS=$save_cflags
1181 LIBS=$save_libs
1182 AC_MSG_RESULT([$ac_cv_have_isevs])
1184 dnl ****************************
1185 dnl Check for gtkspell
1186 dnl ****************************
1187 AC_ARG_ENABLE([gtkspell],
1188         [AS_HELP_STRING([--enable-gtkspell],
1189         [Enable gtkspell @<:@default=yes@:>@])],
1190         [enable_gtkspell="$enableval"], [enable_gtkspell="yes"])
1192 if test "x$enable_gtkspell" = "xyes"; then
1193         PKG_CHECK_MODULES(
1194                 [GTKSPELL],
1195                 [gtkspell3-3.0],,
1196                 [AC_MSG_ERROR([
1198         gtkspell3-3.0 not found
1200         If you want to disable the gtkspell feature,
1201         please append --disable-gtkspell to configure.
1203         ])])
1205         AC_DEFINE(WITH_GTKSPELL, 1, [When defined spell checking is enabled])
1208 dnl *******************
1209 dnl Special directories
1210 dnl *******************
1212 dnl If you add something here, consider whether or not you also need to add it to one or more .pc.in
1213 dnl files (for Connector, etc)
1215 privlibdir='${libdir}'/evolution
1216 AC_SUBST(privlibdir)
1218 privlibexecdir='${libexecdir}'/evolution
1219 AC_SUBST(privlibexecdir)
1221 privdatadir='${datadir}'/evolution
1222 AC_SUBST(privdatadir)
1224 privincludedir='${includedir}'/evolution
1225 AC_SUBST(privincludedir)
1227 moduledir="$privlibdir/modules"
1228 AC_SUBST(moduledir)
1230 uidir="$privdatadir/ui"
1231 AC_SUBST(uidir)
1233 evolutionhelpdir="$privdatadir/help"
1234 AC_SUBST(evolutionhelpdir)
1236 icondir="$privdatadir/icons"
1237 AC_SUBST(icondir)
1239 imagesdir="$privdatadir/images"
1240 AC_SUBST(imagesdir)
1242 if test "$os_win32" = yes; then
1243         dnl On Win32 there is no "rpath" mechanism. We install the private
1244         dnl shared libraries in $libdir, meaning the DLLs will actually be in
1245         dnl $bindir. This means just having $bindir in PATH will be enough. This
1246         dnl also means gnome_win32_get_prefixes() will be able to deduce the
1247         dnl installation folder correctly.
1248         privsolibdir=$libdir
1249 else
1250         privsolibdir=$privlibdir
1252 AC_SUBST(privsolibdir)
1254 soundsdir="$privdatadir/sounds"
1255 AC_SUBST(soundsdir)
1257 etspecdir="$privdatadir/etspec"
1258 AC_SUBST(etspecdir)
1260 viewsdir="$privdatadir/views"
1261 AC_SUBST(viewsdir)
1263 dnl For evolution-alarm-notify.desktop
1264 AS_AC_EXPAND(PRIVLIBEXECDIR, "$privlibexecdir")
1266 dnl ************************
1267 dnl Plugins
1268 dnl ************************
1270 plugindir="$privlibdir/plugins"
1271 AC_SUBST(plugindir)
1273 EVO_PLUGIN_RULE=$srcdir/plugin.mk
1274 AC_SUBST_FILE(EVO_PLUGIN_RULE)
1276 AC_ARG_ENABLE([plugins],
1277         AS_HELP_STRING([--enable-plugins=[no/base/all]],
1278         [Enable plugins.]),
1279         [enable_plugins="$enableval"],[enable_plugins=all])
1281 dnl Add any new plugins here
1282 plugins_base_always="publish-calendar"
1284 plugins_base="$plugins_base_always"
1285 dist_plugins_base="$plugins_base_always"
1287 plugins_standard_always="bbdb save-calendar mail-to-task mailing-list-actions mail-notification attachment-reminder email-custom-header face templates dbx-import external-editor"
1289 plugins_standard="$plugins_standard_always"
1290 dist_plugins_standard="$plugins_standard pst-import"
1292 dnl ******************************************************************
1293 dnl The following plugins have additional library dependencies.
1294 dnl They must be explicitly disabled if the libraries are not present.
1295 dnl ******************************************************************
1297 dnl **************************************************
1298 dnl text-highlight plugins requires highlight utility
1299 dnl **************************************************
1300 AC_ARG_ENABLE([text-highlight],
1301         [AS_HELP_STRING([--enable-text-highlight],
1302         [Enable text-highlight plugin (default=yes)])],
1303         [enable_text_highlight="$enableval"], [enable_text_highlight=yes])
1304 AC_MSG_CHECKING([if source code highlighting support is enabled])
1305 AC_MSG_RESULT([$enable_text_highlight])
1306 msg_text_highlight="$enable_text_highlight"
1307 if test "x$enable_text_highlight" = "xyes"; then
1308         AC_ARG_VAR([HIGHLIGHT], [Source code highlighting utility])
1309         AC_PATH_PROG([HIGHLIGHT], [highlight])
1310         if test "x$HIGHLIGHT" = "x"; then
1311                 AC_MSG_ERROR([
1313         Highlight utility not found.
1315         If you want to disable syntax highlighting in emails,
1316         please append --disable-text-highlight to configure.
1318         ])
1319         fi
1320         AC_DEFINE_UNQUOTED(
1321                 HIGHLIGHT_COMMAND, "$HIGHLIGHT",
1322                 [Source code highlighting utility])
1324         msg_text_highlight="$msg_text_highlight ($HIGHLIGHT)"
1326 AM_CONDITIONAL([ENABLE_TEXT_HIGHLIGHT], [test "x$enable_text_highlight" = "xyes"])
1328 dnl **************************************
1329 dnl Weather calendars require gweather-3.0
1330 dnl **************************************
1331 AC_ARG_ENABLE([weather],
1332         [AS_HELP_STRING([--enable-weather],
1333         [Enable weather calendars @<:@default=yes@:>@])],
1334         [enable_weather="$enableval"],[enable_weather=yes])
1336 if test "x$enable_weather" != "xno"; then
1337         PKG_CHECK_MODULES(
1338                 [GWEATHER], [gweather-3.0 >= gweather_minimum_version],,
1339                 [AC_MSG_ERROR([
1341         gweather-3.0 not found (or version < gweather_minimum_version)
1343         If you want to disable weather calendar support,
1344         please append --disable-weather to configure.
1346         ])])
1348 AM_CONDITIONAL(ENABLE_WEATHER, [test "x$enable_weather" != "xno"])
1350 dnl ********************************************************************
1351 dnl maps in contacts preview requires champlain-gtk and clutter
1352 dnl ********************************************************************
1353 AC_ARG_ENABLE([contact-maps],
1354         [AS_HELP_STRING([--enable-contact-maps],
1355         [Enable contact maps @<:@default=no@:>@])],
1356         [enable_contact_maps="$enableval"], [enable_contact_maps="no"])
1358 if test "x$enable_contact_maps" = "xyes"; then
1359         PKG_CHECK_MODULES(
1360                 [CHAMPLAIN],
1361                 [champlain-gtk-0.12 >= champlain_minimum_version],,
1362                 [AC_MSG_ERROR([
1364         champlain-gtk-0.12 not found.
1366         If you want to disable the contact maps feature,
1367         please append --disable-contact-maps to configure.
1369         ])])
1371         PKG_CHECK_MODULES(
1372                 [GEO],
1373                 [geocode-glib-1.0 >= geocode_glib_minimum_version],,
1374                 [AC_MSG_ERROR([
1376         geocode-glib not found.
1378         If you want to disable the contact maps feature,
1379         please append --disable-contact-maps to configure.
1381         ])])
1383         PKG_CHECK_MODULES(
1384                 [CLUTTER_GTK],
1385                 [clutter-gtk-1.0 >= clutter_gtk_minimum_version],,
1386                 [AC_MSG_ERROR([
1388         clutter-gtk-1.0 not found (or version < clutter_gtk_minimum_version)
1390         If you want to disable the contact maps feature,
1391         please append --disable-contact-maps to configure.
1393         ])])
1395         AC_DEFINE(WITH_CONTACT_MAPS, 1, [When defined contacts preview will contain maps])
1398 dnl *********************************
1399 dnl pst-import plugin requires libpst
1400 dnl *********************************
1401 AC_ARG_ENABLE([pst-import],
1402         [AS_HELP_STRING([--enable-pst-import],
1403         [Enable pst-import plugin @<:@default=yes@:>@])],
1404         [enable_pst="$enableval"], [enable_pst=yes])
1406 if test "x$enable_pst" = "xyes"; then
1407         PKG_CHECK_MODULES(LIBPST, libpst >= libpst_minimum_version, have_pst=yes, have_pst=no)
1408         AC_SUBST(LIBPST_CFLAGS)
1409         AC_SUBST(LIBPST_LIBS)
1411         if test "x$have_pst" = "xyes"; then
1412                 plugins_standard="$plugins_standard pst-import"
1413         else
1414                 AC_MSG_ERROR([
1416         libpst not found (or version < libpst_minimum_version)
1418         If you want to disable PST importing support,
1419         please append --disable-pst-import to configure.
1421         ])
1422         fi
1425 case x"$enable_plugins" in
1426 xno)
1427         plugins_enabled=""
1428         msg_plugins="no (some core functionality will not be available)"
1429         ;;
1430 xall | x | xyes)
1431         plugins_enabled="$plugins_base $plugins_standard"
1432         msg_plugins="yes (all)"
1433         ;;
1434 xbase)
1435         plugins_enabled="$plugins_base"
1436         msg_plugins="yes ($plugins_base)"
1437         ;;
1439         AC_MSG_ERROR([Invalid value for --enable-plugins.
1440         Please specify either "no", "base", or "all" (default=all)])
1441         ;;
1442 esac
1444 AC_SUBST(plugins_enabled)
1445 AC_SUBST(dist_plugins_base)
1446 AC_SUBST(dist_plugins_standard)
1448 dnl ******************
1449 dnl Sub-version number
1450 dnl ******************
1451 AC_ARG_WITH([sub-version],
1452         AS_HELP_STRING([--with-sub-version=VERSION],
1453         [Specify a sub-version string]))
1455 AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version", [Version substring, for packagers])
1457 dnl ********************************************
1458 dnl Glade 3 catalog files (for maintainers only)
1459 dnl ********************************************
1460 AC_ARG_WITH([glade-catalog],
1461         [AS_HELP_STRING([--with-glade-catalog],
1462         [Install the catalog files for Glade 3 ]
1463         [(for maintainers only) [default=no]])],
1464         [with_catalog="$withval"], [with_catalog="no"])
1465 if test "$with_catalog" = "yes"; then
1466         PKG_CHECK_MODULES(GLADEUI, [gladeui-2.0 >= gladeui_minimum_version])
1468 AM_CONDITIONAL(GLADE_CATALOG, test "x$with_catalog" != "xno")
1470 dnl ********************************************
1471 dnl Installed tests
1472 dnl ********************************************
1473 BEHAVE_INSTALLED_TESTS
1475 dnl ******************************
1476 dnl Makefiles
1477 dnl ******************************
1479 export privlibdir
1480 export privincludedir
1481 export privdatadir
1482 export plugindir
1484 EVOLUTION_DIR=`(cd $srcdir; pwd)`
1485 AC_SUBST(EVOLUTION_DIR)
1487 AC_CONFIG_FILES([ po/Makefile.in
1488 Makefile
1489 addressbook/Makefile
1490 addressbook/gui/Makefile
1491 addressbook/gui/contact-editor/Makefile
1492 addressbook/gui/contact-list-editor/Makefile
1493 addressbook/gui/widgets/Makefile
1494 addressbook/importers/Makefile
1495 addressbook/printing/Makefile
1496 addressbook/tools/Makefile
1497 addressbook/tools/csv2vcard
1498 addressbook/util/Makefile
1499 art/Makefile
1500 data/Makefile
1501 data/evolution.desktop.in
1502 data/evolution-alarm-notify.desktop.in
1503 data/icons/Makefile
1504 doc/Makefile
1505 doc/reference/Makefile
1506 doc/reference/evolution-mail-composer/Makefile
1507 doc/reference/evolution-mail-engine/Makefile
1508 doc/reference/evolution-mail-formatter/Makefile
1509 doc/reference/evolution-shell/Makefile
1510 doc/reference/evolution-util/Makefile
1511 e-util/Makefile
1512 em-format/Makefile
1513 help/Makefile
1514 help/quickref/Makefile
1515 help/quickref/C/Makefile
1516 help/quickref/ca/Makefile
1517 help/quickref/cs/Makefile
1518 help/quickref/de/Makefile
1519 help/quickref/es/Makefile
1520 help/quickref/hu/Makefile
1521 help/quickref/it/Makefile
1522 help/quickref/fr/Makefile
1523 help/quickref/oc/Makefile
1524 help/quickref/pl/Makefile
1525 help/quickref/pt/Makefile
1526 help/quickref/sv/Makefile
1527 help/quickref/sq/Makefile
1528 libemail-engine/Makefile
1529 libemail-engine/libemail-engine.pc
1530 libgnomecanvas/Makefile
1531 shell/Makefile
1532 shell/evo-version.h
1533 ui/Makefile
1534 views/Makefile
1535 views/addressbook/Makefile
1536 views/calendar/Makefile
1537 views/mail/Makefile
1538 views/tasks/Makefile
1539 views/memos/Makefile
1540 calendar/Makefile
1541 calendar/alarm-notify/Makefile
1542 calendar/importers/Makefile
1543 calendar/gui/Makefile
1544 composer/Makefile
1545 m4/Makefile
1546 mail/Makefile
1547 mail/default/Makefile
1548 mail/default/C/Makefile
1549 mail/default/ca/Makefile
1550 mail/default/cs/Makefile
1551 mail/default/de/Makefile
1552 mail/default/es/Makefile
1553 mail/default/fi/Makefile
1554 mail/default/fr/Makefile
1555 mail/default/hu/Makefile
1556 mail/default/id/Makefile
1557 mail/default/it/Makefile
1558 mail/default/ja/Makefile
1559 mail/default/ko/Makefile
1560 mail/default/lt/Makefile
1561 mail/default/mk/Makefile
1562 mail/default/nl/Makefile
1563 mail/default/pl/Makefile
1564 mail/default/pt/Makefile
1565 mail/default/ro/Makefile
1566 mail/default/sr/Makefile
1567 mail/default/sr@latin/Makefile
1568 mail/default/sv/Makefile
1569 mail/default/zh_CN/Makefile
1570 mail/importers/Makefile
1571 maint/Makefile
1572 modules/Makefile
1573 modules/addressbook/Makefile
1574 modules/backup-restore/Makefile
1575 modules/bogofilter/Makefile
1576 modules/book-config-google/Makefile
1577 modules/book-config-ldap/Makefile
1578 modules/book-config-local/Makefile
1579 modules/book-config-webdav/Makefile
1580 modules/cal-config-caldav/Makefile
1581 modules/cal-config-contacts/Makefile
1582 modules/cal-config-google/Makefile
1583 modules/cal-config-local/Makefile
1584 modules/cal-config-weather/Makefile
1585 modules/cal-config-webcal/Makefile
1586 modules/calendar/Makefile
1587 modules/composer-autosave/Makefile
1588 modules/contact-photos/Makefile
1589 modules/gravatar/Makefile
1590 modules/itip-formatter/Makefile
1591 modules/mail-config/Makefile
1592 modules/mail/Makefile
1593 modules/mailto-handler/Makefile
1594 modules/mdn/Makefile
1595 modules/offline-alert/Makefile
1596 modules/plugin-lib/Makefile
1597 modules/plugin-manager/Makefile
1598 modules/prefer-plain/Makefile
1599 modules/prefer-plain/plugin/Makefile
1600 modules/settings/Makefile
1601 modules/spamassassin/Makefile
1602 modules/startup-wizard/Makefile
1603 modules/text-highlight/Makefile
1604 modules/tnef-attachment/Makefile
1605 modules/vcard-inline/Makefile
1606 modules/web-inspector/Makefile
1607 plugins/Makefile
1608 plugins/attachment-reminder/Makefile
1609 plugins/bbdb/Makefile
1610 plugins/dbx-import/Makefile
1611 plugins/email-custom-header/Makefile
1612 plugins/external-editor/Makefile
1613 plugins/face/Makefile
1614 plugins/mail-notification/Makefile
1615 plugins/mail-to-task/Makefile
1616 plugins/mailing-list-actions/Makefile
1617 plugins/pst-import/Makefile
1618 plugins/publish-calendar/Makefile
1619 plugins/save-calendar/Makefile
1620 plugins/templates/Makefile
1621 smime/Makefile
1622 smime/lib/Makefile
1623 smime/gui/Makefile
1624 sounds/Makefile
1625 evolution-calendar.pc
1626 evolution-mail.pc
1627 evolution-shell.pc
1630 AC_OUTPUT
1632 if test "x$with_sub_version" != "x"; then
1633 echo "
1634         Evolution ($with_sub_version) has been configured as follows: "
1635 else
1636 echo "
1637         Evolution has been configured as follows: "
1640 echo "
1641         LDAP support:           $msg_ldap
1642         Contact Maps:           $enable_contact_maps
1643         Libcryptui:             $enable_libcryptui
1644         Archives support:       $enable_autoar
1645         Libnotify:              $HAVE_LIBNOTIFY
1646         SSL support:            $msg_ssl
1647         SMIME support:          $msg_smime
1648         Bogofilter support:     $msg_bogofilter
1649         SpamAssassin support:   $msg_spamassassin
1650         Highlight support:      $msg_text_highlight
1651         Plugins:                $msg_plugins
1652         User documentation:     $with_help
1653         Code coverage (gcov):   $enable_code_coverage
1654         Installed tests:        $enable_installed_tests