Updated Hungarian translation
[evolution.git] / configure.ac
bloba83cba39d8a30e41dba48dbe2c28a22ddbdea311
1 dnl Evolution Versions
2 m4_define([evo_major_version], [3])
3 m4_define([evo_minor_version], [13])
4 m4_define([evo_micro_version], [6])
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.14
17 m4_define([base_version], [3.14])
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 -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.36.0])
37 m4_define([glib_encoded_version], [GLIB_VERSION_2_36])
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([libgdata_minimum_version], [0.10])
55 m4_define([libxml_minimum_version], [2.7.3])
56 m4_define([shared_mime_info_minimum_version], [0.22])
57 m4_define([libpst_minimum_version], [0.6.54])
59 dnl Optional Packages
60 m4_define([champlain_minimum_version], [0.12])
61 m4_define([clutter_gtk_minimum_version], [0.90])
62 m4_define([geoclue_minimum_version], [0.12.0])
63 m4_define([geocode_glib_minimum_version], [3.10])
64 m4_define([gladeui_minimum_version], [3.10.0])
65 m4_define([gweather_minimum_version], [3.8])
66 m4_define([gnome_autoar_minimum_version], [0.1])
67 m4_define([libcanberra_gtk_minimum_version], [0.25])
68 m4_define([libnotify_minimum_version], [0.7])
70 dnl ******************************
71 dnl Compiler Warning Flags
72 dnl ******************************
73 AS_COMPILER_FLAGS(WARNING_FLAGS,
74         "-Wall -Wextra
75         -Wdeprecated-declarations
76         -Wno-missing-field-initializers
77         -Wno-sign-compare
78         -Wno-unused-parameter
79         -Wdeclaration-after-statement
80         -Werror-implicit-function-declaration
81         -Wformat-security -Winit-self
82         -Wmissing-declarations -Wmissing-include-dirs
83         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
84         -Wredundant-decls -Wundef -Wwrite-strings")
85 AC_SUBST(WARNING_FLAGS)
87 dnl Need to stop using e-passwords.h before we can restore
88 dnl -DEDS_DISABLE_DEPRECATED
90 dnl Other useful compiler warnings for test builds only.
91 dnl These may produce warnings we have no control over,
92 dnl or false positives we don't always want to see.
93 dnl
94 dnl     -Wmissing-format-attribute
95 dnl     -Wshadow
96 dnl     -Wformat-nonliteral
97 dnl     -Wstrict-aliasing=2
99 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
101 dnl Warn about API usage that violates our minimum requirements.
102 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
103 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
104 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
106 dnl These will suppress warnings about newly-deprecated symbols.  Ideally
107 dnl these settings should match our minimum requirements and we will clean
108 dnl up any new deprecation warnings after bumping our minimum requirements.
109 dnl But if the warnings get to be overwhelming, use fixed versions instead.
110 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
111 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2"
112 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
114 AC_SUBST(AM_CPPFLAGS)
116 AC_CANONICAL_HOST
117 AC_DEFINE_UNQUOTED(VERSION_COMMENT, "", [Define if you want a comment appended to the version number])
119 dnl This must stay after AC_CANONICAL_HOST, which defines $host.
120 case "$host" in
121 *openbsd*|*freebsd*)
122         dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
123         ;;
125         LDFLAGS="$LDFLAGS -Wl,--no-undefined"
126         ;;
127 esac
130 dnl *************************************
131 dnl Put the ACLOCAL flags in the Makefile
132 dnl *************************************
133 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
135 dnl ******************************
136 dnl Initialize maintainer mode
137 dnl ******************************
138 AM_MAINTAINER_MODE([enable])
140 if test "$evo_version" != "$evo_stable_version"; then
141         AC_DEFINE(STABLE_VERSION, ["evo_stable_version"],
142                 [Define to the latest stable version if this version is unstable])
145 AC_SUBST([BASE_VERSION], [base_version])
146 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
148 AC_SUBST([EVO_MAJOR_VERSION], [evo_major_version])
149 AC_SUBST([EVO_MINOR_VERSION], [evo_minor_version])
150 AC_SUBST([EVO_MICRO_VERSION], [evo_micro_version])
152 AC_PROG_CC
153 AC_C_INLINE
154 AC_PROG_CPP
155 AM_PROG_CC_C_O
156 AC_PROG_INSTALL
157 AC_PROG_LN_S
158 AC_PROG_MAKE_SET
159 AC_PROG_AWK
160 AC_PATH_PROG([PERL], [perl])
161 AC_SUBST(PERL)
163 AC_ARG_PROGRAM
165 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
166 dnl behavior that -- according to the C99 standard -- is supposed to be
167 dnl undefined.  We may still have aliasing abuses lying around that rely
168 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
169 dnl optimzation until we can find and fix all the abuses.
170 dnl (AC_PROG_CC must run first to set the GCC variable.)
171 dnl XXX This really belongs in AM_CFLAGS.
172 if test "x${GCC}" = "xyes"; then
173         CFLAGS="$CFLAGS -fno-strict-aliasing"
176 GLIB_GSETTINGS
178 dnl ******************************
179 dnl I18N stuff
180 dnl ******************************
181 IT_PROG_INTLTOOL([0.40.0])
183 GETTEXT_PACKAGE=evolution-$BASE_VERSION
184 AC_SUBST(GETTEXT_PACKAGE)
185 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
187 dnl ******************************
188 dnl Initialize libtool
189 dnl ******************************
190 LT_PREREQ(2.2)
191 LT_INIT(disable-static win32-dll)
193 PKG_PROG_PKG_CONFIG
195 GNOME_CODE_COVERAGE
197 dnl ********************************************
198 dnl User / Developer Documentation
199 dnl ********************************************
200 YELP_HELP_INIT
201 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
203 dnl ******************************
204 dnl Win32
205 dnl ******************************
206 AC_MSG_CHECKING([for Win32])
207 case "$host" in
208 *-mingw*)
209         os_win32=yes
210         NO_UNDEFINED='-no-undefined'
211         SOEXT='.dll'
212         DL_LIB=''
213         SOFTOKN3_LIB=''
214         CHAMPLAIN_REQUIREMENT=''
215         GEOCLUE_REQUIREMENT=''
216         ;;
217 *openbsd*|*freebsd*)
218         os_win32=no
219         NO_UNDEFINED=''
220         SOEXT='.so'
221         SA_JUNK_PLUGIN=sa-junk-plugin
222         BF_JUNK_PLUGIN=bogo-junk-plugin
223         DL_LIB=''
224         SOFTOKN3_LIB='-lsoftokn3'
225         ;;
227         os_win32=no
228         NO_UNDEFINED='-no-undefined'
229         SOEXT='.so'
230         DL_LIB='-ldl'
231         SOFTOKN3_LIB='-lsoftokn3'
232         ;;
233 esac
234 AC_MSG_RESULT([$os_win32])
235 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
236 AC_SUBST(NO_UNDEFINED)
237 AC_SUBST(SOEXT)
239 MATH_LIB="-lm"
240 AC_SUBST(MATH_LIB)
242 if test "$os_win32" = "yes"; then
243         AC_CHECK_TOOL(WINDRES, windres, :)
244 else
245         WINDRES=":"
248 AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
250 AC_SUBST(WINDRES)
252 dnl **********************************
253 dnl Check for functions
254 dnl **********************************
255 AC_CHECK_FUNCS(nl_langinfo)
257 dnl **********************************
258 dnl Check for nl_langinfo features
259 dnl **********************************
260 EVO_CHECK_LANGINFO([_NL_MEASUREMENT_MEASUREMENT])
262 dnl **********************************
263 dnl Check for base dependencies early.
264 dnl **********************************
265 PKG_CHECK_MODULES([GNOME_PLATFORM],
266         [gio-2.0 >= glib_minimum_version
267          gmodule-2.0 >= glib_minimum_version
268          cairo-gobject
269          gtk+-3.0 >= gdk_minimum_version
270          gail-3.0 >= gdk_minimum_version
271          gdk-pixbuf-2.0 >= gdk_pixbuf_minimum_version
272          gcr-3 >= gcr_minimum_version
273          libxml-2.0 >= libxml_minimum_version
274          shared-mime-info >= shared_mime_info_minimum_version
275          gsettings-desktop-schemas >= gsettings_desktop_schemas_minimum_version
276          webkitgtk-3.0 >= webkitgtk_minimum_version])
278 GNOME_DESKTOP_DEPENDENCY=""
279 AC_ARG_ENABLE([gnome-desktop],
280         [AS_HELP_STRING([--enable-gnome-desktop],
281         [Enable GNOME desktop dependency for thumbnails @<:@default=yes@:>@])],
282         [enable_gnome_desktop="$enableval"], [enable_gnome_desktop=yes])
284 if test "$enable_gnome_desktop" = "yes"; then
285         GNOME_DESKTOP_DEPENDENCY=gnome-desktop-3.0
286         PKG_CHECK_MODULES([GNOME_DESKTOP], [$GNOME_DESKTOP_DEPENDENCY >= gnome_desktop_minimum_version])
287         GNOME_PLATFORM_CFLAGS="$GNOME_PLATFORM_CFLAGS $GNOME_DESKTOP_CFLAGS"
288         GNOME_PLATFORM_LIBS="$GNOME_PLATFORM_LIBS $GNOME_DESKTOP_LIBS"
289         AC_DEFINE(HAVE_GNOME_DESKTOP, 1, [gnome-desktop])
291 AC_SUBST(GNOME_DESKTOP_DEPENDENCY)
292 AC_SUBST(GNOME_PLATFORM_CFLAGS)
293 AC_SUBST(GNOME_PLATFORM_LIBS)
295 PKG_CHECK_MODULES([EVOLUTION_DATA_SERVER],
296         [camel-1.2 >= eds_minimum_version
297          libebook-1.2 >= eds_minimum_version
298          libecal-1.2 >= eds_minimum_version
299          libedataserver-1.2 >= eds_minimum_version
300          libebackend-1.2 >= eds_minimum_version])
301 AC_SUBST(EVOLUTION_DATA_SERVER_CFLAGS)
302 AC_SUBST(EVOLUTION_DATA_SERVER_LIBS)
304 dnl **************************************************
305 dnl wait.h is not available on win32
306 dnl **************************************************
308 AC_CHECK_HEADERS(sys/wait.h, AC_DEFINE(HAVE_SYS_WAIT_H, 1, [Have <sys/wait.h>]))
310 dnl ****************
311 dnl Enchant Library
312 dnl ****************
313 PKG_CHECK_MODULES([ENCHANT],
314         [enchant >= enchant_minimum_version])
315 AC_SUBST(ENCHANT_CFLAGS)
316 AC_SUBST(ENCHANT_LIBS)
318 dnl ******************************
319 dnl Canberra / Canberra-GTK Sound
320 dnl ******************************
321 AC_ARG_ENABLE([canberra],
322         [AS_HELP_STRING([--enable-canberra],
323         [Enable Canberra and Canberra-GTK sound @<:@default=yes@:>@])],
324         [enable_canberra="$enableval"], [enable_canberra=yes])
326 if test $enable_canberra = yes; then
327         PKG_CHECK_MODULES(
328                 [CANBERRA],
329                 [libcanberra-gtk3 >= libcanberra_gtk_minimum_version],,
330                 [AC_MSG_ERROR([
332         libcanberra-gtk3 not found (or version < libcanberra_gtk_minimum_version)
334         If you want to disable support for event sounds,
335         please append --disable-canberra to configure.
337         ])])
339         AC_DEFINE(HAVE_CANBERRA, 1, [Define if using Canberra and Canberra-GTK for sound])
341 AC_SUBST(CANBERRA_CFLAGS)
342 AC_SUBST(CANBERRA_LIBS)
344 dnl ***********************************
345 dnl Archives Integration / gnome-autoar
346 dnl ***********************************
347 AC_ARG_ENABLE([autoar],
348         [AS_HELP_STRING([--enable-autoar],
349         [Enable archives support in attachments @<:@default=yes@:>@])],
350         [enable_autoar="$enableval"], [enable_autoar=yes])
352 if test x"$enable_autoar" = xyes; then
353         PKG_CHECK_MODULES(
354                 [AUTOAR],
355                 [gnome-autoar >= gnome_autoar_minimum_version
356                  gnome-autoar-gtk >= gnome_autoar_minimum_version],,
357                 [AC_MSG_ERROR([
359         gnome-autoar or gnome-autoar-gtk not found
360         (or version < gnome_autoar_minimum_version)
362         If you want to disable support for automatic archives handling,
363         please append --disable-autoar to configure.
365         ])])
367         AC_DEFINE(HAVE_AUTOAR, 1, [Define if gnome-autoar is enabled])
369 AC_SUBST(AUTOAR_CFLAGS)
370 AC_SUBST(AUTOAR_LIBS)
372 dnl ******************
373 dnl User Documentation
374 dnl ******************
375 AC_MSG_CHECKING([whether to build user documentation])
376 AC_ARG_WITH([help],
377         [AS_HELP_STRING([--with-help],
378         [Build user documentation [default=yes]])],
379         [with_help="$withval"],[with_help="yes"])
380 AM_CONDITIONAL(WITH_HELP, test "x$with_help" != "xno")
381 AC_MSG_RESULT([$with_help])
383 dnl ******************************
384 dnl iconv checking
385 dnl ******************************
386 have_iconv=no
387 save_LIBS="$LIBS"
388 LIBS="$LIBS -liconv"
389 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
390         AC_LINK_IFELSE([AC_LANG_PROGRAM(
391         [[
392                 #include <iconv.h>
393                 #include <stdlib.h>
394         ]],
395         [[      iconv_t cd;
396                 cd = iconv_open ("UTF-8", "ISO-8859-1");
397         ]]
398         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
400 if test $ac_cv_libiconv = yes; then
401         ICONV_LIBS="-liconv"
402         if test $os_win32 = yes; then
403                 dnl Don't pointlessly auto-export the global symbols
404                 dnl from a potentially static libiconv.a
405                 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
406         fi
407         have_iconv=yes
408 else
409         LIBS="$save_LIBS"
410         AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
413 if test $have_iconv = yes; then
414         if test $ac_cv_libiconv = no; then
415                 AC_CHECK_FUNCS(gnu_get_libc_version)
416         fi
417 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
418         AC_RUN_IFELSE([AC_LANG_SOURCE([[
419                 #include <iconv.h>
420                 #include <stdlib.h>
421                 #include <string.h>
422                 #ifdef HAVE_GNU_GET_LIBC_VERSION
423                 #include <gnu/libc-version.h>
424                 #endif
425                 int main() {
426                         char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
427                         char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
428                         char *transbuf = malloc (10), *trans = transbuf;
429                         iconv_t cd;
430                         size_t jp_len = strlen (jp), utf8_len = 10;
431                         size_t utf8_real_len = strlen (utf8);
433                         #ifdef HAVE_GNU_GET_LIBC_VERSION
434                         /* glibc 2.1.2's iconv is broken in hard to test ways. */
435                         if (!strcmp (gnu_get_libc_version (), "2.1.2"))
436                                 exit (1);
437                         #endif
439                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
440                         if (cd == (iconv_t) -1)
441                                 exit (1);
442                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
443                                 exit (1);
444                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
445                                 exit (1);
446                         return (0);}
447                 ]])
448         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
451 if test "$have_iconv" = no; then
452         AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
454 AC_SUBST(ICONV_LIBS)
456 save_CFLAGS="$CFLAGS"
457 CFLAGS="$CFLAGS -I$srcdir"
459 AC_MSG_CHECKING([preferred charset name formats for system iconv])
460 AC_RUN_IFELSE([AC_LANG_SOURCE([[
461         #define CONFIGURE_IN
462         #include "iconv-detect.c"
463         ]])],
464         [AC_MSG_RESULT([found])],
465         [AC_MSG_RESULT([not found])
466                 AC_MSG_WARN([
467                 *** The iconv-detect program was unable to determine the
468                 *** preferred charset name formats recognized by your
469                 *** iconv library. It is suggested that you install a
470                 *** working iconv library such as the one found at
471                 *** ftp://ftp.gnu.org/pub/gnu/libiconv
472         ])],
473         [if test x$os_win32 = xyes; then
474                 AC_MSG_RESULT([using known win32 result])
475                 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
476                 echo  >>iconv-detect.h
477                 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
478                 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
479                 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
480         else
481                 AC_MSG_RESULT([unknown])
482                 AC_MSG_WARN([
483                 *** We can't determine the preferred charset name formats
484                 *** recognized by your iconv library. You are
485                 *** cross-compiling and supposed to know what you are doing.
486                 *** Please construct the iconv-detect.h file manually.
487                 ])
488         fi
491 CFLAGS="$save_CFLAGS"
492 LIBS="$save_LIBS"
494 dnl **************
495 dnl waitpid() etc
496 dnl **************
497 AC_HEADER_SYS_WAIT
499 dnl ***************
500 dnl Purify support
501 dnl ***************
502 EVO_PURIFY_SUPPORT
504 dnl ***************
505 dnl Timezone checks
506 dnl ***************
507 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
508         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
509         [[      #include <time.h>       ]],
510         [[
511                 struct tm tm;
512                 tm.tm_gmtoff = 1;
513         ]]
514         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
515 if test $ac_cv_struct_tm_gmtoff = yes; then
516         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
517 else
518         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
519                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
520                 [[      #include <time.h> ]],
521                 [[      timezone = 1;   ]]
522                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
523         if test $ac_cv_var_timezone = yes; then
524                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
525                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
526                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
527                         [[      #include <time.h>       ]],
528                         [[      altzone = 1; ]]
529                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
530                 if test $ac_cv_var_altzone = yes; then
531                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
532                 fi
533         else
534                 AC_MSG_ERROR([unable to find a way to determine timezone])
535         fi
539 AC_CHECK_FUNCS(mkdtemp)
541 dnl **************************************************
542 dnl iso-codes
543 dnl **************************************************
544 AC_MSG_CHECKING([for iso-codes package])
545 have_iso_codes=no
546 if $PKG_CONFIG --exists iso-codes; then
547         if $PKG_CONFIG iso-codes --atleast-version=0.49; then
548                 have_iso_codes=yes
549                 AC_MSG_RESULT([$have_iso_codes])
550         else
551                 AC_MSG_WARN([iso-codes detected, but version 0.49 or later is required due to licensing])
552         fi
553 else
554         AC_MSG_RESULT([$have_iso_codes])
557 if test "x$have_iso_codes" = "xyes"; then
558         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
559         if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null 2>&1 && \
560                 $PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null 2>&1 ; then
561                         result=yes
562         else
563                 result=no
564                 have_iso_codes=no
565         fi
566         AC_MSG_RESULT([$result])
569 if test "x$have_iso_codes" = "xyes"; then
570         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
571                 ["`$PKG_CONFIG --variable=prefix iso-codes`"],
572                 [ISO codes prefix])
573         AC_DEFINE([HAVE_ISO_CODES], [1],
574                 [Define if you have the iso-codes package])
577 dnl **************************************************
578 dnl Accessibility support
579 dnl **************************************************
580 PKG_CHECK_MODULES([A11Y], [atk])
581 AC_SUBST(A11Y_CFLAGS)
582 AC_SUBST(A11Y_LIBS)
584 dnl **************************************************
585 dnl XF86 multimedia keys support
586 dnl **************************************************
587 have_xfree=no
588 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
589         [[ #include <X11/XF86keysym.h> ]],[[]])],
590         [have_xfree=yes]
592 AC_MSG_CHECKING([for X11 XFree86 headers])
593 AC_MSG_RESULT([$have_xfree])
594 if test x"$have_xfree" = "xyes" ; then
595         AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
598 dnl **************************************************
599 dnl LDAP support.
600 dnl **************************************************
601 if test "$os_win32" != yes; then
602         EVO_LDAP_CHECK(no)
603         case $with_openldap in
604         no)
605                 msg_ldap=no
606                 ;;
607         *)
608                 case $with_static_ldap in
609                 yes)
610                         msg_ldap="yes (static)"
611                 ;;
612                 *)
613                         msg_ldap="yes (dynamic)"
614                         ;;
615                 esac
616         esac
618         SAVE_CFLAGS="$CFLAGS"
619         SAVE_LIBS="$LIBS"
620         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
621         CFLAGS="$CFLAGS $LDAP_CFLAGS"
622         LIBS="$LIBS $LDAP_LIBS"
623         AC_CHECK_FUNCS(ldap_ntlm_bind)
624         CFLAGS="$SAVE_CFLAGS"
625         LIBS="$SAVE_LIBS"
626 dnl Win32 support
627 else
628         LDAP_CFLAGS="-DLDAP_DEPRECATED"
629         LDAP_LIBS="-lwldap32"
630         AC_SUBST(LDAP_CFLAGS)
631         AC_SUBST(LDAP_LIBS)
632         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
633         AM_CONDITIONAL(ENABLE_LDAP, true)
634         msg_ldap="yes"
637 dnl **************************************************
638 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
639 dnl **************************************************
640 if test "$with_openldap" = no ; then
641         EVO_SUNLDAP_CHECK(no)
642         case $with_sunldap in
643         no)
644                 msg_ldap=no
645                 ;;
646         *)
647                 case $with_static_sunldap in
648                 yes)
649                         msg_ldap="$with_sunldap (static)"
650                         ;;
651                 *)
652                         msg_ldap="$with_sunldap (dynamic)"
653                         ;;
654                 esac
655         esac
656 else
657         with_sunldap=no
659 AM_CONDITIONAL(SUNLDAP, [test x$with_sunldap != xno])
661 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
663 dnl ********************************************************************************
664 dnl security extension support (SSL and S/MIME)
666 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
667 dnl needed by Camel (SSL and S/MIME).
669 dnl The Evolution security extensions are only built if these libraries are found
670 dnl ********************************************************************************
671 msg_ssl="no"
672 msg_smime="no"
674 dnl these 2 enable's are inverses of each other
676 AC_ARG_ENABLE([nss],
677         AS_HELP_STRING([--enable-nss=@<:@yes/no/static@:>@],
678         [Attempt to use Mozilla libnss for SSL support.]),
679         [enable_nss=$enableval],[enable_nss=yes])
681 AC_ARG_ENABLE([smime],
682         AS_HELP_STRING([--enable-smime],
683         [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
684         [enable_smime=$enableval],[enable_smime=yes])
686 AC_ARG_WITH([nspr-includes],
687         AS_HELP_STRING([--with-nspr-includes=PATH],
688         [Location of Mozilla nspr4 includes.]))
690 AC_ARG_WITH([nspr-libs],
691         AS_HELP_STRING([--with-nspr-libs=PATH],
692         [Location of Mozilla nspr4 libs.]))
694 AC_ARG_WITH([nss-includes],
695         AS_HELP_STRING([--with-nss-includes=PATH],
696         [Location of Mozilla nss3 includes.]))
698 AC_ARG_WITH([nss-libs],
699         AS_HELP_STRING([--with-nss-libs=PATH],
700         [Location of Mozilla nss3 libs.]))
702 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
703         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
704                 check_manually="yes"
705         else
706                 check_manually="no"
707         fi
709         if test "x${check_manually}" = "xno"; then
710                 AC_MSG_CHECKING([Mozilla NSPR pkg-config module name])
711                 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
712                 for pc in $mozilla_nspr_pcs; do
713                         if $PKG_CONFIG --exists $pc; then
714                                 AC_MSG_RESULT([$pc])
715                                 mozilla_nspr=$pc
716                                 break;
717                         fi
718                 done
720                 AC_MSG_CHECKING([Mozilla NSS pkg-config module name])
721                 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
722                 for pc in $mozilla_nss_pcs; do
723                         if $PKG_CONFIG --exists $pc; then
724                                 AC_MSG_RESULT([$pc])
725                                 mozilla_nss=$pc
726                                 break;
727                         fi
728                 done
730                 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
731                         msg_ssl="yes (Mozilla NSS)"
732                         if test "x$enable_smime" = "xyes"; then
733                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
734                                 msg_smime="yes (Mozilla NSS)"
735                         fi
736                         AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
737                         AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
738                         AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"`$PKG_CONFIG --variable=libdir $mozilla_nss`",[Define to the full path of mozilla nss library])
739                         MANUAL_NSPR_CFLAGS=""
740                         MANUAL_NSPR_LIBS=""
741                         MANUAL_NSS_CFLAGS=""
742                         MANUAL_NSS_LIBS=""
743                 else
744                         check_manually="yes"
745                         mozilla_nspr=""
746                         mozilla_nss=""
747                 fi
748         fi
750         if test "x${check_manually}" = "xyes"; then
751                 mozilla_nss=""
752                 have_nspr_includes="no"
753                 if test "x${with_nspr_includes}" != "xno"; then
754                         CPPFLAGS_save="$CPPFLAGS"
756                         AC_MSG_CHECKING([for Mozilla nspr4 includes in $with_nspr_includes])
757                         AC_MSG_RESULT([""])
759                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
760                         AC_CHECK_HEADERS([nspr.h prio.h],[ moz_nspr_includes="yes" ],,
761                         [[
762                                 #if HAVE_NSPR_H
763                                 #include <nspr.h>
764                                 #include <prio.h>
765                                 #endif
766                         ]])
767                         CPPFLAGS="$CPPFLAGS_save"
769                         if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
770                                 have_nspr_includes="yes"
771                                 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
772                         fi
773                 else
774                         AC_MSG_CHECKING([for Mozilla nspr4 includes])
775                         AC_MSG_RESULT([no])
776                 fi
778                 have_nspr_libs="no"
779                 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
780                         CFLAGS_save="$CFLAGS"
781                         LDFLAGS_save="$LDFLAGS"
783                         if test "$enable_nss" = "static"; then
784                                 if test -z "${with_nspr_libs}"; then
785                                         AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
786                                         [Please specify the path to libnspr4.a]
787                                         [Example: --with-nspr-libs=/usr/lib])
788                                 else
789                                         nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a"
790                                 fi
791                         else
792                                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
793                         fi
795                         AC_CACHE_CHECK([for Mozilla nspr libraries], [ac_cv_moz_nspr_libs],
796                         [
797                                 LIBS_save="$LIBS"
798                                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
800                                 if test "x${with_nspr_libs}" != "x"; then
801                                         LIBS="$nsprlibs"
802                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
803                                 else
804                                         LIBS="$nsprlibs"
805                                         LDFLAGS="$LDFLAGS"
806                                 fi
808                                 AC_LINK_IFELSE([AC_LANG_CALL([], [PR_Init])],
809                                 [ac_cv_moz_nspr_libs="yes"], [ac_cv_moz_nspr_libs="no"])
810                                 CFLAGS="$CFLAGS_save"
811                                 LDFLAGS="$LDFLAGS_save"
812                                 LIBS="$LIBS_save"
813                         ])
814                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
815                                 have_nspr_libs="yes"
816                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
817                         else
818                                 MANUAL_NSPR_CLFAGS=""
819                         fi
820                 else
821                         AC_MSG_CHECKING([for Mozilla nspr4 libraries])
822                         AC_MSG_RESULT([no])
823                 fi
825                 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
826                         CPPFLAGS_save="$CPPFLAGS"
828                         AC_MSG_CHECKING([for Mozilla nss3 includes in $with_nss_includes])
829                         AC_MSG_RESULT([""])
831                         if test "x${with_nspr_includes}" != "x"; then
832                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
833                         else
834                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
835                         fi
837                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
838                                 [ have_nss_includes="yes" ],
839                                 [ have_nss_includes="no" ],
840                                 [
841                                         #if HAVE_NSPR_H
842                                         #include <nss.h>
843                                         #include <ssl.h>
844                                         #include <smime.h>
845                                         #endif
846                                 ])
848                         CPPFLAGS="$CPPFLAGS_save"
850                         if test "x${have_nss_includes}" = "xyes"; then
851                                 have_nss_includes="yes"
852                                 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
853                         else
854                                 MANUAL_NSPR_CFLAGS=""
855                                 MANUAL_NSPR_LIBS=""
856                         fi
857                 else
858                         AC_MSG_CHECKING([for Mozilla nss3 includes])
859                         AC_MSG_RESULT([no])
860                 fi
862                 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
863                         LDFLAGS_save="$LDFLAGS"
865                         if test "$enable_nss" = "static"; then
866                                 if test -z "${with_nss_libs}"; then
867                                         AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
868                                         [Please specify the path to libnss3.a]
869                                         [Example: --with-nspr-libs=/usr/lib/mozilla])
870                                 else
871                                         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"
872                                         case "$host" in
873                                                 *solaris*)
874                                                 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
875                                         ;;
876                                         esac
877                                 fi
878                         else
879                                 nsslibs="-lssl3 -lsmime3 -lnss3"
880                         fi
882                         AC_CACHE_CHECK([for Mozilla nss libraries], [ac_cv_moz_nss_libs],
883                         [
884                                 LIBS_save="$LIBS"
885                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
886                                 LIBS="$nsslibs $nsprlibs"
887                                 AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
888                                 [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
889                                 if test "$ac_cv_moz_nss_libs" = no; then
890                                         nsslibs="-lssl3 -lsmime3 -lnss3"
891                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
892                                         AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
893                                         [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
894                                 fi
895                                 LDFLAGS="$LDFLAGS_save"
896                                 LIBS="$LIBS_save"
897                         ])
898                         if test "$ac_cv_moz_nss_libs" != no; then
899                                 AC_DEFINE(HAVE_NSS)
900                                 AC_DEFINE(HAVE_SSL)
901                                 AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"$with_nss_libs", [Define to the full path of mozilla nss library])
902                                 if test "$enable_nss" = "static"; then
903                                         msg_ssl="yes (Mozilla NSS:static)"
904                                 else
905                                         msg_ssl="yes (Mozilla NSS)"
906                                 fi
907                                 dnl static_nss
908                                 if test "$enable_smime" = "yes"; then
909                                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
910                                         msg_smime="yes (Mozilla NSS)"
911                                 fi
912                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
913                         else
914                                 MANUAL_NSS_CFLAGS=""
915                                 MANUAL_NSPR_CFLAGS=""
916                                 MANUAL_NSPR_LIBS=""
917                         fi
918                 else
919                         AC_MSG_CHECKING([for Mozilla nss libraries])
920                         AC_MSG_RESULT([no])
921                 fi
923                 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
924                 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
925         fi
928 AM_CONDITIONAL(ENABLE_SMIME, [test "x$msg_smime" != "xno"])
930 AC_SUBST(MANUAL_NSPR_CFLAGS)
931 AC_SUBST(MANUAL_NSPR_LIBS)
932 AC_SUBST(MANUAL_NSS_CFLAGS)
933 AC_SUBST(MANUAL_NSS_LIBS)
935 dnl ******************************
936 dnl libcryptui, aka Seahorse
937 dnl ******************************
938 AC_ARG_ENABLE([libcryptui],
939         [AS_HELP_STRING([--enable-libcryptui],
940         [Enable libcryptui usage @<:@default=yes@:>@])],
941         [enable_libcryptui="$enableval"], [enable_libcryptui=yes])
943 if test "x$enable_libcryptui" = "xyes"; then
944         PKG_CHECK_MODULES(
945                 [LIBCRYPTUI],
946                 [cryptui-0.0],,
947                 [AC_MSG_ERROR([
949         cryptui-0.0 not found
951         If you want to disable support libcryptui usage,
952         please append --disable-libcryptui to configure.
954         ])])
956         AC_DEFINE(HAVE_LIBCRYPTUI, 1, [Define if using libcryptui])
957 else
958         enable_libcryptui=no
960 AC_SUBST(LIBCRYPTUI_CFLAGS)
961 AC_SUBST(LIBCRYPTUI_LIBS)
963 dnl *****************
964 dnl killall or pkill?
965 dnl *****************
967 case "$host" in
968 *solaris*)
969         KILL_PROCESS_CMD="/usr/bin/pkill -x"
970         ;;
972         AC_PATH_PROGS(KILL_PROCESS_CMD, killall pkill)
973         ;;
974 esac
975 if test -z "$KILL_PROCESS_CMD"; then
976         AC_MSG_WARN([Could not find a command to kill a process by name])
977 else
978         AC_DEFINE_UNQUOTED([KILL_PROCESS_CMD], "$KILL_PROCESS_CMD",
979                 [Command to kill processes by name])
982 dnl *******************
983 dnl GObject marshalling
984 dnl *******************
985 AM_PATH_GLIB_2_0
987 dnl *****************************************************************
988 dnl Utility macro to set compiler flags for a specific lib.
989 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
990 dnl *****************************************************************
991 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
992         PKG_CHECK_MODULES([$1], [$2])
993         $1_CFLAGS="[$]$1_CFLAGS $3"
994         $1_LIBS="[$]$1_LIBS $4"
997 dnl ******************************
998 dnl TNEF implementation
999 dnl ******************************
1000 AC_MSG_CHECKING([for yTNEF])
1001 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1002         [[
1003                 #include <stdio.h>
1004                 #include <ytnef.h>
1005         ]],
1006         [[      TNEFStruct *tnef;       ]]
1007         )],     [tnef_ok=yes], [tnef_ok=no])
1008 if test "$tnef_ok" = "yes"; then
1009         AC_MSG_RESULT([yes])
1010         TNEF_CFLAGS="-DHAVE_YTNEF_H"
1011         AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])
1012         
1013 else
1014         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1015         [[
1016                 #include <stdio.h>
1017                 #include <libytnef/ytnef.h>
1018         ]],
1019         [[      TNEFStruct *tnef;       ]]
1020         )], [tnef_ok=yes], [tnef_ok=no])
1021         if test "$tnef_ok" = "yes"; then
1022                 AC_MSG_RESULT([yes])
1023                 TNEF_CFLAGS="-DHAVE_LIBYTNEF_YTNEF_H"
1024                 AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])            
1025         else
1026                 AC_MSG_RESULT([no])
1027                 TNEF_CFLAGS=""
1028         fi
1030 AM_CONDITIONAL([ENABLE_TNEF], [test "$tnef_ok" = "yes"])
1031 AC_SUBST(TNEF_CFLAGS)
1033 if test "x$mozilla_nss" != "x"; then
1034         EVO_SET_COMPILE_FLAGS(MOZILLA_NSS, $mozilla_nss)
1035         MOZILLA_L_DIR=`${PKG_CONFIG} --libs-only-L $mozilla_nss`
1036 else
1037         if test "x$MOZILLA_MANUAL_LIBS" != "x"; then
1038                 MOZILLA_L_DIR="-L$with_nss_lib"
1039         fi
1042 dnl **********************************
1043 dnl Check for Bogofilter (spam filter)
1044 dnl **********************************
1045 AC_ARG_ENABLE([bogofilter],
1046         [AS_HELP_STRING([--enable-bogofilter],
1047         [enable spam filtering using Bogofilter (default=yes)])],
1048         [enable_bogofilter=$enableval], [enable_bogofilter=yes])
1049 AC_MSG_CHECKING([if Bogofilter support is enabled])
1050 AC_MSG_RESULT([$enable_bogofilter])
1051 msg_bogofilter="$enable_bogofilter"
1052 if test "x$enable_bogofilter" = "xyes"; then
1053         AC_ARG_VAR([BOGOFILTER], [Bogofilter spam filtering program])
1054         AC_PATH_PROG([BOGOFILTER], [bogofilter])
1055         if test "x$BOGOFILTER" == "x"; then
1056                 AC_MSG_ERROR([
1058         Bogofilter spam filtering program not found.
1060         If you want to disable spam filtering using Bogofilter,
1061         please append --disable-bogofilter to configure.
1063         ])
1064         fi
1065         AC_DEFINE_UNQUOTED(
1066                 BOGOFILTER_COMMAND, "$BOGOFILTER",
1067                 [Bogofilter spam filtering program])
1068         msg_bogofilter="$msg_bogofilter ($BOGOFILTER)"
1070 AM_CONDITIONAL([ENABLE_BOGOFILTER], [test "x$enable_bogofilter" = "xyes"])
1072 dnl ************************************
1073 dnl Check for SpamAssassin (spam filter)
1074 dnl ************************************
1075 AC_ARG_ENABLE([spamassassin],
1076         [AS_HELP_STRING([--enable-spamassassin],
1077         [enable spam filtering using SpamAssassin (default=yes)])],
1078         [enable_spamassassin=$enableval], [enable_spamassassin=yes])
1079 AC_MSG_CHECKING([if SpamAssassin support is enabled])
1080 AC_MSG_RESULT([$enable_spamassassin])
1081 msg_spamassassin="$enable_spamassassin"
1082 if test "x$enable_spamassassin" = "xyes"; then
1083         AC_ARG_VAR([SPAMASSASSIN], [SpamAssassin spam filtering program])
1084         AC_PATH_PROG([SPAMASSASSIN], [spamassassin])
1085         if test "x$SPAMASSASSIN" == "x"; then
1086                 AC_MSG_ERROR([
1088         SpamAssassin spam filtering program not found.
1090         If you want to disable spam filtering using SpamAssassin,
1091         please append --disable-spamassassin to configure.
1093         ])
1094         fi
1095         AC_DEFINE_UNQUOTED(
1096                 SPAMASSASSIN_COMMAND, "$SPAMASSASSIN",
1097                 [SpamAssassin spam filtering program])
1099         AC_ARG_VAR([SA_LEARN], [SpamAssassin spam training program])
1100         AC_PATH_PROG([SA_LEARN], [sa-learn])
1101         if test "x$SA_LEARN" = "x"; then
1102                 AC_MSG_ERROR([
1104         SpamAssassin training program (sa-learn) not found.
1106         If you want to disable spam filtering using SpamAssassin,
1107         please append --disable-spamassassin to configure.
1109         ])
1110         fi
1111         AC_DEFINE_UNQUOTED(
1112                 SA_LEARN_COMMAND, "$SA_LEARN",
1113                 [SpamAssassin spam training program])
1115         msg_spamassassin="$msg_spamassassin ($SPAMASSASSIN)"
1117 AM_CONDITIONAL([ENABLE_SPAMASSASSIN], [test "x$enable_spamassassin" = "xyes"])
1119 dnl ******************************
1120 dnl CERT_UI Flags
1121 dnl ******************************
1123 dnl Here we want the Mozilla flags to go *before* the other ones,
1124 dnl especially the mozilla-nss -I flags to go before the gnutls ones
1125 dnl (which are dragged in through libedataserverui), as both
1126 dnl 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 PKG_CHECK_MODULES([GDATA], [libgdata >= libgdata_minimum_version])
1157 AC_SUBST(GDATA_CFLAGS)
1158 AC_SUBST(GDATA_LIBS)
1160 dnl ***********************************
1161 dnl GTasks require more latest libgdata
1162 dnl ***********************************
1163 if `$PKG_CONFIG --atleast-version=0.15.1 libgdata`; then
1164         AC_DEFINE(HAVE_GDATA_0_15_1, 1, [Define to 1 if you have the libgdata package >= 0.15.1])
1167 dnl ****************************
1168 dnl Check for ical_set_unknown_token_handling_setting function
1169 dnl ****************************
1170 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1171 save_cflags=$CFLAGS; CFLAGS="$EVOLUTION_DATA_SERVER_CFLAGS"
1172 save_libs=$LIBS; LIBS="$EVOLUTION_DATA_SERVER_LIBS"
1173 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1174         [[#include <libical/ical.h>]],
1175         [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1176         [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])
1177 CFLAGS=$save_cflags
1178 LIBS=$save_libs
1179 AC_MSG_RESULT([$ac_cv_have_iuth])
1181 dnl ****************************
1182 dnl Check for gtkspell
1183 dnl ****************************
1184 AC_ARG_ENABLE([gtkspell],
1185         [AS_HELP_STRING([--enable-gtkspell],
1186         [Enable gtkspell @<:@default=yes@:>@])],
1187         [enable_gtkspell="$enableval"], [enable_gtkspell="yes"])
1189 if test "x$enable_gtkspell" = "xyes"; then
1190         PKG_CHECK_MODULES(
1191                 [GTKSPELL],
1192                 [gtkspell3-3.0],,
1193                 [AC_MSG_ERROR([
1195         gtkspell3-3.0 not found
1197         If you want to disable the gtkspell feature,
1198         please append --disable-gtkspell to configure.
1200         ])])
1202         AC_DEFINE(WITH_GTKSPELL, 1, [When defined spell checking is enabled])
1205 dnl *******************
1206 dnl Special directories
1207 dnl *******************
1209 dnl If you add something here, consider whether or not you also need to add it to one or more .pc.in
1210 dnl files (for Connector, etc)
1212 privlibdir='${libdir}'/evolution
1213 AC_SUBST(privlibdir)
1215 privlibexecdir='${libexecdir}'/evolution
1216 AC_SUBST(privlibexecdir)
1218 privdatadir='${datadir}'/evolution
1219 AC_SUBST(privdatadir)
1221 privincludedir='${includedir}'/evolution
1222 AC_SUBST(privincludedir)
1224 moduledir="$privlibdir/modules"
1225 AC_SUBST(moduledir)
1227 uidir="$privdatadir/ui"
1228 AC_SUBST(uidir)
1230 evolutionhelpdir="$privdatadir/help"
1231 AC_SUBST(evolutionhelpdir)
1233 icondir="$privdatadir/icons"
1234 AC_SUBST(icondir)
1236 imagesdir="$privdatadir/images"
1237 AC_SUBST(imagesdir)
1239 if test "$os_win32" = yes; then
1240         dnl On Win32 there is no "rpath" mechanism. We install the private
1241         dnl shared libraries in $libdir, meaning the DLLs will actually be in
1242         dnl $bindir. This means just having $bindir in PATH will be enough. This
1243         dnl also means gnome_win32_get_prefixes() will be able to deduce the
1244         dnl installation folder correctly.
1245         privsolibdir=$libdir
1246 else
1247         privsolibdir=$privlibdir
1249 AC_SUBST(privsolibdir)
1251 soundsdir="$privdatadir/sounds"
1252 AC_SUBST(soundsdir)
1254 etspecdir="$privdatadir/etspec"
1255 AC_SUBST(etspecdir)
1257 viewsdir="$privdatadir/views"
1258 AC_SUBST(viewsdir)
1260 dnl For evolution-alarm-notify.desktop
1261 AS_AC_EXPAND(PRIVLIBEXECDIR, "$privlibexecdir")
1263 dnl ************************
1264 dnl Plugins
1265 dnl ************************
1267 plugindir="$privlibdir/plugins"
1268 AC_SUBST(plugindir)
1270 EVO_PLUGIN_RULE=$srcdir/plugin.mk
1271 AC_SUBST_FILE(EVO_PLUGIN_RULE)
1273 AC_ARG_ENABLE([plugins],
1274         AS_HELP_STRING([--enable-plugins=[no/base/all]],
1275         [Enable plugins.]),
1276         [enable_plugins="$enableval"],[enable_plugins=all])
1278 dnl Add any new plugins here
1279 plugins_base_always="publish-calendar"
1281 plugins_base="$plugins_base_always"
1282 dist_plugins_base="$plugins_base_always"
1284 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"
1286 plugins_standard="$plugins_standard_always"
1287 dist_plugins_standard="$plugins_standard pst-import"
1289 dnl ******************************************************************
1290 dnl The following plugins have additional library dependencies.
1291 dnl They must be explicitly disabled if the libraries are not present.
1292 dnl ******************************************************************
1294 dnl **************************************************
1295 dnl text-highlight plugins requires highlight utility
1296 dnl **************************************************
1297 AC_ARG_ENABLE([text-highlight],
1298         [AS_HELP_STRING([--enable-text-highlight],
1299         [Enable text-highlight plugin (default=yes)])],
1300         [enable_text_highlight="$enableval"], [enable_text_highlight=yes])
1301 AC_MSG_CHECKING([if source code highlighting support is enabled])
1302 AC_MSG_RESULT([$enable_text_highlight])
1303 msg_text_highlight="$enable_text_highlight"
1304 if test "x$enable_text_highlight" = "xyes"; then
1305         AC_ARG_VAR([HIGHLIGHT], [Source code highlighting utility])
1306         AC_PATH_PROG([HIGHLIGHT], [highlight])
1307         if test "x$HIGHLIGHT" == "x"; then
1308                 AC_MSG_ERROR([
1310         Highlight utility not found.
1312         If you want to disable syntax highlighting in emails,
1313         please append --disable-text-highlight to configure.
1315         ])
1316         fi
1317         AC_DEFINE_UNQUOTED(
1318                 HIGHLIGHT_COMMAND, "$HIGHLIGHT",
1319                 [Source code highlighting utility])
1321         msg_text_highlight="$msg_text_highlight ($HIGHLIGHT)"
1323 AM_CONDITIONAL([ENABLE_TEXT_HIGHLIGHT], [test "x$enable_text_highlight" = "xyes"])
1325 dnl **************************************
1326 dnl Weather calendars require gweather-3.0
1327 dnl **************************************
1328 AC_ARG_ENABLE([weather],
1329         [AS_HELP_STRING([--enable-weather],
1330         [Enable weather calendars @<:@default=yes@:>@])],
1331         [enable_weather="$enableval"],[enable_weather=yes])
1333 if test "x$enable_weather" != "xno"; then
1334         PKG_CHECK_MODULES(
1335                 [GWEATHER], [gweather-3.0 >= gweather_minimum_version],,
1336                 [AC_MSG_ERROR([
1338         gweather-3.0 not found (or version < gweather_minimum_version)
1340         If you want to disable weather calendar support,
1341         please append --disable-weather to configure.
1343         ])])
1345 AM_CONDITIONAL(ENABLE_WEATHER, [test "x$enable_weather" != "xno"])
1347 dnl ********************************************************************
1348 dnl maps in contacts preview requires champlain-gtk, geoclue and clutter
1349 dnl ********************************************************************
1350 AC_ARG_ENABLE([contact-maps],
1351         [AS_HELP_STRING([--enable-contact-maps],
1352         [Enable contact maps @<:@default=no@:>@])],
1353         [enable_contact_maps="$enableval"], [enable_contact_maps="no"])
1355 if test "x$enable_contact_maps" = "xyes"; then
1356         PKG_CHECK_MODULES(
1357                 [CHAMPLAIN],
1358                 [champlain-gtk-0.12 >= champlain_minimum_version],,
1359                 [AC_MSG_ERROR([
1361         champlain-gtk-0.12 not found.
1363         If you want to disable the contact maps feature,
1364         please append --disable-contact-maps to configure.
1366         ])])
1368         PKG_CHECK_MODULES(
1369                 [GEO],
1370                 [geoclue >= geoclue_minimum_version
1371                  geocode-glib-1.0 >= geocode_glib_minimum_version],,
1372                 [AC_MSG_ERROR([
1374         geoclue and/or geocode-glib not found.
1376         If you want to disable the contact maps feature,
1377         please append --disable-contact-maps to configure.
1379         ])])
1381         PKG_CHECK_MODULES(
1382                 [CLUTTER_GTK],
1383                 [clutter-gtk-1.0 >= clutter_gtk_minimum_version],,
1384                 [AC_MSG_ERROR([
1386         clutter-gtk-1.0 not found (or version < clutter_gtk_minimum_version)
1388         If you want to disable the contact maps feature,
1389         please append --disable-contact-maps to configure.
1391         ])])
1393         AC_DEFINE(WITH_CONTACT_MAPS, 1, [When defined contacts preview will contain maps])
1396 dnl *********************************
1397 dnl pst-import plugin requires libpst
1398 dnl *********************************
1399 AC_ARG_ENABLE([pst-import],
1400         [AS_HELP_STRING([--enable-pst-import],
1401         [Enable pst-import plugin @<:@default=yes@:>@])],
1402         [enable_pst="$enableval"], [enable_pst=yes])
1404 if test "x$enable_pst" = "xyes"; then
1405         PKG_CHECK_MODULES(LIBPST, libpst >= libpst_minimum_version, have_pst=yes, have_pst=no)
1406         AC_SUBST(LIBPST_CFLAGS)
1407         AC_SUBST(LIBPST_LIBS)
1409         if test "x$have_pst" = "xyes"; then
1410                 plugins_standard="$plugins_standard pst-import"
1411         else
1412                 AC_MSG_ERROR([
1414         libpst not found (or version < libpst_minimum_version)
1416         If you want to disable PST importing support,
1417         please append --disable-pst-import to configure.
1419         ])
1420         fi
1423 case x"$enable_plugins" in
1424 xno)
1425         plugins_enabled=""
1426         msg_plugins="no (some core functionality will not be available)"
1427         ;;
1428 xall | x | xyes)
1429         plugins_enabled="$plugins_base $plugins_standard"
1430         msg_plugins="yes (all)"
1431         ;;
1432 xbase)
1433         plugins_enabled="$plugins_base"
1434         msg_plugins="yes ($plugins_base)"
1435         ;;
1437         AC_MSG_ERROR([Invalid value for --enable-plugins.
1438         Please specify either "no", "base", or "all" (default=all)])
1439         ;;
1440 esac
1442 AC_SUBST(plugins_enabled)
1443 AC_SUBST(dist_plugins_base)
1444 AC_SUBST(dist_plugins_standard)
1446 dnl ******************
1447 dnl Sub-version number
1448 dnl ******************
1449 AC_ARG_WITH([sub-version],
1450         AS_HELP_STRING([--with-sub-version=VERSION],
1451         [Specify a sub-version string]))
1453 AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version", [Version substring, for packagers])
1455 dnl ********************************************
1456 dnl Glade 3 catalog files (for maintainers only)
1457 dnl ********************************************
1458 AC_ARG_WITH([glade-catalog],
1459         [AS_HELP_STRING([--with-glade-catalog],
1460         [Install the catalog files for Glade 3 ]
1461         [(for maintainers only) [default=no]])],
1462         [with_catalog="$withval"], [with_catalog="no"])
1463 if test "$with_catalog" = "yes"; then
1464         PKG_CHECK_MODULES(GLADEUI, [gladeui-2.0 >= gladeui_minimum_version])
1466 AM_CONDITIONAL(GLADE_CATALOG, test "x$with_catalog" != "xno")
1468 dnl ********************************************
1469 dnl Installed tests
1470 dnl ********************************************
1471 BEHAVE_INSTALLED_TESTS
1473 dnl ******************************
1474 dnl Makefiles
1475 dnl ******************************
1477 export privlibdir
1478 export privincludedir
1479 export privdatadir
1480 export plugindir
1482 EVOLUTION_DIR=`(cd $srcdir; pwd)`
1483 AC_SUBST(EVOLUTION_DIR)
1485 AC_CONFIG_FILES([ po/Makefile.in
1486 Makefile
1487 addressbook/Makefile
1488 addressbook/gui/Makefile
1489 addressbook/gui/contact-editor/Makefile
1490 addressbook/gui/contact-list-editor/Makefile
1491 addressbook/gui/widgets/Makefile
1492 addressbook/importers/Makefile
1493 addressbook/printing/Makefile
1494 addressbook/tools/Makefile
1495 addressbook/tools/csv2vcard
1496 addressbook/util/Makefile
1497 art/Makefile
1498 data/Makefile
1499 data/evolution.desktop.in
1500 data/evolution-alarm-notify.desktop.in
1501 data/icons/Makefile
1502 doc/Makefile
1503 doc/reference/Makefile
1504 doc/reference/evolution-mail-composer/Makefile
1505 doc/reference/evolution-mail-engine/Makefile
1506 doc/reference/evolution-mail-formatter/Makefile
1507 doc/reference/evolution-shell/Makefile
1508 doc/reference/evolution-util/Makefile
1509 e-util/Makefile
1510 em-format/Makefile
1511 help/Makefile
1512 help/quickref/Makefile
1513 help/quickref/C/Makefile
1514 help/quickref/ca/Makefile
1515 help/quickref/cs/Makefile
1516 help/quickref/de/Makefile
1517 help/quickref/es/Makefile
1518 help/quickref/hu/Makefile
1519 help/quickref/it/Makefile
1520 help/quickref/fr/Makefile
1521 help/quickref/oc/Makefile
1522 help/quickref/pl/Makefile
1523 help/quickref/pt/Makefile
1524 help/quickref/sv/Makefile
1525 help/quickref/sq/Makefile
1526 libemail-engine/Makefile
1527 libemail-engine/libemail-engine.pc
1528 libgnomecanvas/Makefile
1529 shell/Makefile
1530 shell/evo-version.h
1531 ui/Makefile
1532 views/Makefile
1533 views/addressbook/Makefile
1534 views/calendar/Makefile
1535 views/mail/Makefile
1536 views/tasks/Makefile
1537 views/memos/Makefile
1538 calendar/Makefile
1539 calendar/alarm-notify/Makefile
1540 calendar/importers/Makefile
1541 calendar/gui/Makefile
1542 calendar/gui/dialogs/Makefile
1543 composer/Makefile
1544 m4/Makefile
1545 mail/Makefile
1546 mail/default/Makefile
1547 mail/default/C/Makefile
1548 mail/default/ca/Makefile
1549 mail/default/cs/Makefile
1550 mail/default/de/Makefile
1551 mail/default/es/Makefile
1552 mail/default/fi/Makefile
1553 mail/default/fr/Makefile
1554 mail/default/hu/Makefile
1555 mail/default/id/Makefile
1556 mail/default/it/Makefile
1557 mail/default/ja/Makefile
1558 mail/default/ko/Makefile
1559 mail/default/lt/Makefile
1560 mail/default/mk/Makefile
1561 mail/default/nl/Makefile
1562 mail/default/pl/Makefile
1563 mail/default/pt/Makefile
1564 mail/default/ro/Makefile
1565 mail/default/sr/Makefile
1566 mail/default/sr@latin/Makefile
1567 mail/default/sv/Makefile
1568 mail/default/zh_CN/Makefile
1569 mail/importers/Makefile
1570 maint/Makefile
1571 modules/Makefile
1572 modules/addressbook/Makefile
1573 modules/backup-restore/Makefile
1574 modules/bogofilter/Makefile
1575 modules/book-config-google/Makefile
1576 modules/book-config-ldap/Makefile
1577 modules/book-config-local/Makefile
1578 modules/book-config-webdav/Makefile
1579 modules/cal-config-caldav/Makefile
1580 modules/cal-config-contacts/Makefile
1581 modules/cal-config-google/Makefile
1582 modules/cal-config-local/Makefile
1583 modules/cal-config-weather/Makefile
1584 modules/cal-config-webcal/Makefile
1585 modules/calendar/Makefile
1586 modules/composer-autosave/Makefile
1587 modules/contact-photos/Makefile
1588 modules/gravatar/Makefile
1589 modules/itip-formatter/Makefile
1590 modules/itip-formatter/plugin/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