Updated Spanish translation
[evolution.git] / configure.ac
blob1f50ea24d8ad8bf8b72ac84a8900af50c40f913c
1 dnl Evolution Versions
2 m4_define([evo_major_version], [3])
3 m4_define([evo_minor_version], [9])
4 m4_define([evo_micro_version], [92])
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.10
17 m4_define([base_version], [3.10])
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://www.gnome.org/projects/evolution/])
22 AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip -Wall -Wno-portability foreign])
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.34.0])
37 m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
39 dnl Keep these two definitions in agreement.
40 m4_define([gdk_minimum_version], [3.4.0])
41 m4_define([gdk_encoded_version], [GDK_VERSION_3_4])
43 dnl Keep these two definitions in agreement.
44 m4_define([soup_minimum_version], [2.40.3])
45 m4_define([soup_encoded_version], [SOUP_VERSION_2_40])
47 m4_define([eds_minimum_version], [evo_version])
48 m4_define([gtkhtml_minimum_version], [4.5.2])
49 m4_define([gdk_pixbuf_minimum_version], [2.24.0])
50 m4_define([gnome_desktop_minimum_version], [2.91.3])
51 m4_define([gnome_icon_theme_minimum_version], [2.30.2.1])
52 m4_define([gsettings_desktop_schemas_minimum_version], [2.91.92])
53 m4_define([webkitgtk_minimum_version], [1.10.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([gladeui_minimum_version], [3.10.0])
64 m4_define([gweather_minimum_version], [3.5.0])
65 m4_define([libcanberra_gtk_minimum_version], [0.25])
66 m4_define([libnotify_minimum_version], [0.7])
68 dnl XXX These versions don't yet exist.  The latest releases
69 dnl     link to gtk+-2.0 so we've bumped the versions to some
70 dnl     bogus value to force some plugins to be disabled.
71 m4_define([gtkimageview_minimum_version], [2.0])
73 dnl ******************************
74 dnl Compiler Warning Flags
75 dnl ******************************
76 AS_COMPILER_FLAGS(WARNING_FLAGS,
77         "-Wall -Wextra
78         -Wdeprecated-declarations
79         -Wno-missing-field-initializers
80         -Wno-sign-compare
81         -Wno-unused-parameter
82         -Wdeclaration-after-statement
83         -Werror-implicit-function-declaration
84         -Wformat-security -Winit-self
85         -Wmissing-declarations -Wmissing-include-dirs
86         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
87         -Wredundant-decls -Wundef -Wwrite-strings")
88 AC_SUBST(WARNING_FLAGS)
90 dnl Need to stop using e-passwords.h before we can restore
91 dnl -DEDS_DISABLE_DEPRECATED
93 dnl Other useful compiler warnings for test builds only.
94 dnl These may produce warnings we have no control over,
95 dnl or false positives we don't always want to see.
96 dnl
97 dnl     -Wmissing-format-attribute
98 dnl     -Wshadow
99 dnl     -Wformat-nonliteral
100 dnl     -Wstrict-aliasing=2
102 AM_CPPFLAGS="$WARNING_FLAGS -fno-strict-aliasing"
104 dnl *******************************
105 dnl Check for --enable-strict
106 dnl *******************************
107 AC_ARG_ENABLE([strict],
108         [AS_HELP_STRING([--enable-strict],
109         [enable strict building, like without deprecated symbols (default=auto); auto enables strict building only if .git subdirectory exists])],
110         [enable_strict=$enableval], [enable_strict=auto])
112 AC_MSG_CHECKING([if strict building is enabled])
113 if test "x$enable_strict" = xauto; then
114         dnl Be strict when compiling with .git subdirectory
115         if test -d .git ; then
116                 enable_strict=yes
117         else
118                 enable_strict=no
119         fi
121 AC_MSG_RESULT([$enable_strict])
123 if test "x$enable_strict" = xyes; then
124         AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED"
127 dnl Warn about API usage that violates our minimum requirements.
128 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
129 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
130 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
132 dnl These will suppress warnings about newly-deprecated symbols.  Ideally
133 dnl these settings should match our minimum requirements and we will clean
134 dnl up any new deprecation warnings after bumping our minimum requirements.
135 dnl But if the warnings get to be overwhelming, use fixed versions instead.
136 AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
137 AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2"
138 AM_CPPFLAGS="$AM_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
140 AC_SUBST(AM_CPPFLAGS)
142 AC_CANONICAL_HOST
143 AC_DEFINE_UNQUOTED(VERSION_COMMENT, "", [Define if you want a comment appended to the version number])
145 dnl This must stay after AC_CANONICAL_HOST, which defines $host.
146 case "$host" in
147 *openbsd*|*freebsd*)
148         dnl Do not set '-Wl,--no-undefined' on freebsd/openbsd
149         ;;
151         LDFLAGS="$LDFLAGS -Wl,--no-undefined"
152         ;;
153 esac
156 dnl *************************************
157 dnl Put the ACLOCAL flags in the Makefile
158 dnl *************************************
159 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
161 dnl ******************************
162 dnl Initialize maintainer mode
163 dnl ******************************
164 AM_MAINTAINER_MODE([enable])
166 if test "$evo_version" != "$evo_stable_version"; then
167         AC_DEFINE(STABLE_VERSION, ["evo_stable_version"],
168                 [Define to the latest stable version if this version is unstable])
171 AC_SUBST([BASE_VERSION], [base_version])
172 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
174 AC_SUBST([EVO_MAJOR_VERSION], [evo_major_version])
175 AC_SUBST([EVO_MINOR_VERSION], [evo_minor_version])
176 AC_SUBST([EVO_MICRO_VERSION], [evo_micro_version])
178 AC_PROG_CC
179 AC_C_INLINE
180 AC_PROG_CPP
181 AM_PROG_CC_C_O
182 AC_PROG_INSTALL
183 AC_PROG_LN_S
184 AC_PROG_MAKE_SET
185 AC_PROG_AWK
186 AC_PATH_PROG([PERL], [perl])
187 AC_SUBST(PERL)
189 AC_ARG_PROGRAM
191 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
192 dnl behavior that -- according to the C99 standard -- is supposed to be
193 dnl undefined.  We may still have aliasing abuses lying around that rely
194 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
195 dnl optimzation until we can find and fix all the abuses.
196 dnl (AC_PROG_CC must run first to set the GCC variable.)
197 dnl XXX This really belongs in AM_CFLAGS.
198 if test "x${GCC}" = "xyes"; then
199         CFLAGS="$CFLAGS -fno-strict-aliasing"
202 GLIB_GSETTINGS
204 dnl ******************************
205 dnl I18N stuff
206 dnl ******************************
207 IT_PROG_INTLTOOL([0.40.0])
209 GETTEXT_PACKAGE=evolution-$BASE_VERSION
210 AC_SUBST(GETTEXT_PACKAGE)
211 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
213 dnl ******************************
214 dnl Initialize libtool
215 dnl ******************************
216 LT_PREREQ(2.2)
217 LT_INIT(disable-static win32-dll)
219 PKG_PROG_PKG_CONFIG
221 dnl ********************************************
222 dnl User / Developer Documentation
223 dnl ********************************************
224 YELP_HELP_INIT
225 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
227 dnl ******************************
228 dnl Win32
229 dnl ******************************
230 AC_MSG_CHECKING([for Win32])
231 case "$host" in
232 *-mingw*)
233         os_win32=yes
234         NO_UNDEFINED='-no-undefined'
235         SOEXT='.dll'
236         DL_LIB=''
237         SOFTOKN3_LIB=''
238         CHAMPLAIN_REQUIREMENT=''
239         GEOCLUE_REQUIREMENT=''
240         ;;
241 *openbsd*|*freebsd*)
242         os_win32=no
243         NO_UNDEFINED=''
244         SOEXT='.so'
245         SA_JUNK_PLUGIN=sa-junk-plugin
246         BF_JUNK_PLUGIN=bogo-junk-plugin
247         DL_LIB=''
248         SOFTOKN3_LIB='-lsoftokn3'
249         ;;
251         os_win32=no
252         NO_UNDEFINED='-no-undefined'
253         SOEXT='.so'
254         DL_LIB='-ldl'
255         SOFTOKN3_LIB='-lsoftokn3'
256         ;;
257 esac
258 AC_MSG_RESULT([$os_win32])
259 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
260 AC_SUBST(NO_UNDEFINED)
261 AC_SUBST(SOEXT)
263 MATH_LIB="-lm"
264 AC_SUBST(MATH_LIB)
266 if test "$os_win32" = "yes"; then
267         AC_CHECK_TOOL(WINDRES, windres, :)
268 else
269         WINDRES=":"
272 AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
274 AC_SUBST(WINDRES)
276 dnl **********************************
277 dnl Check for base dependencies early.
278 dnl **********************************
279 PKG_CHECK_MODULES([GNOME_PLATFORM],
280         [gio-2.0 >= glib_minimum_version
281          gmodule-2.0 >= glib_minimum_version
282          cairo-gobject
283          gtk+-3.0 >= gdk_minimum_version
284          gail-3.0 >= gdk_minimum_version
285          gdk-pixbuf-2.0 >= gdk_pixbuf_minimum_version
286          libxml-2.0 >= libxml_minimum_version
287          shared-mime-info >= shared_mime_info_minimum_version
288          gnome-desktop-3.0 >= gnome_desktop_minimum_version
289          gsettings-desktop-schemas >= gsettings_desktop_schemas_minimum_version
290          webkitgtk-3.0 >= webkitgtk_minimum_version])
291 AC_SUBST(GNOME_PLATFORM_CFLAGS)
292 AC_SUBST(GNOME_PLATFORM_LIBS)
294 PKG_CHECK_MODULES([EVOLUTION_DATA_SERVER],
295         [camel-1.2 >= eds_minimum_version
296          libebook-1.2 >= eds_minimum_version
297          libecal-1.2 >= eds_minimum_version
298          libedataserver-1.2 >= eds_minimum_version
299          libebackend-1.2 >= eds_minimum_version])
300 AC_SUBST(EVOLUTION_DATA_SERVER_CFLAGS)
301 AC_SUBST(EVOLUTION_DATA_SERVER_LIBS)
303 dnl ******************************
304 dnl Canberra / Canberra-GTK Sound
305 dnl ******************************
306 AC_ARG_ENABLE([canberra],
307         [AS_HELP_STRING([--enable-canberra],
308         [Enable Canberra and Canberra-GTK sound @<:@default=yes@:>@])],
309         [enable_canberra="$enableval"], [enable_canberra=yes])
311 if test $enable_canberra = yes; then
312         PKG_CHECK_MODULES(
313                 [CANBERRA],
314                 [libcanberra-gtk3 >= libcanberra_gtk_minimum_version],,
315                 [AC_MSG_ERROR([
317         libcanberra-gtk3 not found (or version < libcanberra_gtk_minimum_version)
319         If you want to disable support for event sounds,
320         please append --disable-canberra to configure.
322         ])])
324         AC_DEFINE(HAVE_CANBERRA, 1, [Define if using Canberra and Canberra-GTK for sound])
326 AC_SUBST(CANBERRA_CFLAGS)
327 AC_SUBST(CANBERRA_LIBS)
329 dnl ******************
330 dnl User Documentation
331 dnl ******************
332 AC_MSG_CHECKING([whether to build user documentation])
333 AC_ARG_WITH([help],
334         [AS_HELP_STRING([--with-help],
335         [Build user documentation [default=yes]])],
336         [with_help="$withval"],[with_help="yes"])
337 AM_CONDITIONAL(WITH_HELP, test "x$with_help" != "xno")
338 AC_MSG_RESULT([$with_help])
340 dnl ******************************
341 dnl iconv checking
342 dnl ******************************
343 have_iconv=no
344 save_LIBS="$LIBS"
345 LIBS="$LIBS -liconv"
346 AC_CACHE_CHECK([for iconv in -liconv], [ac_cv_libiconv],
347         AC_LINK_IFELSE([AC_LANG_PROGRAM(
348         [[
349                 #include <iconv.h>
350                 #include <stdlib.h>
351         ]],
352         [[      iconv_t cd;
353                 cd = iconv_open ("UTF-8", "ISO-8859-1");
354         ]]
355         )],[ac_cv_libiconv=yes],[ac_cv_libiconv=no]))
357 if test $ac_cv_libiconv = yes; then
358         ICONV_LIBS="-liconv"
359         if test $os_win32 = yes; then
360                 dnl Don't pointlessly auto-export the global symbols
361                 dnl from a potentially static libiconv.a
362                 ICONV_LIBS="$ICONV_LIBS -Wl,--exclude-libs=libiconv.a"
363         fi
364         have_iconv=yes
365 else
366         LIBS="$save_LIBS"
367         AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
370 if test $have_iconv = yes; then
371         if test $ac_cv_libiconv = no; then
372                 AC_CHECK_FUNCS(gnu_get_libc_version)
373         fi
374 AC_CACHE_CHECK([if iconv() handles UTF-8], [ac_cv_libiconv_utf8],
375         AC_RUN_IFELSE([AC_LANG_SOURCE([[
376                 #include <iconv.h>
377                 #include <stdlib.h>
378                 #include <string.h>
379                 #ifdef HAVE_GNU_GET_LIBC_VERSION
380                 #include <gnu/libc-version.h>
381                 #endif
382                 int main() {
383                         char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
384                         char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
385                         char *transbuf = malloc (10), *trans = transbuf;
386                         iconv_t cd;
387                         size_t jp_len = strlen (jp), utf8_len = 10;
388                         size_t utf8_real_len = strlen (utf8);
390                         #ifdef HAVE_GNU_GET_LIBC_VERSION
391                         /* glibc 2.1.2's iconv is broken in hard to test ways. */
392                         if (!strcmp (gnu_get_libc_version (), "2.1.2"))
393                                 exit (1);
394                         #endif
396                         cd = iconv_open ("UTF-8", "ISO-2022-JP");
397                         if (cd == (iconv_t) -1)
398                                 exit (1);
399                         if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
400                                 exit (1);
401                         if (memcmp (utf8, transbuf, utf8_real_len) != 0)
402                                 exit (1);
403                         return (0);}
404                 ]])
405         ],[ac_cv_libiconv_utf8=yes],[ac_cv_libiconv_utf8=no; have_iconv=no],[ac_cv_libiconv_utf8=hopefully]))
408 if test "$have_iconv" = no; then
409         AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
411 AC_SUBST(ICONV_LIBS)
413 save_CFLAGS="$CFLAGS"
414 CFLAGS="$CFLAGS -I$srcdir"
416 AC_MSG_CHECKING([preferred charset name formats for system iconv])
417 AC_RUN_IFELSE([AC_LANG_SOURCE([[
418         #define CONFIGURE_IN
419         #include "iconv-detect.c"
420         ]])],
421         [AC_MSG_RESULT([found])],
422         [AC_MSG_RESULT([not found])
423                 AC_MSG_WARN([
424                 *** The iconv-detect program was unable to determine the
425                 *** preferred charset name formats recognized by your
426                 *** iconv library. It is suggested that you install a
427                 *** working iconv library such as the one found at
428                 *** ftp://ftp.gnu.org/pub/gnu/libiconv
429         ])],
430         [if test x$os_win32 = xyes; then
431                 AC_MSG_RESULT([using known win32 result])
432                 echo '/* This is an auto-generated header, DO NOT EDIT! */' > iconv-detect.h
433                 echo  >>iconv-detect.h
434                 echo '#define ICONV_ISO_D_FORMAT "iso-%d-%d"' >>iconv-detect.h
435                 echo '#define ICONV_ISO_S_FORMAT "iso-%d-%s"' >>iconv-detect.h
436                 echo '#define ICONV_10646 "UCS-4BE"' >>iconv-detect.h
437         else
438                 AC_MSG_RESULT([unknown])
439                 AC_MSG_WARN([
440                 *** We can't determine the preferred charset name formats
441                 *** recognized by your iconv library. You are
442                 *** cross-compiling and supposed to know what you are doing.
443                 *** Please construct the iconv-detect.h file manually.
444                 ])
445         fi
448 CFLAGS="$save_CFLAGS"
449 LIBS="$save_LIBS"
451 dnl **************
452 dnl waitpid() etc
453 dnl **************
454 AC_HEADER_SYS_WAIT
456 dnl ***************
457 dnl Purify support
458 dnl ***************
459 EVO_PURIFY_SUPPORT
461 dnl ***************
462 dnl Timezone checks
463 dnl ***************
464 AC_CACHE_CHECK(for tm_gmtoff in struct tm, [ac_cv_struct_tm_gmtoff],
465         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
466         [[      #include <time.h>       ]],
467         [[
468                 struct tm tm;
469                 tm.tm_gmtoff = 1;
470         ]]
471         )],[ac_cv_struct_tm_gmtoff=yes],[ac_cv_struct_tm_gmtoff=no]))
472 if test $ac_cv_struct_tm_gmtoff = yes; then
473         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
474 else
475         AC_CACHE_CHECK(for timezone variable, [ac_cv_var_timezone],
476                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
477                 [[      #include <time.h> ]],
478                 [[      timezone = 1;   ]]
479                 )],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no]))
480         if test $ac_cv_var_timezone = yes; then
481                 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
482                 AC_CACHE_CHECK(for altzone variable, [ac_cv_var_altzone],
483                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
484                         [[      #include <time.h>       ]],
485                         [[      altzone = 1; ]]
486                         )],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
487                 if test $ac_cv_var_altzone = yes; then
488                         AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
489                 fi
490         else
491                 AC_MSG_ERROR([unable to find a way to determine timezone])
492         fi
496 AC_CHECK_FUNCS(mkdtemp)
498 dnl **************************************************
499 dnl Gnome Icon Theme
500 dnl **************************************************
501 PKG_CHECK_MODULES([GIT], [gnome-icon-theme >= gnome_icon_theme_minimum_version])
503 dnl **************************************************
504 dnl Accessibility support
505 dnl **************************************************
506 PKG_CHECK_MODULES([A11Y], [atk])
507 AC_SUBST(A11Y_CFLAGS)
508 AC_SUBST(A11Y_LIBS)
510 dnl **************************************************
511 dnl XF86 multimedia keys support
512 dnl **************************************************
513 have_xfree=no
514 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
515         [[ #include <X11/XF86keysym.h> ]],[[]])],
516         [have_xfree=yes]
518 AC_MSG_CHECKING([for X11 XFree86 headers])
519 AC_MSG_RESULT([$have_xfree])
520 if test x"$have_xfree" = "xyes" ; then
521         AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
524 dnl **************************************************
525 dnl LDAP support.
526 dnl **************************************************
527 if test "$os_win32" != yes; then
528         EVO_LDAP_CHECK(no)
529         case $with_openldap in
530         no)
531                 msg_ldap=no
532                 ;;
533         *)
534                 case $with_static_ldap in
535                 yes)
536                         msg_ldap="yes (static)"
537                 ;;
538                 *)
539                         msg_ldap="yes (dynamic)"
540                         ;;
541                 esac
542         esac
544         SAVE_CFLAGS="$CFLAGS"
545         SAVE_LIBS="$LIBS"
546         LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_DEPRECATED"
547         CFLAGS="$CFLAGS $LDAP_CFLAGS"
548         LIBS="$LIBS $LDAP_LIBS"
549         AC_CHECK_FUNCS(ldap_ntlm_bind)
550         CFLAGS="$SAVE_CFLAGS"
551         LIBS="$SAVE_LIBS"
552 dnl Win32 support
553 else
554         LDAP_CFLAGS="-DLDAP_DEPRECATED"
555         LDAP_LIBS="-lwldap32"
556         AC_SUBST(LDAP_CFLAGS)
557         AC_SUBST(LDAP_LIBS)
558         AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
559         AM_CONDITIONAL(ENABLE_LDAP, true)
560         msg_ldap="yes"
563 dnl **************************************************
564 dnl SunLDAP support, but if OpenLDAP support, skip check SunLDAP.
565 dnl **************************************************
566 if test "$with_openldap" = no ; then
567         EVO_SUNLDAP_CHECK(no)
568         case $with_sunldap in
569         no)
570                 msg_ldap=no
571                 ;;
572         *)
573                 case $with_static_sunldap in
574                 yes)
575                         msg_ldap="$with_sunldap (static)"
576                         ;;
577                 *)
578                         msg_ldap="$with_sunldap (dynamic)"
579                         ;;
580                 esac
581         esac
582 else
583         with_sunldap=no
585 AM_CONDITIONAL(SUNLDAP, [test x$with_sunldap != xno])
587 AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
589 dnl *************************
590 dnl GTKHTML check
591 dnl XXX Drop the version from the package name?
592 dnl *************************
593 PKG_CHECK_MODULES([GTKHTML],
594         [libgtkhtml-4.0 >= gtkhtml_minimum_version
595          gtkhtml-editor-4.0])
596 AC_SUBST(GTKHTML_CFLAGS)
597 AC_SUBST(GTKHTML_LIBS)
599 dnl ************
600 dnl Kerberos 5
601 dnl ************
602 EVO_KRB5_SUPPORT(no)
604 dnl ********************************************************************************
605 dnl security extension support (SSL and S/MIME)
607 dnl The following voodoo does detection of mozilla libraries (nspr and nss)
608 dnl needed by Camel (SSL and S/MIME).
610 dnl The Evolution security extensions are only built if these libraries are found
611 dnl ********************************************************************************
612 msg_ssl="no"
613 msg_smime="no"
615 dnl these 2 enable's are inverses of each other
617 AC_ARG_ENABLE([nss],
618         AS_HELP_STRING([--enable-nss=@<:@yes/no/static@:>@],
619         [Attempt to use Mozilla libnss for SSL support.]),
620         [enable_nss=$enableval],[enable_nss=yes])
622 AC_ARG_ENABLE([smime],
623         AS_HELP_STRING([--enable-smime],
624         [Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)]),
625         [enable_smime=$enableval],[enable_smime=yes])
627 AC_ARG_WITH([nspr-includes],
628         AS_HELP_STRING([--with-nspr-includes=PATH],
629         [Location of Mozilla nspr4 includes.]))
631 AC_ARG_WITH([nspr-libs],
632         AS_HELP_STRING([--with-nspr-libs=PATH],
633         [Location of Mozilla nspr4 libs.]))
635 AC_ARG_WITH([nss-includes],
636         AS_HELP_STRING([--with-nss-includes=PATH],
637         [Location of Mozilla nss3 includes.]))
639 AC_ARG_WITH([nss-libs],
640         AS_HELP_STRING([--with-nss-libs=PATH],
641         [Location of Mozilla nss3 libs.]))
643 if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
644         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
645                 check_manually="yes"
646         else
647                 check_manually="no"
648         fi
650         if test "x${check_manually}" = "xno"; then
651                 AC_MSG_CHECKING([Mozilla NSPR pkg-config module name])
652                 mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr"
653                 for pc in $mozilla_nspr_pcs; do
654                         if $PKG_CONFIG --exists $pc; then
655                                 AC_MSG_RESULT([$pc])
656                                 mozilla_nspr=$pc
657                                 break;
658                         fi
659                 done
661                 AC_MSG_CHECKING([Mozilla NSS pkg-config module name])
662                 mozilla_nss_pcs="nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss"
663                 for pc in $mozilla_nss_pcs; do
664                         if $PKG_CONFIG --exists $pc; then
665                                 AC_MSG_RESULT([$pc])
666                                 mozilla_nss=$pc
667                                 break;
668                         fi
669                 done
671                 if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then
672                         msg_ssl="yes (Mozilla NSS)"
673                         if test "x$enable_smime" = "xyes"; then
674                                 AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
675                                 msg_smime="yes (Mozilla NSS)"
676                         fi
677                         AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
678                         AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
679                         AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"`$PKG_CONFIG --variable=libdir $mozilla_nss`",[Define to the full path of mozilla nss library])
680                         MANUAL_NSPR_CFLAGS=""
681                         MANUAL_NSPR_LIBS=""
682                         MANUAL_NSS_CFLAGS=""
683                         MANUAL_NSS_LIBS=""
684                 else
685                         check_manually="yes"
686                         mozilla_nspr=""
687                         mozilla_nss=""
688                 fi
689         fi
691         if test "x${check_manually}" = "xyes"; then
692                 mozilla_nss=""
693                 have_nspr_includes="no"
694                 if test "x${with_nspr_includes}" != "xno"; then
695                         CPPFLAGS_save="$CPPFLAGS"
697                         AC_MSG_CHECKING([for Mozilla nspr4 includes in $with_nspr_includes])
698                         AC_MSG_RESULT([""])
700                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
701                         AC_CHECK_HEADERS([nspr.h prio.h],[ moz_nspr_includes="yes" ],,
702                         [[
703                                 #if HAVE_NSPR_H
704                                 #include <nspr.h>
705                                 #include <prio.h>
706                                 #endif
707                         ]])
708                         CPPFLAGS="$CPPFLAGS_save"
710                         if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
711                                 have_nspr_includes="yes"
712                                 MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
713                         fi
714                 else
715                         AC_MSG_CHECKING([for Mozilla nspr4 includes])
716                         AC_MSG_RESULT([no])
717                 fi
719                 have_nspr_libs="no"
720                 if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
721                         CFLAGS_save="$CFLAGS"
722                         LDFLAGS_save="$LDFLAGS"
724                         if test "$enable_nss" = "static"; then
725                                 if test -z "${with_nspr_libs}"; then
726                                         AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
727                                         [Please specify the path to libnspr4.a]
728                                         [Example: --with-nspr-libs=/usr/lib])
729                                 else
730                                         nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a"
731                                 fi
732                         else
733                                 nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4"
734                         fi
736                         AC_CACHE_CHECK([for Mozilla nspr libraries], [ac_cv_moz_nspr_libs],
737                         [
738                                 LIBS_save="$LIBS"
739                                 CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
741                                 if test "x${with_nspr_libs}" != "x"; then
742                                         LIBS="$nsprlibs"
743                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
744                                 else
745                                         LIBS="$nsprlibs"
746                                         LDFLAGS="$LDFLAGS"
747                                 fi
749                                 AC_LINK_IFELSE([AC_LANG_CALL([], [PR_Init])],
750                                 [ac_cv_moz_nspr_libs="yes"], [ac_cv_moz_nspr_libs="no"])
751                                 CFLAGS="$CFLAGS_save"
752                                 LDFLAGS="$LDFLAGS_save"
753                                 LIBS="$LIBS_save"
754                         ])
755                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
756                                 have_nspr_libs="yes"
757                                 MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
758                         else
759                                 MANUAL_NSPR_CLFAGS=""
760                         fi
761                 else
762                         AC_MSG_CHECKING([for Mozilla nspr4 libraries])
763                         AC_MSG_RESULT([no])
764                 fi
766                 if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
767                         CPPFLAGS_save="$CPPFLAGS"
769                         AC_MSG_CHECKING([for Mozilla nss3 includes in $with_nss_includes])
770                         AC_MSG_RESULT([""])
772                         if test "x${with_nspr_includes}" != "x"; then
773                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
774                         else
775                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
776                         fi
778                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
779                                 [ have_nss_includes="yes" ],
780                                 [ have_nss_includes="no" ],
781                                 [
782                                         #if HAVE_NSPR_H
783                                         #include <nss.h>
784                                         #include <ssl.h>
785                                         #include <smime.h>
786                                         #endif
787                                 ])
789                         CPPFLAGS="$CPPFLAGS_save"
791                         if test "x${have_nss_includes}" = "xyes"; then
792                                 have_nss_includes="yes"
793                                 MANUAL_NSS_CFLAGS="-I$with_nss_includes"
794                         else
795                                 MANUAL_NSPR_CFLAGS=""
796                                 MANUAL_NSPR_LIBS=""
797                         fi
798                 else
799                         AC_MSG_CHECKING([for Mozilla nss3 includes])
800                         AC_MSG_RESULT([no])
801                 fi
803                 if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
804                         LDFLAGS_save="$LDFLAGS"
806                         if test "$enable_nss" = "static"; then
807                                 if test -z "${with_nss_libs}"; then
808                                         AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
809                                         [Please specify the path to libnss3.a]
810                                         [Example: --with-nspr-libs=/usr/lib/mozilla])
811                                 else
812                                         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"
813                                         case "$host" in
814                                                 *solaris*)
815                                                 nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
816                                         ;;
817                                         esac
818                                 fi
819                         else
820                                 nsslibs="-lssl3 -lsmime3 -lnss3"
821                         fi
823                         AC_CACHE_CHECK([for Mozilla nss libraries], [ac_cv_moz_nss_libs],
824                         [
825                                 LIBS_save="$LIBS"
826                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
827                                 LIBS="$nsslibs $nsprlibs"
828                                 AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
829                                 [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
830                                 if test "$ac_cv_moz_nss_libs" = no; then
831                                         nsslibs="-lssl3 -lsmime3 -lnss3"
832                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
833                                         AC_LINK_IFELSE([AC_LANG_CALL([], [NSS_Init])],
834                                         [ac_cv_moz_nss_libs="yes"], [ac_cv_moz_nss_libs="no"])
835                                 fi
836                                 LDFLAGS="$LDFLAGS_save"
837                                 LIBS="$LIBS_save"
838                         ])
839                         if test "$ac_cv_moz_nss_libs" != no; then
840                                 AC_DEFINE(HAVE_NSS)
841                                 AC_DEFINE(HAVE_SSL)
842                                 AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"$with_nss_libs", [Define to the full path of mozilla nss library])
843                                 if test "$enable_nss" = "static"; then
844                                         msg_ssl="yes (Mozilla NSS:static)"
845                                 else
846                                         msg_ssl="yes (Mozilla NSS)"
847                                 fi
848                                 dnl static_nss
849                                 if test "$enable_smime" = "yes"; then
850                                         AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled])
851                                         msg_smime="yes (Mozilla NSS)"
852                                 fi
853                                 MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
854                         else
855                                 MANUAL_NSS_CFLAGS=""
856                                 MANUAL_NSPR_CFLAGS=""
857                                 MANUAL_NSPR_LIBS=""
858                         fi
859                 else
860                         AC_MSG_CHECKING([for Mozilla nss libraries])
861                         AC_MSG_RESULT([no])
862                 fi
864                 MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
865                 MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
866         fi
869 AM_CONDITIONAL(ENABLE_SMIME, [test "x$msg_smime" != "xno"])
871 AC_SUBST(MANUAL_NSPR_CFLAGS)
872 AC_SUBST(MANUAL_NSPR_LIBS)
873 AC_SUBST(MANUAL_NSS_CFLAGS)
874 AC_SUBST(MANUAL_NSS_LIBS)
876 dnl *****************
877 dnl killall or pkill?
878 dnl *****************
880 case "$host" in
881 *solaris*)
882         KILL_PROCESS_CMD="/usr/bin/pkill -x"
883         ;;
885         AC_PATH_PROGS(KILL_PROCESS_CMD, killall pkill)
886         ;;
887 esac
888 if test -z "$KILL_PROCESS_CMD"; then
889         AC_MSG_WARN([Could not find a command to kill a process by name])
890 else
891         AC_DEFINE_UNQUOTED([KILL_PROCESS_CMD], "$KILL_PROCESS_CMD",
892                 [Command to kill processes by name])
895 dnl *******************
896 dnl GObject marshalling
897 dnl *******************
898 AM_PATH_GLIB_2_0
900 dnl *****************************************************************
901 dnl Utility macro to set compiler flags for a specific lib.
902 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
903 dnl *****************************************************************
904 AC_DEFUN([EVO_SET_COMPILE_FLAGS], [
905         PKG_CHECK_MODULES([$1], [$2])
906         $1_CFLAGS="[$]$1_CFLAGS $3"
907         $1_LIBS="[$]$1_LIBS $4"
910 dnl ******************************
911 dnl TNEF implementation
912 dnl ******************************
913 AC_MSG_CHECKING([for yTNEF])
914 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
915         [[
916                 #include <stdio.h>
917                 #include <ytnef.h>
918         ]],
919         [[      TNEFStruct *tnef;       ]]
920         )],     [tnef_ok=yes], [tnef_ok=no])
921 if test "$tnef_ok" = "yes"; then
922         AC_MSG_RESULT([yes])
923         TNEF_CFLAGS="-DHAVE_YTNEF_H"
924         AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])
925         
926 else
927         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
928         [[
929                 #include <stdio.h>
930                 #include <libytnef/ytnef.h>
931         ]],
932         [[      TNEFStruct *tnef;       ]]
933         )], [tnef_ok=yes], [tnef_ok=no])
934         if test "$tnef_ok" = "yes"; then
935                 AC_MSG_RESULT([yes])
936                 TNEF_CFLAGS="-DHAVE_LIBYTNEF_YTNEF_H"
937                 AC_DEFINE(ENABLE_TNEF,1,[Define if TNEF attachments parser should be built])            
938         else
939                 AC_MSG_RESULT([no])
940                 TNEF_CFLAGS=""
941         fi
943 AM_CONDITIONAL([ENABLE_TNEF], [test "$tnef_ok" = "yes"])
944 AC_SUBST(TNEF_CFLAGS)
946 if test "x$mozilla_nss" != "x"; then
947         EVO_SET_COMPILE_FLAGS(MOZILLA_NSS, $mozilla_nss)
948         MOZILLA_L_DIR=`${PKG_CONFIG} --libs-only-L $mozilla_nss`
949 else
950         if test "x$MOZILLA_MANUAL_LIBS" != "x"; then
951                 MOZILLA_L_DIR="-L$with_nss_lib"
952         fi
955 dnl **********************************
956 dnl Check for Bogofilter (spam filter)
957 dnl **********************************
958 AC_ARG_ENABLE([bogofilter],
959         [AS_HELP_STRING([--enable-bogofilter],
960         [enable spam filtering using Bogofilter (default=yes)])],
961         [enable_bogofilter=$enableval], [enable_bogofilter=yes])
962 AC_MSG_CHECKING([if Bogofilter support is enabled])
963 AC_MSG_RESULT([$enable_bogofilter])
964 msg_bogofilter="$enable_bogofilter"
965 if test "x$enable_bogofilter" = "xyes"; then
966         AC_ARG_VAR([BOGOFILTER], [Bogofilter spam filtering program])
967         AC_PATH_PROG([BOGOFILTER], [bogofilter])
968         if test "x$BOGOFILTER" == "x"; then
969                 AC_MSG_ERROR([
971         Bogofilter spam filtering program not found.
973         If you want to disable spam filtering using Bogofilter,
974         please append --disable-bogofilter to configure.
976         ])
977         fi
978         AC_DEFINE_UNQUOTED(
979                 BOGOFILTER_COMMAND, "$BOGOFILTER",
980                 [Bogofilter spam filtering program])
981         msg_bogofilter="$msg_bogofilter ($BOGOFILTER)"
983 AM_CONDITIONAL([ENABLE_BOGOFILTER], [test "x$enable_bogofilter" = "xyes"])
985 dnl ************************************
986 dnl Check for SpamAssassin (spam filter)
987 dnl ************************************
988 AC_ARG_ENABLE([spamassassin],
989         [AS_HELP_STRING([--enable-spamassassin],
990         [enable spam filtering using SpamAssassin (default=yes)])],
991         [enable spamassassin=$enableval], [enable_spamassassin=yes])
992 AC_MSG_CHECKING([if SpamAssassin support is enabled])
993 AC_MSG_RESULT([$enable_spamassassin])
994 msg_spamassassin="$enable_spamassassin"
995 if test "x$enable_spamassassin" = "xyes"; then
996         AC_ARG_VAR([SPAMASSASSIN], [SpamAssassin spam filtering program])
997         AC_PATH_PROG([SPAMASSASSIN], [spamassassin])
998         if test "x$SPAMASSASSIN" == "x"; then
999                 AC_MSG_ERROR([
1001         SpamAssassin spam filtering program not found.
1003         If you want to disable spam filtering using SpamAssassin,
1004         please append --disable-spamassassin to configure.
1006         ])
1007         fi
1008         AC_DEFINE_UNQUOTED(
1009                 SPAMASSASSIN_COMMAND, "$SPAMASSASSIN",
1010                 [SpamAssassin spam filtering program])
1012         AC_ARG_VAR([SA_LEARN], [SpamAssassin spam training program])
1013         AC_PATH_PROG([SA_LEARN], [sa-learn])
1014         if test "x$SA_LEARN" = "x"; then
1015                 AC_MSG_ERROR([
1017         SpamAssassin training program (sa-learn) not found.
1019         If you want to disable spam filtering using SpamAssassin,
1020         please append --disable-spamassassin to configure.
1022         ])
1023         fi
1024         AC_DEFINE_UNQUOTED(
1025                 SA_LEARN_COMMAND, "$SA_LEARN",
1026                 [SpamAssassin spam training program])
1028         msg_spamassassin="$msg_spamassassin ($SPAMASSASSIN)"
1030 AM_CONDITIONAL([ENABLE_SPAMASSASSIN], [test "x$enable_spamassassin" = "xyes"])
1032 dnl ******************************
1033 dnl CERT_UI Flags
1034 dnl ******************************
1036 dnl Here we want the Mozilla flags to go *before* the other ones,
1037 dnl especially the mozilla-nss -I flags to go before the gnutls ones
1038 dnl (which are dragged in through libedataserverui), as both
1039 dnl gnutls and mozilla-nss have a header called "pkcs12.h" which is
1040 dnl included in smime/lib/e-pkcs12.c. It wants the Mozilla NSS one.
1042 CERT_UI_CFLAGS="$MANUAL_NSS_CFLAGS $MOZILLA_NSS_CFLAGS"
1043 CERT_UI_LIBS="$MOZILLA_L_DIR $MANUAL_NSS_LIBS $MOZILLA_NSS_LIBS"
1044 AC_SUBST(CERT_UI_CFLAGS)
1045 AC_SUBST(CERT_UI_LIBS)
1047 dnl ***************
1048 dnl Libnotify Flags
1049 dnl ***************
1050 LIBNOTIFY_CFLAGS=
1051 LIBNOTIFY_LIBS=
1052 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= libnotify_minimum_version], [HAVE_LIBNOTIFY="yes"], [HAVE_LIBNOTIFY="no"])
1053 if test "x$HAVE_LIBNOTIFY" = "xyes"; then
1054         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if you have libnotify])
1055         libnotify="libnotify"
1056 else
1057         libnotify=""
1059 AC_SUBST(LIBNOTIFY_CFLAGS)
1060 AC_SUBST(LIBNOTIFY_LIBS)
1062 dnl **************
1063 dnl Calendar Flags
1064 dnl **************
1065 PKG_CHECK_MODULES([LIBSOUP], [libsoup-gnome-2.4 >= soup_minimum_version])
1066 AC_SUBST(LIBSOUP_CFLAGS)
1067 AC_SUBST(LIBSOUP_LIBS)
1069 PKG_CHECK_MODULES([GDATA], [libgdata >= libgdata_minimum_version])
1070 AC_SUBST(GDATA_CFLAGS)
1071 AC_SUBST(GDATA_LIBS)
1073 dnl ****************************
1074 dnl Check for ical_set_unknown_token_handling_setting function
1075 dnl ****************************
1076 AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
1077 save_cflags=$CFLAGS; CFLAGS="$EVOLUTION_DATA_SERVER_CFLAGS"
1078 save_libs=$LIBS; LIBS="$EVOLUTION_DATA_SERVER_LIBS"
1079 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1080         [[#include <libical/ical.h>]],
1081         [[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
1082         [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])
1083 CFLAGS=$save_cflags
1084 LIBS=$save_libs
1085 AC_MSG_RESULT([$ac_cv_have_iuth])
1087 dnl *******************
1088 dnl Special directories
1089 dnl *******************
1091 dnl If you add something here, consider whether or not you also need to add it to one or more .pc.in
1092 dnl files (for Connector, etc)
1094 privlibdir='${libdir}'/evolution/$BASE_VERSION
1095 AC_SUBST(privlibdir)
1097 privlibexecdir='${libexecdir}'/evolution/$BASE_VERSION
1098 AC_SUBST(privlibexecdir)
1100 privdatadir='${datadir}'/evolution/$BASE_VERSION
1101 AC_SUBST(privdatadir)
1103 privincludedir='${includedir}'/evolution-$BASE_VERSION
1104 AC_SUBST(privincludedir)
1106 moduledir="$privlibdir/modules"
1107 AC_SUBST(moduledir)
1109 uidir="$privdatadir/ui"
1110 AC_SUBST(uidir)
1112 evolutionhelpdir="$privdatadir/help"
1113 AC_SUBST(evolutionhelpdir)
1115 icondir="$privdatadir/icons"
1116 AC_SUBST(icondir)
1118 imagesdir="$privdatadir/images"
1119 AC_SUBST(imagesdir)
1121 if test "$os_win32" = yes; then
1122         dnl On Win32 there is no "rpath" mechanism. We install the private
1123         dnl shared libraries in $libdir, meaning the DLLs will actually be in
1124         dnl $bindir. This means just having $bindir in PATH will be enough. This
1125         dnl also means gnome_win32_get_prefixes() will be able to deduce the
1126         dnl installation folder correctly.
1127         privsolibdir=$libdir
1128 else
1129         privsolibdir=$privlibdir
1131 AC_SUBST(privsolibdir)
1133 soundsdir="$privdatadir/sounds"
1134 AC_SUBST(soundsdir)
1136 etspecdir="$privdatadir/etspec"
1137 AC_SUBST(etspecdir)
1139 viewsdir="$privdatadir/views"
1140 AC_SUBST(viewsdir)
1142 dnl For evolution-alarm-notify.desktop
1143 AS_AC_EXPAND(PRIVLIBEXECDIR, "$privlibexecdir")
1145 dnl ************************
1146 dnl Plugins
1147 dnl ************************
1149 plugindir="$privlibdir/plugins"
1150 AC_SUBST(plugindir)
1152 EVO_PLUGIN_RULE=$srcdir/plugin.mk
1153 AC_SUBST_FILE(EVO_PLUGIN_RULE)
1155 AC_ARG_ENABLE([plugins],
1156         AS_HELP_STRING([--enable-plugins=[no/base/all]],
1157         [Enable plugins.]),
1158         [enable_plugins="$enableval"],[enable_plugins=all])
1160 dnl Add any new plugins here
1161 plugins_base_always="publish-calendar"
1163 plugins_base="$plugins_base_always"
1164 dist_plugins_base="$plugins_base_always"
1166 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"
1168 plugins_standard="$plugins_standard_always"
1169 dist_plugins_standard="$plugins_standard image-inline pst-import"
1171 dnl ******************************************************************
1172 dnl The following plugins have additional library dependencies.
1173 dnl They must be explicitly disabled if the libraries are not present.
1174 dnl ******************************************************************
1176 dnl **************************************************
1177 dnl audio-inline plugin requires gstreamer-1.0 or 0.10
1178 dnl **************************************************
1179 AC_ARG_ENABLE([audio-inline],
1180         [AS_HELP_STRING([--enable-audio-inline],
1181         [Enable audio-inline plugin @<:@default=yes@:>@])],
1182         [enable_audio_inline="$enableval"], [enable_audio_inline=yes])
1184 if test "x$enable_audio_inline" = "xyes"; then
1185         PKG_CHECK_MODULES([GSTREAMER], [gstreamer-1.0], have_gst=yes,
1186                  [PKG_CHECK_MODULES([GSTREAMER], [gstreamer-0.10], have_gst=yes, have_gst=no)],
1187                  have_gst=no)
1188         AC_SUBST(GSTREAMER_CFLAGS)
1189         AC_SUBST(GSTREAMER_LIBS)
1191         if test "x$have_gst" = "xyes"; then
1192                 AC_DEFINE(ENABLE_AUDIO_INLINE, 1, [Define to add support for inlining audio attachments])
1193         else
1194                 AC_MSG_ERROR([
1196         gstreamer-1.0 or 0.10 not found.
1198         If you want to disable support for playing audio attachments,
1199         please append --disable-audio-inline to configure.
1201         ])
1202         fi
1205 AM_CONDITIONAL([ENABLE_AUDIO_INLINE], [test "x$enable_audio_inline" = "xyes"])
1207 dnl **************************************************
1208 dnl text-highlight plugins requires highlight utility
1209 dnl **************************************************
1210 AC_ARG_ENABLE([text-highlight],
1211         [AS_HELP_STRING([--enable-text-highlight],
1212         [Enable text-highlight plugin (default=yes)])],
1213         [enable_text_highlight="$enableval"], [enable_text_highlight=yes])
1214 AC_MSG_CHECKING([if source code highlighting support is enabled])
1215 AC_MSG_RESULT([$enable_text_highlight])
1216 msg_text_highlight="$enable_text_highlight"
1217 if test "x$enable_text_highlight" = "xyes"; then
1218         AC_ARG_VAR([HIGHLIGHT], [Source code highlighting utility])
1219         AC_PATH_PROG([HIGHLIGHT], [highlight])
1220         if test "x$HIGHLIGHT" == "x"; then
1221                 AC_MSG_ERROR([
1223         Highlight utility not found.
1225         If you want to disable syntax highlighting in emails,
1226         please append --disable-text-highlight to configure.
1228         ])
1229         fi
1230         AC_DEFINE_UNQUOTED(
1231                 HIGHLIGHT_COMMAND, "$HIGHLIGHT",
1232                 [Source code highlighting utility])
1234         msg_text_highlight="$msg_text_highlight ($HIGHLIGHT)"
1236 AM_CONDITIONAL([ENABLE_TEXT_HIGHLIGHT], [test "x$enable_text_highlight" = "xyes"])
1238 dnl **************************************
1239 dnl Weather calendars require gweather-3.0
1240 dnl **************************************
1241 AC_ARG_ENABLE([weather],
1242         [AS_HELP_STRING([--enable-weather],
1243         [Enable weather calendars @<:@default=yes@:>@])],
1244         [enable_weather="$enableval"],[enable_weather=yes])
1246 if test "x$enable_weather" != "xno"; then
1247         PKG_CHECK_MODULES(
1248                 [GWEATHER], [gweather-3.0 >= gweather_minimum_version],,
1249                 [AC_MSG_ERROR([
1251         gweather-3.0 not found (or version < gweather_minimum_version)
1253         If you want to disable weather calendar support,
1254         please append --disable-weather to configure.
1256         ])])
1258 AM_CONDITIONAL(ENABLE_WEATHER, [test "x$enable_weather" != "xno"])
1260 dnl ********************************************************************
1261 dnl maps in contacts preview requires champlain-gtk, geoclue and clutter
1262 dnl ********************************************************************
1263 AC_ARG_ENABLE([contact-maps],
1264         [AS_HELP_STRING([--enable-contact-maps],
1265         [Enable contact maps @<:@default=no@:>@])],
1266         [enable_contact_maps="$enableval"], [enable_contact_maps="no"])
1268 if test "x$enable_contact_maps" = "xyes"; then
1269         PKG_CHECK_MODULES(
1270                 [CHAMPLAIN],
1271                 [champlain-gtk-0.12 >= champlain_minimum_version],,
1272                 [AC_MSG_ERROR([
1274         champlain-gtk-0.12 not found.
1276         If you want to disable the contact maps feature,
1277         please append --disable-contact-maps to configure.
1279         ])])
1281         dnl Restrict geocode-glib dependency to 0.99.0 so
1282         dnl we don't have to chase subsequent API changes.
1283         PKG_CHECK_MODULES(
1284                 [GEO],
1285                 [geoclue >= geoclue_minimum_version
1286                  geocode-glib = 0.99.0],,
1287                 [AC_MSG_ERROR([
1289         geoclue and/or geocode-glib not found.
1291         If you want to disable the contact maps feature,
1292         please append --disable-contact-maps to configure.
1294         ])])
1296         PKG_CHECK_MODULES(
1297                 [CLUTTER_GTK],
1298                 [clutter-gtk-1.0 >= clutter_gtk_minimum_version],,
1299                 [AC_MSG_ERROR([
1301         clutter-gtk-1.0 not found (or version < clutter_gtk_minimum_version)
1303         If you want to disable the contact maps feature,
1304         please append --disable-contact-maps to configure.
1306         ])])
1308         AC_DEFINE(WITH_CONTACT_MAPS, 1, [When defined contacts preview will contain maps])
1311 dnl *****************************************
1312 dnl image-inline plugin requires gtkimageview
1313 dnl *****************************************
1314 AC_ARG_ENABLE([image-inline],
1315         [AS_HELP_STRING([--enable-image-inline],
1316         [Enable image-inline plugin @<:@default=no@:>@])],
1317         [enable_image_inline="$enableval"], [enable_image_inline=no])
1319 if test "x$enable_image_inline" = "xyes"; then
1320         PKG_CHECK_MODULES(GTKIMAGEVIEW, gtkimageview >= gtkimageview_minimum_version, have_imageview=yes, have_imageview=no)
1321         AC_SUBST(GTKIMAGEVIEW_CFLAGS)
1322         AC_SUBST(GTKIMAGEVIEW_LIBS)
1324         if test "x$have_imageview" = "xyes"; then
1325                 plugins_standard="$plugins_standard image-inline"
1326         else
1327                 AC_MSG_ERROR([
1329         gtkimageview not found (or version < gtkimageview_minimum_version)
1331         If you want to disable the image-inline plugin,
1332         please append --disable-image-inline to configure.
1334         ])
1335         fi
1338 dnl *********************************
1339 dnl pst-import plugin requires libpst
1340 dnl *********************************
1341 AC_ARG_ENABLE([pst-import],
1342         [AS_HELP_STRING([--enable-pst-import],
1343         [Enable pst-import plugin @<:@default=yes@:>@])],
1344         [enable_pst="$enableval"], [enable_pst=yes])
1346 if test "x$enable_pst" = "xyes"; then
1347         PKG_CHECK_MODULES(LIBPST, libpst >= libpst_minimum_version, have_pst=yes, have_pst=no)
1348         AC_SUBST(LIBPST_CFLAGS)
1349         AC_SUBST(LIBPST_LIBS)
1351         if test "x$have_pst" = "xyes"; then
1352                 plugins_standard="$plugins_standard pst-import"
1353         else
1354                 AC_MSG_ERROR([
1356         libpst not found (or version < libpst_minimum_version)
1358         If you want to disable PST importing support,
1359         please append --disable-pst-import to configure.
1361         ])
1362         fi
1365 case x"$enable_plugins" in
1366 xno)
1367         plugins_enabled=""
1368         msg_plugins="no (some core functionality will not be available)"
1369         ;;
1370 xall | x | xyes)
1371         plugins_enabled="$plugins_base $plugins_standard"
1372         msg_plugins="yes (all)"
1373         ;;
1374 xbase)
1375         plugins_enabled="$plugins_base"
1376         msg_plugins="yes ($plugins_base)"
1377         ;;
1379         AC_MSG_ERROR([Invalid value for --enable-plugins.
1380         Please specify either "no", "base", or "all" (default=all)])
1381         ;;
1382 esac
1384 AC_SUBST(plugins_enabled)
1385 AC_SUBST(dist_plugins_base)
1386 AC_SUBST(dist_plugins_standard)
1388 dnl ******************
1389 dnl Sub-version number
1390 dnl ******************
1391 AC_ARG_WITH([sub-version],
1392         AS_HELP_STRING([--with-sub-version=VERSION],
1393         [Specify a sub-version string]))
1395 AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version", [Version substring, for packagers])
1397 dnl ********************************************
1398 dnl Glade 3 catalog files (for maintainers only)
1399 dnl ********************************************
1400 AC_ARG_WITH([glade-catalog],
1401         [AS_HELP_STRING([--with-glade-catalog],
1402         [Install the catalog files for Glade 3 ]
1403         [(for maintainers only) [default=no]])],
1404         [with_catalog="$withval"], [with_catalog="no"])
1405 if test "$with_catalog" = "yes"; then
1406         PKG_CHECK_MODULES(GLADEUI, [gladeui-2.0 >= gladeui_minimum_version])
1408 AM_CONDITIONAL(GLADE_CATALOG, test "x$with_catalog" != "xno")
1410 dnl ******************************
1411 dnl Makefiles
1412 dnl ******************************
1414 export privlibdir
1415 export privincludedir
1416 export privdatadir
1417 export plugindir
1419 EVOLUTION_DIR=`(cd $srcdir; pwd)`
1420 AC_SUBST(EVOLUTION_DIR)
1422 AC_CONFIG_FILES([ po/Makefile.in
1423 Makefile
1424 addressbook/Makefile
1425 addressbook/gui/Makefile
1426 addressbook/gui/contact-editor/Makefile
1427 addressbook/gui/contact-list-editor/Makefile
1428 addressbook/gui/merging/Makefile
1429 addressbook/gui/widgets/Makefile
1430 addressbook/importers/Makefile
1431 addressbook/printing/Makefile
1432 addressbook/tools/Makefile
1433 addressbook/tools/csv2vcard
1434 addressbook/util/Makefile
1435 art/Makefile
1436 data/Makefile
1437 data/evolution.desktop.in
1438 data/evolution-alarm-notify.desktop.in
1439 data/icons/Makefile
1440 doc/Makefile
1441 doc/reference/Makefile
1442 doc/reference/evolution-mail-composer/Makefile
1443 doc/reference/evolution-mail-formatter/Makefile
1444 doc/reference/evolution-shell/Makefile
1445 doc/reference/evolution-util/Makefile
1446 e-util/Makefile
1447 em-format/Makefile
1448 help/Makefile
1449 help/quickref/Makefile
1450 help/quickref/C/Makefile
1451 help/quickref/ca/Makefile
1452 help/quickref/cs/Makefile
1453 help/quickref/de/Makefile
1454 help/quickref/es/Makefile
1455 help/quickref/hu/Makefile
1456 help/quickref/it/Makefile
1457 help/quickref/fr/Makefile
1458 help/quickref/oc/Makefile
1459 help/quickref/pl/Makefile
1460 help/quickref/pt/Makefile
1461 help/quickref/sv/Makefile
1462 help/quickref/sq/Makefile
1463 libemail-engine/Makefile
1464 libemail-engine/libemail-engine.pc
1465 libgnomecanvas/Makefile
1466 shell/Makefile
1467 shell/evo-version.h
1468 ui/Makefile
1469 views/Makefile
1470 views/addressbook/Makefile
1471 views/calendar/Makefile
1472 views/mail/Makefile
1473 views/tasks/Makefile
1474 views/memos/Makefile
1475 calendar/Makefile
1476 calendar/alarm-notify/Makefile
1477 calendar/importers/Makefile
1478 calendar/gui/Makefile
1479 calendar/gui/dialogs/Makefile
1480 composer/Makefile
1481 m4/Makefile
1482 mail/Makefile
1483 mail/default/Makefile
1484 mail/default/C/Makefile
1485 mail/default/ca/Makefile
1486 mail/default/cs/Makefile
1487 mail/default/de/Makefile
1488 mail/default/es/Makefile
1489 mail/default/fi/Makefile
1490 mail/default/fr/Makefile
1491 mail/default/hu/Makefile
1492 mail/default/id/Makefile
1493 mail/default/it/Makefile
1494 mail/default/ja/Makefile
1495 mail/default/ko/Makefile
1496 mail/default/lt/Makefile
1497 mail/default/mk/Makefile
1498 mail/default/nl/Makefile
1499 mail/default/pl/Makefile
1500 mail/default/pt/Makefile
1501 mail/default/ro/Makefile
1502 mail/default/sr/Makefile
1503 mail/default/sr@latin/Makefile
1504 mail/default/sv/Makefile
1505 mail/default/zh_CN/Makefile
1506 mail/importers/Makefile
1507 maint/Makefile
1508 modules/Makefile
1509 modules/addressbook/Makefile
1510 modules/audio-inline/Makefile
1511 modules/backup-restore/Makefile
1512 modules/bogofilter/Makefile
1513 modules/book-config-google/Makefile
1514 modules/book-config-ldap/Makefile
1515 modules/book-config-local/Makefile
1516 modules/book-config-webdav/Makefile
1517 modules/cal-config-caldav/Makefile
1518 modules/cal-config-contacts/Makefile
1519 modules/cal-config-google/Makefile
1520 modules/cal-config-local/Makefile
1521 modules/cal-config-weather/Makefile
1522 modules/cal-config-webcal/Makefile
1523 modules/calendar/Makefile
1524 modules/composer-autosave/Makefile
1525 modules/contact-photos/Makefile
1526 modules/gravatar/Makefile
1527 modules/itip-formatter/Makefile
1528 modules/itip-formatter/plugin/Makefile
1529 modules/mail-config/Makefile
1530 modules/mail/Makefile
1531 modules/mailto-handler/Makefile
1532 modules/mdn/Makefile
1533 modules/offline-alert/Makefile
1534 modules/plugin-lib/Makefile
1535 modules/plugin-manager/Makefile
1536 modules/prefer-plain/Makefile
1537 modules/prefer-plain/plugin/Makefile
1538 modules/settings/Makefile
1539 modules/spamassassin/Makefile
1540 modules/startup-wizard/Makefile
1541 modules/text-highlight/Makefile
1542 modules/tnef-attachment/Makefile
1543 modules/vcard-inline/Makefile
1544 modules/web-inspector/Makefile
1545 plugins/Makefile
1546 plugins/attachment-reminder/Makefile
1547 plugins/bbdb/Makefile
1548 plugins/dbx-import/Makefile
1549 plugins/email-custom-header/Makefile
1550 plugins/external-editor/Makefile
1551 plugins/face/Makefile
1552 plugins/image-inline/Makefile
1553 plugins/mail-notification/Makefile
1554 plugins/mail-to-task/Makefile
1555 plugins/mailing-list-actions/Makefile
1556 plugins/pst-import/Makefile
1557 plugins/publish-calendar/Makefile
1558 plugins/save-calendar/Makefile
1559 plugins/templates/Makefile
1560 smime/Makefile
1561 smime/lib/Makefile
1562 smime/gui/Makefile
1563 sounds/Makefile
1564 evolution-zip
1565 evolution-calendar.pc
1566 evolution-mail.pc
1567 evolution-shell.pc
1568 evolution-plugin.pc
1571 AC_OUTPUT
1573 if test "x$with_sub_version" != "x"; then
1574 echo "
1575         Evolution ($with_sub_version) has been configured as follows: "
1576 else
1577 echo "
1578         Evolution has been configured as follows: "
1581 echo "
1582         LDAP support:           $msg_ldap
1583         Contact Maps:           $enable_contact_maps
1584         Libnotify:              $HAVE_LIBNOTIFY
1585         Kerberos 5:             $msg_krb5
1586         SSL support:            $msg_ssl
1587         SMIME support:          $msg_smime
1588         Bogofilter support:     $msg_bogofilter
1589         SpamAssassin support:   $msg_spamassassin
1590         Highlight support:      $msg_text_highlight
1591         Plugins:                $msg_plugins
1592         User documentation:     $with_help
1593         Strict building:        $enable_strict