Fix CID 1402307: use after free, and do a proper freeing of struct.
[claws.git] / configure.ac
blobfacf5d70002a55c0df7c8a8a421b0c4b195b5597
2 AC_PREREQ(2.59)
3 AC_INIT(src/main.c)
4 AC_CONFIG_AUX_DIR(config)
5 AC_CONFIG_MACRO_DIR([m4])
7 PACKAGE=claws-mail
9 dnl version number
10 INTERFACE_AGE=0
11 BINARY_AGE=0
12 EXTRA_RELEASE=
13 EXTRA_GTK2_VERSION=
15 if test \( -d .git \); then
16     AC_CHECK_PROG([GIT], [git], [yes], [no], [$PATH])
17     if test \( "$GIT" = "no" \); then
18         AC_MSG_ERROR([*** git not found. See http://git-scm.com/])
19     else
20         GIT_VERSION=`git describe --abbrev=6 --dirty --always`
21         echo "echo ${GIT_VERSION}" > ./version
22     fi
23 else
24     GIT_VERSION=`sh -c ". $srcdir/version"`
27 if test \( -z "$GIT_VERSION" \); then
28         AC_MSG_ERROR([*** could not determine program version])
31 MAJOR_VERSION=${GIT_VERSION%%.*}
32 MINOR_VERSION=${GIT_VERSION#*.}
33 MINOR_VERSION=${MINOR_VERSION%%.*}
34 MICRO_VERSION=${GIT_VERSION##*.}
35 MICRO_VERSION=${MICRO_VERSION%%-*}
36 EXTRA_VERSION=${GIT_VERSION#*-}
37 EXTRA_VERSION=${EXTRA_VERSION%%-*}
39 if test \( "x$EXTRA_VERSION" != "x" -a `echo -n $EXTRA_VERSION | wc -c` -lt 5 \); then
40     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}git${EXTRA_VERSION}
41 else
42     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
43     EXTRA_VERSION=0
46 if test \( "x$EXTRA_RELEASE" != "x" \); then
47     VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
50 dnl set $target
51 AC_CANONICAL_SYSTEM
53 dnl
54 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
55 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
56 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
57 AC_SUBST(PACKAGE)
58 AC_SUBST(VERSION)
59 AC_SUBST(MAJOR_VERSION)
60 AC_SUBST(MINOR_VERSION)
61 AC_SUBST(MICRO_VERSION)
62 AC_SUBST(EXTRA_VERSION)
63 AC_SUBST(GIT_VERSION)
65 AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
66 AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
68 dnl Require pkg-config
69 m4_ifndef([PKG_PROG_PKG_CONFIG],
70     [m4_fatal([Could not locate the pkg-config autoconf macros. These
71 are usually located in /usr/share/aclocal/pkg.m4. If your macros
72 are in a different location, try setting the environment variable
73 ACLOCAL_FLAGS before running ./autogen.sh or autoreconf again. E.g.:
74 export ACLOCAL_FLAGS="-I/other/macro/dir"])
76 PKG_PROG_PKG_CONFIG
78 dnl libtool versioning
79 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
80 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
81 LT_REVISION=$INTERFACE_AGE
82 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
83 AC_SUBST(LT_RELEASE)
84 AC_SUBST(LT_CURRENT)
85 AC_SUBST(LT_REVISION)
86 AC_SUBST(LT_AGE)
88 dnl Specify a header configuration file
89 AC_CONFIG_HEADERS(config.h)
90 AC_CONFIG_HEADERS(claws-features.h)
92 AM_MAINTAINER_MODE
94 dnl Checks for programs.
95 dnl AC_ARG_PROGRAM
96 AC_PROG_CC
97 AC_ISC_POSIX
98 AC_PROG_INSTALL
99 AC_PROG_LN_S
100 AC_PROG_MAKE_SET
101 AC_PROG_CPP
102 dnl AC_PROG_RANLIB
103 AM_PROG_LEX
104 AC_PROG_YACC
105 AC_LIB_PREFIX
106 AC_LIBTOOL_WIN32_DLL
107 LT_INIT
108 LT_AC_PROG_RC
109 AC_LIBTOOL_RC
110 AC_PROG_LIBTOOL
111 AC_PROG_AWK
113 dnl AC_PROG_CXX will set CXX=g++ even if it finds no useable C++
114 dnl compiler, so we have to check whether the program named by
115 dnl CXX exists.
116 AC_PROG_CXX
117 AC_PATH_PROG(REAL_CXX, $CXX)
118 HAVE_CXX=no
119 if test -n "$REAL_CXX"; then
120         HAVE_CXX=yes
123 AC_SYS_LARGEFILE
125 dnl ******************************
126 dnl Checks for host
127 dnl Not needed anymore because we
128 dnl do AC_CANONICAL_SYSTEM above
129 dnl ******************************
130 dnl AC_CANONICAL_HOST
132 dnl Copied from the official gtk+-2 configure.in
133 AC_MSG_CHECKING([for host platform])
134 case "$host" in
135   *-*-mingw*|*-*-cygwin*)
136     platform_win32=yes
137     LDFLAGS="$LDFLAGS -mwindows -Wl,--export-all-symbols"
138     ;;
139         *-apple-*)
140                 platform_osx=yes
141                 LDFLAGS="$LDFLAGS -Wl,-export_dynamic"
142                 ;;
143   *)
144     platform_win32=no
145                 platform_osx=no
146                 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
147     ;;
148 esac
149 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
150 AM_CONDITIONAL(PLATFORM_OSX, test x"$platform_osx" = x"yes")
151 AC_MSG_RESULT([$host])
153 AC_MSG_CHECKING([for native Win32])
154 case "$host" in
155   *-*-mingw*)
156     os_win32=yes
157     ;;
158   *)
159     os_win32=no
160     ;;
161 esac
162 AC_MSG_RESULT([$os_win32])
163 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
165 AC_MSG_CHECKING([for Cygwin])
166 case "$host" in
167   *-*-cygwin*)
168     env_cygwin=yes
169     ;;
170   *)
171     env_cygwin=no
172     ;;
173 esac
174 AC_MSG_RESULT([$env_cygwin])
175 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
177 AC_MSG_CHECKING([for time_t format specifier])
178 case "$host" in
179   x86_64-w64-mingw32)
180     time_t_fmt=lld
181     ;;
182   *)
183     time_t_fmt=ld
184     ;;
185 esac
186 AC_MSG_RESULT([$time_t_fmt])
187 AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"],
188         [Define printf format specifier for time_t])
190 if test "$GCC" = "yes"
191 then
192         CFLAGS="$CFLAGS -Wno-unused-function"
193         #CFLAGS="-g -Wall -Wno-unused-function"
196 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
197 _gcc_cflags_save=$CFLAGS
198 CFLAGS="-Wno-pointer-sign"
199 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
200 AC_MSG_RESULT($_gcc_psign)
201 CFLAGS=$_gcc_cflags_save;
202 if test x"$_gcc_psign" = xyes ; then
203         CFLAGS="$CFLAGS -Wno-pointer-sign"
206 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
208 if test $USE_MAINTAINER_MODE = yes; then
209         CFLAGS="$CFLAGS -g -Wno-pointer-sign -DUSE_MAINTAINER_MODE"
212 pthread_name=
213 case "$target" in
214 *-darwin*)
215         CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
216         ;;
217 *-*-mingw*)
218         # Note that we need to link to pthread in all cases. This
219         # is because some locking is used even when pthread support is
220         # disabled.
221         pthread_name=pthread
222         CFLAGS="$CFLAGS -mms-bitfields"
223         LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
224         ;;
225 *-*-solaris*)
226         CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
227         CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
228         ;;
229 esac
231 dnl Checks for iconv
232 AM_ICONV
234 dnl floor and ceil are  in -lm
235 LIBS="$LIBS -lm"
238 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
240 syl_save_LIBS=$LIBS
241 LIBS="$LIBS $GTK_LIBS"
242 AC_CHECK_FUNCS(bind_textdomain_codeset)
243 LIBS=$syl_save_LIBS
245 dnl for gettext
246 ALL_LINGUAS="ca cs da de el_GR en_GB es fi fr hu id_ID it ja nb nl pl pt_BR pt_PT ro ru sk sv tr zh_TW"
247 GETTEXT_PACKAGE=claws-mail
248 AC_SUBST(GETTEXT_PACKAGE)
249 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
251 AM_GNU_GETTEXT_VERSION([0.18])
252 AM_GNU_GETTEXT([external])
254 AC_ARG_ENABLE(manual,
255                 [  --disable-manual                Do not build user manual],
256                 [enable_manual=$enableval], [enable_manual=yes])
258 AC_ARG_ENABLE(libsm,
259                 [  --disable-libsm                 Do not build libSM support for session management],
260                 [enable_libsm=$enableval], [enable_libsm=yes])
262 AC_ARG_ENABLE(ipv6,
263                 [  --disable-ipv6                  Do not build IPv6 support],
264                 [enable_ipv6=$enableval], [enable_ipv6=yes])
266 AC_ARG_ENABLE(gnutls,
267                 [  --disable-gnutls                Do not build GnuTLS support for TLS],
268                     [enable_gnutls=$enableval], [enable_gnutls=yes])
270 AC_ARG_ENABLE(enchant,
271                 [  --disable-enchant               Do not build Enchant support for spell-checking],
272                 [enable_enchant=$enableval], [enable_enchant=yes])
274 AC_ARG_ENABLE(crash-dialog,
275                 [  --enable-crash-dialog           Build crash dialog],
276                 [enable_crash_dialog=$enableval], [enable_crash_dialog=no])
278 AC_ARG_ENABLE(generic-umpc,
279                 [  --enable-generic-umpc           Build generic UMPC code],
280                 [enable_generic_umpc=$enableval], [enable_generic_umpc=no])
282 AC_ARG_ENABLE(compface,
283                 [  --disable-compface              Do not build compface support for X-Face],
284                 [enable_compface=$enableval], [enable_compface=yes])
286 AC_ARG_ENABLE(pthread,
287                 [  --disable-pthread               Do not build pthread support],
288                 [enable_pthread=$enableval], [enable_pthread=yes])
290 AC_ARG_ENABLE(startup-notification,
291                 [  --disable-startup-notification  Do not startup notification support],
292                 [enable_startup_notification=$enableval], [enable_startup_notification=yes])
294 AC_ARG_ENABLE(dbus,
295                 [  --disable-dbus                  Do not build DBUS support],
296                 [enable_dbus=$enableval], [enable_dbus=yes])
298 AC_ARG_ENABLE(ldap,
299                 [  --disable-ldap                  Do not build LDAP support],
300                 [enable_ldap=$enableval], [enable_ldap=yes])
302 AC_ARG_ENABLE(jpilot,
303                 [  --disable-jpilot                Do not build JPilot support],
304                 [enable_jpilot=$enableval], [enable_jpilot=yes])
306 AC_ARG_ENABLE(networkmanager,
307                 [  --disable-networkmanager        Do not build NetworkManager support],
308                 [enable_networkmanager=$enableval], [enable_networkmanager=yes])
310 AC_ARG_ENABLE(libetpan,
311                 [  --disable-libetpan              Do not build libetpan support for IMAP4/NNTP],
312                 [enable_libetpan=$enableval], [enable_libetpan=yes])
314 AC_ARG_ENABLE(valgrind,
315                 [  --disable-valgrind              Do not build valgrind support for debugging],
316                 [enable_valgrind=$enableval], [enable_valgrind=yes])
318 AC_ARG_ENABLE(alternate-addressbook,
319                 [  --enable-alternate-addressbook  Build alternate external address book support],
320                 [enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
322 AC_ARG_ENABLE(svg,
323         [  --disable-svg                   Do not build SVG support],
324         [enable_svg=$enableval], [enable_svg=yes])
326 AC_ARG_ENABLE(tests,
327                                 [  --enable-tests                   Build unit tests],
328                                 [enable_tests=$enableval], [enable_tests=no])
330 manualdir='${docdir}/manual'
331 AC_ARG_WITH(manualdir,
332         [  --with-manualdir=DIR    Manual directory],
333         [manualdir="$withval"])
334 AC_SUBST(manualdir)
336 dnl ******************************
337 dnl ** Check for required tools **
338 dnl ** to build manuals         **
339 dnl ******************************
341 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
342 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
343 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
344 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
346 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
347 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
348 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
349 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
351 if test x"$enable_manual" = x"yes"; then
352     if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
353         -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
354             enable_manual=yes
355         else
356             enable_manual=no
357     fi
360 AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
362 dnl Set PACKAGE_DATA_DIR in config.h.
363 if test "x${datarootdir}" = 'x${prefix}/share'; then
364         if test "x${prefix}" = "xNONE"; then
365                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
366         else
367                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
368         fi
369 else
370         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
373 AC_CHECK_LIB(xpg4, setlocale)
375 SM_LIBS=""
376 dnl Check for LibSM
377 AC_MSG_CHECKING([whether to use LibSM])
378 if test x"$enable_libsm" = xyes; then
379         AC_MSG_RESULT(yes)
380         AC_CHECK_LIB(SM, SmcSaveYourselfDone,
381                 [SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
382                 $X_LIBS -lICE)
383         AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
384         if test x"$enable_libsm" = xyes; then
385                 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
386         else
387                 AC_MSG_RESULT(not found)
388                 AC_MSG_WARN([*** LibSM will not be supported ***])
389         fi
390 else
391         AC_MSG_RESULT(no)
393 AC_SUBST(SM_LIBS)
395 dnl Check for __VA_OPT__ macro
396 AC_CACHE_CHECK([for __VA_OPT__],
397         [ac_cv_va_opt],
398         [AC_TRY_COMPILE([#include <stdio.h>],
399                 [#define va_opt_printf(format, ...) fprintf(stderr, format __VA_OPT__(,) __VA_ARGS__)
400                 va_opt_printf("success\n");],
401                 [ac_cv_va_opt=yes],
402                 [ac_cv_va_opt=no])]
404 if test "$ac_cv_va_opt" = yes; then
405         AC_DEFINE([HAVE_VA_OPT], [1], [Define if __VA_OPT__ macro works])
408 dnl Check for d_type member in struct dirent
409 AC_MSG_CHECKING([whether struct dirent has d_type member])
410 AC_CACHE_VAL(ac_cv_dirent_d_type,[
411         AC_TRY_COMPILE([#include <dirent.h>],
412                        [struct dirent d; d.d_type = DT_REG;],
413                        ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
415 AC_MSG_RESULT($ac_cv_dirent_d_type)
416 if test $ac_cv_dirent_d_type = yes; then
417         AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
418                   Define if `struct dirent' has `d_type' member.)
421 # Check whether mkdir does not take the permission argument.
422 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
424 dnl Checks for header files.
425 AC_HEADER_DIRENT
426 AC_HEADER_STDC
427 AC_HEADER_SYS_WAIT
428 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
429                  sys/param.h sys/utsname.h sys/select.h \
430                  wchar.h wctype.h locale.h netdb.h)
431 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
432 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
434 dnl Checks for typedefs, structures, and compiler characteristics.
435 AC_C_CONST
436 AC_TYPE_OFF_T
437 AC_TYPE_PID_T
438 AC_TYPE_SIZE_T
439 AC_STRUCT_TM
441 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
442 dnl may be defined only in wchar.h (this happens with gcc-2.96).
443 dnl So we need to use this extended macro.
444 CLAWS_CHECK_TYPE(wint_t, unsigned int,
446 #if HAVE_WCHAR_H
447 #include <wchar.h>
448 #endif
449 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
451 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
452 AC_CHECK_SIZEOF(unsigned short, 2)
453 AC_CHECK_SIZEOF(unsigned int, 4)
454 AC_CHECK_SIZEOF(unsigned long, 4)
456 dnl Checks for library functions.
457 AC_FUNC_ALLOCA
458 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr strcasestr \
459                uname flock lockf inet_aton inet_addr \
460                fchmod mkstemp truncate getuid regcomp)
462 AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
464 dnl *****************
465 dnl ** common code **
466 dnl *****************
468 dnl check for glib
469 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28 gmodule-2.0 >= 2.28 gobject-2.0 >= 2.28 gthread-2.0 >= 2.28])
471 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
472 AC_SUBST(GLIB_GENMARSHAL)
474 AC_SUBST(GLIB_CFLAGS)
475 AC_SUBST(GLIB_LIBS)
477 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
479 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
480 syl_save_LIBS=$LIBS
481 LIBS="$LIBS $GTK_LIBS"
482 AC_CHECK_FUNCS(bind_textdomain_codeset)
483 LIBS=$syl_save_LIBS
485 dnl check for IPv6 option
486 dnl automated checks for IPv6 support.
487 AC_MSG_CHECKING([whether to use IPv6])
488 if test x"$enable_ipv6" = xyes; then
489         AC_MSG_RESULT(yes)
490         AC_MSG_CHECKING([for IPv6 support])
491         if test x"$platform_win32" = xyes; then
492                 AC_CACHE_VAL(ac_cv_ipv6,[
493                         AC_TRY_COMPILE([
494                                         #include <ws2tcpip.h>
495                                 ], [struct in6_addr a;],
496                                 ac_cv_ipv6=yes, ac_cv_ipv6=no)
497                 ])
498         else
499                 AC_CACHE_VAL(ac_cv_ipv6,[
500                         AC_TRY_COMPILE([
501                                         #define INET6
502                                         #include <sys/types.h>
503                                         #include <netinet/in.h>
504                                 ], [int x = IPPROTO_IPV6; struct in6_addr a;],
505                                 ac_cv_ipv6=yes, ac_cv_ipv6=no)
506                 ])
507         fi
508         AC_MSG_RESULT($ac_cv_ipv6)
509         if test $ac_cv_ipv6 = yes; then
510                 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
511         else
512                 AC_MSG_WARN(*** IPv6 will not be supported ***)
513                 enable_ipv6=no
514         fi
515 else
516         AC_MSG_RESULT(no)
519 dnl GNUTLS
520 AC_MSG_CHECKING([whether to use GnuTLS])
521 AC_MSG_RESULT($enable_gnutls)
522 if test "x$enable_gnutls" != "xno"; then
523         PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
524         [
525                 AC_DEFINE(USE_GNUTLS, 1, gnutls)
526                 echo "Building with GnuTLS"
527                 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
528                 [
529                         dnl No linking against libgcrypt needed
530                 ],
531                 [
532                         dnl linking against libgcrypt *is* needed
533                         GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
534                 ])
535         ],
536         [
537                 echo "Building without GnuTLS"
538                 AC_MSG_RESULT([*** GnuTLS support is recommended ])
539                 AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
540                 AC_MSG_ERROR([GnuTLS not found])
541         ])
542         AC_SUBST(GNUTLS_LIBS)
543         AC_SUBST(GNUTLS_CFLAGS)
546 PKG_CHECK_MODULES(NETTLE, nettle)
547 AC_SUBST(NETTLE_LIBS)
549 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
550             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
551 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
553 dnl RC dir (will be default at a certain point in time)
554 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .claws-mail)],
555               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
557 dnl Set correct default value based on platform
558 if test x"$ac_cv_with_config_dir" = x""; then
559         if test x"$platform_win32" = xyes; then
560                 ac_cv_with_config_dir="Claws-mail"
561         else
562                 ac_cv_with_config_dir=".claws-mail"
563         fi
565 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
567 AC_ARG_WITH(password-encryption, [  --with-password-encryption=PROVIDER    Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
568                                                 pwd_crypto="$withval", pwd_crypto="default")
570 if test x"$pwd_crypto" = xdefault; then
571         if test x"$enable_gnutls" = xyes; then
572                 if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
573                         pwd_crypto="gnutls"
574                 fi
575         fi
577 if test x"$pwd_crypto" = xdefault; then
578         pwd_crypto="old"
581 case $pwd_crypto in
582         gnutls)
583                 if test x"$enable_gnutls" = xno; then
584                         AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
585                 fi
586                 if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
587                         AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
588                 fi
589                 AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
590                 ;;
591         old)
592                 AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
593                 ;;
594         *)
595                 AC_MSG_ERROR([Unknown password encryption provider requested.])
596                 ;;
597 esac
600 dnl ************************
601 dnl ** GTK user interface **
602 dnl ************************
604 dnl Checks for GTK
605 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
607 AC_ARG_ENABLE(deprecated,
608                 [  --disable-deprecated            Disable deprecated GTK functions],
609                 gtkdeprecated=$enableval)
610 AC_MSG_CHECKING([whether to use deprecated GTK functions])
611 if test x"$gtkdeprecated" != xno; then
612         AC_MSG_RESULT(yes)
613 else
614         GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
615         AC_MSG_RESULT(no)
618 dnl Make sure the code does not regress to using deprecated GTK stuff...
619 GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
621 AC_SUBST(GTK_CFLAGS)
622 AC_SUBST(GTK_LIBS)
624 dnl enchant is used for spell checking
625 AC_MSG_CHECKING([whether to use enchant])
626 AC_MSG_RESULT($enable_enchant)
627 if test $enable_enchant = yes; then
628         PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
629         [
630                 AC_DEFINE(USE_ENCHANT, 1, enchant)
631                 echo "Building with enchant"
632                 enable_enchant=yes
633         ],
634         [
635                 PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
636                 [
637                         AC_DEFINE(USE_ENCHANT, 1, enchant-2)
638                         echo "Building with enchant-2"
639                         enable_enchant=yes
640                 ],
641                 [
642                         echo "Building without enchant-notification"
643                         enable_enchant=no
644                 ])
645         ])
646         AC_SUBST(ENCHANT_CFLAGS)
647         AC_SUBST(ENCHANT_LIBS)
650 dnl want crash dialog
651 if test $enable_crash_dialog = yes; then
652 dnl check if GDB is somewhere
653         AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
654         AC_MSG_CHECKING([whether to use crash dialog])
655         if test $enable_crash_dialog = yes; then
656                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
657         fi
658         AC_MSG_RESULT($enable_crash_dialog)
661 dnl generic umpc
662 if test $enable_generic_umpc = yes; then
663         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
664         AC_MSG_RESULT($enable_generic_umpc)
667 dnl Check for X-Face support
668 AC_MSG_CHECKING([whether to use compface])
669 if test x"$enable_compface" = xyes; then
670         AC_MSG_RESULT(yes)
671         AC_CHECK_LIB(compface, uncompface,
672                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
673                 [enable_compface=no])
674         if test x"$enable_compface" = xyes; then
675                 COMPFACE_LIBS="-lcompface"
676         else
677                 COMPFACE_LIBS=""
678         fi
679         AC_SUBST(COMPFACE_LIBS)
680 else
681         AC_MSG_RESULT(no)
684 dnl check for pthread support
685 AC_MSG_CHECKING([whether to use pthread])
686 if test x$enable_pthread = xno; then
687         AC_MSG_RESULT(no)
688 else
689         AC_MSG_RESULT(yes)
691         # For W32 we need to use a special ptrhead lib. In this case we can't
692         # use AC_CHECK_LIB because it has no means of checking for a
693         # library installed under a different name.  Checking for the
694         # header is okay.
695         if test -n "${pthread_name}" ; then
696            enable_pthread=yes
697         else
698         AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
699         fi
700         AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
702         if test x$enable_pthread = xyes; then
703                 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
704                 if test -z "${pthread_name}" ; then
705                 PTHREAD_LIBS="-lpthread"
706         fi
707         fi
710 AC_SUBST(PTHREAD_LIBS)
713 dnl Check whether we need to pass -lresolv
714 dnl We know that we don't need it for W32.
716 if test x$os_win32 = xno; then
717   t_oldLibs="$LIBS"
718   LIBS="$LIBS"
719   ac_cv_var__res_options=no
720   AC_TRY_LINK([#include <sys/types.h>
721              #include <sys/socket.h>
722              #include <netinet/in.h>
723              #include <arpa/nameser.h>
724              #include <resolv.h>],
725                 [_res.options = RES_INIT;],
726                 ac_cv_var__res_options=yes);
727   if test "$ac_cv_var__res_options" != "yes"; then
728         LIBRESOLV="-lresolv"
729   fi
730   LIBS="$t_oldLibs"
732   if test "x$LIBRESOLV" = "x"; then
733         AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
734         LIBS="$t_oldLibs"
735   fi
737 AC_SUBST(LIBRESOLV)
739 LIBS="$LIBS $LIBRESOLV"
741 dnl #######################################################################
742 dnl # Check for startup notification
743 dnl #######################################################################
744 if test "x$enable_startup_notification" = "xyes"; then
745         PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
746         [
747                 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
748                 echo "Building with libstartup-notification"
749                 enable_startup_notification=yes
750         ],
751         [
752                 echo "Building without libstartup-notification"
753                 enable_startup_notification=no
754         ])
756         AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
757         AC_SUBST(STARTUP_NOTIFICATION_LIBS)
760 dnl #######################################################################
761 dnl # Check for D-Bus support
762 dnl #######################################################################
763 if test "x$enable_dbus" = "xyes"; then
764         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
765         [
766                 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
767                 enable_dbus=yes
768         ],
769         [
770                 echo "D-Bus requirements not met. D-Bus support not activated."
771                 enable_dbus=no
772         ])
773         AC_SUBST(DBUS_CFLAGS)
774         AC_SUBST(DBUS_LIBS)
777 dnl #######################################################################
778 dnl # Configure address book support
779 dnl #######################################################################
781 dnl #######################################################################
782 dnl # Check for alternate address book support
783 dnl #######################################################################
784 AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
785 if test x"$enable_dbus" = xyes; then
786         AC_MSG_RESULT([yes])
787         AC_MSG_CHECKING([whether to enable alternate address book])
788         if test x"$enable_alternate_addressbook" = xyes; then
789                 AC_MSG_RESULT([yes])
790                 PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
791                 [
792                         AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
793                         enable_alternate_addressbook=yes
794                         AC_SUBST(CONTACTS_CFLAGS)
795                         AC_SUBST(CONTACTS_LIBS)
796                 ],
797                 [
798                         enable_alternate_addressbook=no
799                 ])
800         else
801                 AC_MSG_RESULT([no])
802                 enable_alternate_addressbook=no
803         fi
804 else
805         AC_MSG_RESULT([no])
806         enable_alternate_addressbook=no
809 dnl #######################################################################
810 dnl # Check for old address book support
811 dnl #######################################################################
812 if test x"$enable_alternate_addressbook" = xno; then
813         dnl for LDAP support in addressbook
814         dnl no check for libraries; dynamically loaded
815         AC_MSG_CHECKING([whether to use LDAP])
816         if test x"$enable_ldap" = xno; then
817                 AC_MSG_RESULT(no)
818         elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
819                 AC_MSG_RESULT(no - LDAP support needs pthread support)
821                 enable_ldap=no
822         elif test x"$platform_win32" = xyes; then
823                 AC_MSG_RESULT(yes)
824                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
825                 LDAP_LIBS="-lwldap32"
826                 AC_SUBST(LDAP_LIBS)
827         else
828                 AC_MSG_RESULT(yes)
830                 dnl check for available libraries, and pull them in
831                 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
832                 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
833                 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
834                 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
835                                  $LDAP_LIBS)
837                 AC_CHECK_HEADERS(ldap.h lber.h,
838                                  [ enable_ldap=yes ],
839                                  [ enable_ldap=no ])
841                 if test "$enable_ldap" = yes; then
842                         AC_CHECK_LIB(ldap, ldap_open,
843                                          [ enable_ldap=yes ],
844                                          [ enable_ldap=no ],
845                                          $LDAP_LIBS)
847                         AC_CHECK_LIB(ldap, ldap_start_tls_s,
848                                              [ ac_cv_have_tls=yes ],
849                                              [ ac_cv_have_tls=no ])
851                 fi
853                 AC_MSG_CHECKING([whether ldap library is available])
854                 AC_MSG_RESULT($enable_ldap)
856                 AC_MSG_CHECKING([whether TLS library is available])
857                 AC_MSG_RESULT($ac_cv_have_tls)
859                 if test "$enable_ldap" = yes; then
860                         AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
861                         LDAP_LIBS="$LDAP_LIBS -lldap"
862                         AC_SUBST(LDAP_LIBS)
863                         if test "$ac_cv_have_tls" = yes; then
864                                 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
865                         fi
866                         dnl As of OpenLDAP API version 3000 a number of functions has
867                         dnl been deprecated. As Claws-mail compiles and runs on many
868                         dnl platforms and many versions of OpenLDAP we need to be able
869                         dnl to switch between the old and new API because new API has
870                         dnl added new functions replacing old ones and at the same time
871                         dnl old functions has been changed.
872                         dnl If cross-compiling defaults to enable deprecated features
873                         dnl for maximum portability
874                         AC_MSG_CHECKING([The API version of OpenLDAP])
875                         AC_RUN_IFELSE(
876                                 [AC_LANG_PROGRAM(
877                                  [#include <ldap.h>],
878                                  [if (LDAP_API_VERSION >= 3000)
879                                                 return 1
880                                 ])],
881                                 [AC_MSG_RESULT([version < 3000])
882                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
883                                 [AC_MSG_RESULT([version >= 3000])
884                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
885                                 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
886                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
887                                  AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
888                         )
889                 fi
890         fi
892         dnl for JPilot support in addressbook
893         dnl no check for libraries; these are dynamically loaded
894         AC_MSG_CHECKING([whether to use JPilot])
895         if test "$enable_jpilot" = yes; then
896                 AC_MSG_RESULT(yes)
897                 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
898                                  [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
899                                  [ enable_jpilot=no ])
900                 if test "$enable_jpilot" = no; then
901                         AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
902                                          [ enable_jpilot=yes
903                                            AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
904                 fi
906                 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
907                 if test x"$enable_jpilot" = xyes; then
908                         AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
909                 else
910                         AC_MSG_NOTICE([JPilot support not available])
911                 fi
912                 AC_SUBST(JPILOT_LIBS)
913         else
914                 AC_MSG_RESULT(no)
915         fi
918 AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
920 dnl #######################################################################
921 dnl # Check for NetworkManager support
922 dnl #######################################################################
923 if test x"$enable_dbus" = xyes; then
924         if test x"$enable_networkmanager" = xyes; then
925                 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
926                 [
927                         AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
928                         echo "Building with NetworkManager support"
929                         enable_networkmanager=yes
930                 ],
931                 [
932                         echo "NetworkManager not found."
933                         enable_networkmanager=no
934                 ])
935                 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
936         fi
937 else
938         echo "NetworkManager support deactivated as D-Bus requirements were not met."
939         enable_networkmanager=no
942 dnl Libetpan
943 AC_MSG_CHECKING([whether to use libetpan])
944 if test x"$enable_libetpan" = xyes; then
945     AC_MSG_RESULT(yes)
947     libetpan_config=no
948     libetpan_result=no
949     libetpan_versiontype=0
951     # since 1.9.4, libetpan uses pkg-config
952     PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
953     [
954         LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
955         libetpan_config=yes
956     ],
957     [
958         # before 1.9.4, libetpan uses its own libetpan-config script
959         AC_PATH_PROG(libetpanconfig, [libetpan-config])
960         if test "x$libetpanconfig" != "x"; then
961             LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
962             LIBETPAN_LIBS="`$libetpanconfig --libs`"
963             # support libetpan version like x.x and x.x.x
964             libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
965             if test $libetpan_versiontype -eq 1; then
966                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
967             else
968                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
969             fi
970             libetpan_config=yes
971         fi
972     ])
973     if test "x$libetpan_config" = "xyes"; then
974         CPPFLAGS="$CPPFLAGS $LIBETPAN_FLAGS"
975         AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
976         if test "x$libetpan_result" = "xyes"; then
977             AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
978             LIBS="$LIBS $LIBETPAN_LIBS"
979             AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
980             AC_MSG_RESULT([$libetpan_result])
981         fi
982     fi
983     if test "x$libetpan_result" = "xyes"; then
984         if test $libetpan_versiontype -eq 1; then
985             if test "$LIBETPAN_VERSION" -lt "57"; then
986                 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
987                 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
988                 AC_MSG_ERROR([libetpan 0.57 not found])
989             fi
990         fi
991         AC_SUBST(LIBETPAN_FLAGS)
992         AC_SUBST(LIBETPAN_LIBS)
993         AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
994     else
995         AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
996         AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
997         AC_MSG_ERROR([libetpan 0.57 not found])
998     fi
999 else
1000     AC_MSG_RESULT(no)
1002 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1004 dnl librsvg
1005 AC_MSG_CHECKING([whether to use librsvg])
1006 if test x"$enable_svg" = xyes; then
1007         AC_MSG_RESULT(yes)
1008     PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
1009     [
1010         AC_SUBST(SVG_CFLAGS)
1011         AC_SUBST(SVG_LIBS)
1012                 AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
1013                 enable_svg=yes
1014         ],
1015         [
1016                 AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
1017                 enable_svg=no
1018         ])
1019 else
1020         AC_MSG_RESULT(no)
1023 AC_MSG_CHECKING([whether to use valgrind])
1024 if test x$enable_valgrind = xyes; then
1025         AC_MSG_RESULT(yes)
1026         PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1027                           enable_valgrind=yes, enable_valgrind=no)
1028         if test x"$enable_valgrind" = xyes; then
1029                 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1030         else
1031                 AC_MSG_RESULT(not found)
1032         fi
1033 else
1034         AC_MSG_RESULT(no)
1036 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
1038 AC_MSG_CHECKING([whether to build unit tests])
1039 if test x$enable_tests = xyes; then
1040         AC_MSG_RESULT(yes)
1041 else
1042         AC_MSG_RESULT(no)
1044 AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
1046 dnl *************************
1047 dnl ** section for plugins **
1048 dnl *************************
1050 PLUGINS=""
1051 DISABLED_PLUGINS=""
1052 MISSING_DEPS_PLUGINS=""
1054 dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
1055 dnl or (auto-)disabled (no for both)
1057 dnl All plugins are auto-enabled except for Demo which is just there to help
1058 dnl potential plugins writers.
1060 AC_ARG_ENABLE(acpi_notifier-plugin,
1061                 [  --disable-acpi_notifier-plugin  Do not build acpi_notifier plugin],
1062                 [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
1064 AC_ARG_ENABLE(address_keeper-plugin,
1065                 [  --disable-address_keeper-plugin Do not build address_keeper plugin],
1066                 [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
1068 AC_ARG_ENABLE(archive-plugin,
1069                 [  --disable-archive-plugin        Do not build archive plugin],
1070                 [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
1072 AC_ARG_ENABLE(att_remover-plugin,
1073                 [  --disable-att_remover-plugin    Do not build att_remover plugin],
1074                 [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
1076 AC_ARG_ENABLE(attachwarner-plugin,
1077                 [  --disable-attachwarner-plugin   Do not build attachwarner plugin],
1078                 [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
1080 AC_ARG_ENABLE(bogofilter-plugin,
1081                 [  --disable-bogofilter-plugin     Do not build bogofilter plugin],
1082                 [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
1084 AC_ARG_ENABLE(bsfilter-plugin,
1085                 [  --disable-bsfilter-plugin       Do not build bsfilter plugin],
1086                 [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
1088 AC_ARG_ENABLE(clamd-plugin,
1089                 [  --disable-clamd-plugin          Do not build clamd plugin],
1090                 [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
1092 AC_ARG_ENABLE(dillo-plugin,
1093                 [  --disable-dillo-plugin          Do not build dillo plugin],
1094                 [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
1096 AC_ARG_ENABLE(fancy-plugin,
1097                 [  --disable-fancy-plugin          Do not build fancy plugin],
1098                 [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
1100 AC_ARG_ENABLE(fetchinfo-plugin,
1101                 [  --disable-fetchinfo-plugin      Do not build fetchinfo plugin],
1102                 [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
1104 AC_ARG_ENABLE(gdata-plugin,
1105                 [  --disable-gdata-plugin          Do not build gdata plugin],
1106                 [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
1108 AC_ARG_ENABLE(libravatar-plugin,
1109                 [  --disable-libravatar-plugin     Do not build libravatar  plugin],
1110                 [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
1112 AC_ARG_ENABLE(litehtml_viewer-plugin,
1113                 [  --disable-litehtml_viewer-plugin       Do not build litehtml_viewer plugin],
1114                 [enable_litehtml_viewer_plugin=$enableval], [enable_litehtml_viewer_plugin=auto])
1116 AC_ARG_ENABLE(mailmbox-plugin,
1117                 [  --disable-mailmbox-plugin       Do not build mailmbox plugin],
1118                 [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
1120 AC_ARG_ENABLE(managesieve-plugin,
1121                 [  --disable-managesieve-plugin    Do not build managesieve plugin],
1122                 [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
1124 AC_ARG_ENABLE(newmail-plugin,
1125                 [  --disable-newmail-plugin        Do not build newmail plugin],
1126                 [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
1128 AC_ARG_ENABLE(notification-plugin,
1129                 [  --disable-notification-plugin   Do not build notification plugin],
1130                 [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
1132 AC_ARG_ENABLE(pdf_viewer-plugin,
1133                 [  --disable-pdf_viewer-plugin     Do not build pdf_viewer plugin],
1134                 [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
1136 AC_ARG_ENABLE(perl-plugin,
1137                 [  --disable-perl-plugin           Do not build perl plugin],
1138                 [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
1140 AC_ARG_ENABLE(python-plugin,
1141                 [  --disable-python-plugin         Do not build python plugin],
1142                 [enable_python_plugin=$enableval], [enable_python_plugin=auto])
1144 AC_ARG_ENABLE(pgpcore-plugin,
1145                 [  --disable-pgpcore-plugin        Do not build pgpcore plugin],
1146                 [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
1148 AC_ARG_ENABLE(pgpmime-plugin,
1149                 [  --disable-pgpmime-plugin        Do not build pgpmime plugin],
1150                 [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
1152 AC_ARG_ENABLE(pgpinline-plugin,
1153                 [  --disable-pgpinline-plugin      Do not build pgpinline plugin],
1154                 [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
1156 AC_ARG_ENABLE(rssyl-plugin,
1157                 [  --disable-rssyl-plugin          Do not build rssyl plugin],
1158                 [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
1160 AC_ARG_ENABLE(smime-plugin,
1161                 [  --disable-smime-plugin          Do not build smime plugin],
1162                 [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
1164 AC_ARG_ENABLE(spamassassin-plugin,
1165                 [  --disable-spamassassin-plugin   Do not build spamassassin plugin],
1166                 [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
1168 AC_ARG_ENABLE(spam_report-plugin,
1169                 [  --disable-spam_report-plugin    Do not build spam_report plugin],
1170                 [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
1172 AC_ARG_ENABLE(tnef_parse-plugin,
1173                 [  --disable-tnef_parse-plugin     Do not build tnef_parse plugin],
1174                 [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
1176 AC_ARG_ENABLE(vcalendar-plugin,
1177                 [  --disable-vcalendar-plugin      Do not build vcalendar plugin],
1178                 [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
1180 dnl disabled by default
1181 AC_ARG_ENABLE(demo-plugin,
1182                 [  --enable-demo-plugin            Build demo plugin],
1183                 [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
1186 dnl Then we check (unconditionnaly) for plugins dependencies
1187 dnl Some dependencies are optional, some mandatory. This is taken care of
1188 dnl later.
1190 dnl During this dependancy check we do the checks themselves, define HAVE_X to
1191 dnl either yes or no, and do the AC_SUBST calls.
1193 dnl Archive:            libarchive
1194 dnl Fancy:              Webkit, curl, optionally libsoup-gnome
1195 dnl Gdata:              libgdata
1196 dnl Litehtml            a C++ compiler, >=glib-2.36, cairo, fontconfig, gumbo, curl
1197 dnl Libravatar:         libcurl
1198 dnl Notification:       optionally libnotify  unity/messaging-menu
1199 dnl                                libcanberra_gtk hotkey
1200 dnl Pdf-Viewer:         libpoppler
1201 dnl Perl:               sed perl
1202 dnl PGP/Core:           libgpgme
1203 dnl PGP/Mime:           pgpcore libgpgme
1204 dnl PGP/Inline:         pgpcore libgpgme
1205 dnl S/Mime:             pgpcore libgpgme
1206 dnl Python:             Python
1207 dnl RSSyl:              expat libcurl
1208 dnl SpamReport:         libcurl
1209 dnl vCalendar:          libcurl, libical
1210 dnl tnef_parse:         libytnef
1212 dnl libcurl ********************************************************************
1213 PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
1214 AC_SUBST(CURL_LIBS)
1215 AC_SUBST(CURL_CFLAGS)
1217 dnl expat **********************************************************************
1218 PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
1220 if test x"$HAVE_EXPAT" = xno; then
1221         AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
1222         AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
1223         if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
1224                 HAVE_EXPAT=yes
1225                 EXPAT_CFLAGS=""
1226                 EXPAT_LIBS="-lexpat"
1227         fi
1230 AC_SUBST(EXPAT_CFLAGS)
1231 AC_SUBST(EXPAT_LIBS)
1233 dnl webkit *********************************************************************
1234 PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.10.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
1235 AC_SUBST(WEBKIT_LIBS)
1236 AC_SUBST(WEBKIT_CFLAGS)
1238 dnl libsoup ********************************************************************
1239 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
1240 if test x"$HAVE_LIBSOUP" = xyes; then
1241         AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
1243 AC_SUBST(LIBSOUP_CFLAGS)
1244 AC_SUBST(LIBSOUP_LIBS)
1246 dnl libsoup-gnome **************************************************************
1247 PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
1248 if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
1249         AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
1251 AC_SUBST(LIBSOUP_GNOME_CFLAGS)
1252 AC_SUBST(LIBSOUP_GNOME_LIBS)
1254 dnl libarchive *****************************************************************
1255 PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
1256 AC_SUBST(ARCHIVE_LIBS)
1257 AC_SUBST(ARCHIVE_CFLAGS)
1258 AC_CHECK_LIB([archive], [archive_read_new],
1259                        ARCHIVE_LIBS=-larchive
1260                        HAVE_ARCHIVE=yes
1261                        AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
1262                        HAVE_ARCHIVE=no
1263                        )
1265 dnl libgdata *******************************************************************
1266 PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
1267 AC_SUBST(GDATA_CFLAGS)
1268 AC_SUBST(GDATA_LIBS)
1270 dnl cairo **********************************************************************
1271 PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
1272 AC_SUBST(CAIRO_CFLAGS)
1273 AC_SUBST(CAIRO_LIBS)
1275 dnl fontconfig *****************************************************************
1276 PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no)
1277 AC_SUBST(FONTCONFIG_CFLAGS)
1278 AC_SUBST(FONTCONFIG_LIBS)
1280 dnl gumbo **********************************************************************
1281 PKG_CHECK_MODULES(LIBGUMBO, gumbo >= 0.10, HAVE_LIBGUMBO=yes, HAVE_LIBGUMBO=no)
1282 AC_SUBST(LIBGUMBO_CFLAGS)
1283 AC_SUBST(LIBGUMBO_LIBS)
1285 dnl libical ********************************************************************
1286 PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
1287 AC_SUBST(LIBICAL_CFLAGS)
1288 AC_SUBST(LIBICAL_LIBS)
1290 dnl Poppler ********************************************************************
1291 PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
1292 AC_SUBST(POPPLER_LIBS)
1293 AC_SUBST(POPPLER_CFLAGS)
1295 dnl check for Poppler extra features that we conditionally support
1296 if test x"$HAVE_POPPLER" = xyes; then
1297         OLD_CFLAGS=$CFLAGS
1298         CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
1299         AC_CHECK_DECL(POPPLER_DEST_NAMED,
1300                 [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
1301                 ,[#include <poppler-action.h>])
1302         AC_CHECK_DECL(POPPLER_DEST_XYZ,
1303                 [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
1304                 ,[#include <poppler-action.h>])
1305         CFLAGS=$OLD_CFLAGS
1308 dnl perl ***********************************************************************
1309 AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
1310 if test x"$HAVE_PERL" = xyes; then
1311         AC_MSG_CHECKING(for perl >= 5.8.0)
1312         PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
1313         if test "$PERL_VER" = "yes"; then
1314                 AC_MSG_RESULT(yes)
1315         else
1316                 AC_MSG_RESULT(no)
1317                 HAVE_PERL=no
1318         fi
1320 if test x"$HAVE_PERL" = xyes; then
1321         AC_MSG_CHECKING(for Perl compile flags)
1322         PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
1323         PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
1324         PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
1325         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
1326         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
1327         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
1328         AC_MSG_RESULT(ok)
1329         AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
1330         
1331         if test x"$HAVE_PERL" = xyes; then
1332                 AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)], 
1333                                              [ HAVE_LIBPERL=no ])
1334         fi
1335         if test x"$HAVE_LIBPERL" = xno; then
1336                 LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
1337                 LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
1338                 AC_MSG_CHECKING([for libperl.so])
1339                 if test -f "$LIBPERL_PREFIX/libperl.so"; then
1340                         AC_MSG_RESULT(yes)
1341                         HAVE_LIBPERL=yes
1342                 else
1343                         AC_MSG_RESULT(no)
1344                 fi      
1345         fi
1346         PERL="perl"
1347         AC_SUBST(PERL)
1348         AC_SUBST(PERL_CFLAGS)
1349         AC_SUBST(PERL_LDFLAGS)
1352 dnl Gpgme **********************************************************************
1353 AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
1354 if test x"$HAVE_GPGME" = xyes; then
1355         AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
1356         AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
1359 dnl Python *********************************************************************
1360 missing_python=""
1361 PKG_CHECK_MODULES(PYTHON, python2, HAVE_PYTHON=yes, HAVE_PYTHON=no)
1362 if test x"$HAVE_PYTHON" = xno; then
1363         missing_python="python2"
1365 if test x"$HAVE_PYTHON" = xyes; then
1366         PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.10.3, [AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])], HAVE_PYTHON=no)
1367         if test x"$HAVE_PYTHON" = xno; then
1368                 missing_python="pygtk-2.0 >= 2.10.3"
1369         fi
1371 AC_SUBST(PYTHON_SHARED_LIB)
1372 AC_SUBST(PYTHON_CFLAGS)
1373 AC_SUBST(PYTHON_LIBS)
1374 AC_SUBST(PYGTK_CFLAGS)
1375 AC_SUBST(PYGTK_LIBS)
1377 dnl libnotify ******************************************************************
1378 PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
1379 if test x"$HAVE_LIBNOTIFY" = xyes; then
1380         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
1382 AC_SUBST(libnotify_CFLAGS)
1383 AC_SUBST(libnotify_LIBS)
1385 dnl libcanberra-gtk ************************************************************
1386 PKG_CHECK_MODULES(libcanberra_gtk, libcanberra-gtk >= 0.6, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
1387 if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1388         AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk support is enabled])
1390 AC_SUBST(libcanberra_gtk_CFLAGS)
1391 AC_SUBST(libcanberra_gtk_LIBS)
1393 dnl unity/messaging-menu *******************************************************
1394 PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
1395 if test x"$HAVE_UNITY" = xyes; then
1396         AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
1398 AC_SUBST(unity_CFLAGS)
1399 AC_SUBST(unity_LIBS)
1401 dnl hotkeys ********************************************************************
1402 PKG_CHECK_MODULES(CM_NP_HOTKEY, [gio-2.0 >= 2.15.6 gio-unix-2.0 >= 2.15.6], HAVE_HOTKEYS=yes, HAVE_HOTKEYS=no)
1403 if test x"$HAVE_HOTKEYS" = xyes; then
1404         AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
1406 AC_SUBST(CM_NP_HOTKEY_CFLAGS)
1407 AC_SUBST(CM_NP_HOTKEY_LIBS)
1409 dnl libytnef *******************************************************************
1410 YTNEF_CFLAGS=""
1411 YTNEF_LIBS=""
1412 have_ytnef=0
1413 # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
1414 # accordingly
1415 AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
1416 if test $have_ytnef -eq 0; then
1417         AC_CHECK_HEADER(libytnef/ytnef.h,
1418                                                                         [have_ytnef=1;
1419                                                                          YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
1420                                                                         [have_ytnef=0])
1422 if test $have_ytnef -eq 1; then
1423         AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
1424         # Now we have to figure out which libytnef version we're using,
1425         # based on whether SwapDDWord takes one argument or two.
1426         if test "x${YTNEF_CFLAGS}" = "x"; then
1427                 ytnef_include="#include <ytnef.h>"
1428         else
1429                 ytnef_include="#include <libytnef/ytnef.h>"
1430         fi
1431         AC_TRY_COMPILE([#include <stdio.h>
1432                                                                         ${ytnef_include}],
1433                                                                         [SwapDDWord(0, 0);],
1434                                                                         [have_ytnef=1],
1435                                                                         [have_ytnef=0])
1436         if test $have_ytnef -eq 0; then
1437                 AC_TRY_COMPILE([#include <stdio.h>
1438                                                                                 ${ytnef_include}],
1439                                                                                 [SwapDDWord(0);],
1440                                                                                 [have_ytnef=1;
1441                                                                                  YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],
1442                                                                                 [have_ytnef=0])
1443         fi
1444         if test $have_ytnef -eq 1; then
1445                 YTNEF_LIBS="-lytnef"
1446                 AC_MSG_RESULT(ok)
1447         else
1448                 AC_MSG_RESULT(no idea, unsupported libytnef version?)
1449         fi
1451 AC_SUBST(YTNEF_CFLAGS)
1452 AC_SUBST(YTNEF_LIBS)
1454 dnl Third, we now cross the requested plugins and the available dependencies
1455 dnl If some dependencies are missing and the plugin was explicitely enabled,
1456 dnl we error out, else we only inform.
1458 AC_MSG_CHECKING([whether to build acpi_notifier plugin])
1459 if test x"$enable_acpi_notifier_plugin" != xno; then
1460         PLUGINS="$PLUGINS acpi_notifier"
1461         AC_MSG_RESULT(yes)
1462 else
1463         DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
1464         AC_MSG_RESULT(no)
1467 AC_MSG_CHECKING([whether to build address_keeper plugin])
1468 if test x"$enable_address_keeper_plugin" != xno; then
1469         PLUGINS="$PLUGINS address_keeper"
1470         AC_MSG_RESULT(yes)
1471 else
1472         DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
1473         AC_MSG_RESULT(no)
1476 AC_MSG_CHECKING([whether to build archive plugin])
1477 if test x"$enable_archive_plugin" != xno; then
1478         dependencies_missing=""
1480         if test x"$HAVE_ARCHIVE" = xno; then
1481                 dependencies_missing="libarchive $dependencies_missing"
1482         fi
1484         if test x"$dependencies_missing" = x; then
1485                 PLUGINS="$PLUGINS archive"
1486                 AC_MSG_RESULT(yes)
1487         elif test x"$enable_archive_plugin" = xauto; then
1488                 AC_MSG_RESULT(no)
1489                 AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
1490                 enable_archive_plugin=no
1491                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
1492         else
1493                 AC_MSG_RESULT(no)
1494                 AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
1495         fi
1496 else
1497         DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
1498         AC_MSG_RESULT(no)
1501 AC_MSG_CHECKING([whether to build att_remover plugin])
1502 if test x"$enable_att_remover_plugin" != xno; then
1503         PLUGINS="$PLUGINS att_remover"
1504         AC_MSG_RESULT(yes)
1505 else
1506         DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
1507         AC_MSG_RESULT(no)
1510 AC_MSG_CHECKING([whether to build attachwarner plugin])
1511 if test x"$enable_attachwarner_plugin" != xno; then
1512         PLUGINS="$PLUGINS attachwarner"
1513         AC_MSG_RESULT(yes)
1514 else
1515         DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
1516         AC_MSG_RESULT(no)
1519 AC_MSG_CHECKING([whether to build bogofilter plugin])
1520 if test x"$enable_bogofilter_plugin" != xno; then
1521         PLUGINS="$PLUGINS bogofilter"
1522         AC_MSG_RESULT(yes)
1523 else
1524         DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
1525         AC_MSG_RESULT(no)
1528 AC_MSG_CHECKING([whether to build bsfilter plugin])
1529 if test x"$enable_bsfilter_plugin" != xno; then
1530         PLUGINS="$PLUGINS bsfilter"
1531         AC_MSG_RESULT(yes)
1532 else
1533         DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
1534         AC_MSG_RESULT(no)
1537 AC_MSG_CHECKING([whether to build clamd plugin])
1538 if test x"$enable_clamd_plugin" != xno; then
1539         PLUGINS="$PLUGINS clamd"
1540         AC_MSG_RESULT(yes)
1541 else
1542         DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
1543         AC_MSG_RESULT(no)
1546 AC_MSG_CHECKING([whether to build demo plugin])
1547 if test x"$enable_demo_plugin" != xno; then
1548         PLUGINS="$PLUGINS demo"
1549         AC_MSG_RESULT(yes)
1550 else
1551         DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
1552         AC_MSG_RESULT(no)
1555 AC_MSG_CHECKING([whether to build Dillo plugin])
1556 if test x"$enable_dillo_plugin" != xno; then
1557         PLUGINS="$PLUGINS dillo"
1558         AC_MSG_RESULT(yes)
1559 else
1560         DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
1561         AC_MSG_RESULT(no)
1564 AC_MSG_CHECKING([whether to build fancy plugin])
1565 if test x"$enable_fancy_plugin" != xno; then
1566         dependencies_missing=""
1568         if test x"$HAVE_WEBKIT" = xno; then
1569                 dependencies_missing="libwebkit-1.0 $dependencies_missing"
1570         fi
1571         if test x"$HAVE_CURL" = xno; then
1572                 dependencies_missing="libcurl $dependencies_missing"
1573         fi
1575         if test x"$dependencies_missing" = x; then
1576                 PLUGINS="$PLUGINS fancy"
1577                 AC_MSG_RESULT(yes)
1578         elif test x"$enable_fancy_plugin" = xauto; then
1579                 AC_MSG_RESULT(no)
1580                 AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
1581                 enable_fancy_plugin=no
1582                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
1583         else
1584                 AC_MSG_RESULT(no)
1585                 AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
1586         fi
1587 else
1588         DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
1589         AC_MSG_RESULT(no)
1592 AC_MSG_CHECKING([whether to build fetchinfo plugin])
1593 if test x"$enable_fetchinfo_plugin" != xno; then
1594         PLUGINS="$PLUGINS fetchinfo"
1595         AC_MSG_RESULT(yes)
1596 else
1597         DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
1598         AC_MSG_RESULT(no)
1601 AC_MSG_CHECKING([whether to build gdata plugin])
1602 if test x"$enable_gdata_plugin" != xno; then
1603         dependencies_missing=""
1605         if test x"$HAVE_GDATA" = xno; then
1606                 dependencies_missing="libgdata $dependencies_missing"
1607         fi
1609         if test x"$dependencies_missing" = x; then
1610                 PLUGINS="$PLUGINS gdata"
1611                 AC_MSG_RESULT(yes)
1612         elif test x"$enable_gdata_plugin" = xauto; then
1613                 AC_MSG_RESULT(no)
1614                 AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
1615                 enable_gdata_plugin=no
1616                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
1617         else
1618                 AC_MSG_RESULT(no)
1619                 AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
1620         fi
1621 else
1622         DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
1623         AC_MSG_RESULT(no)
1626 AC_MSG_CHECKING([whether to build libravatar plugin])
1627 if test x"$enable_libravatar_plugin" != xno; then
1628         dependencies_missing=""
1630         if test x"$HAVE_CURL" = xno; then
1631                 dependencies_missing="libcurl $dependencies_missing"
1632         fi
1634         if test x"$dependencies_missing" = x; then
1635                 PLUGINS="$PLUGINS libravatar"
1636                 AC_MSG_RESULT(yes)
1637         elif test x"$enable_libravatar_plugin" = xauto; then
1638                 AC_MSG_RESULT(no)
1639                 AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
1640                 enable_libravatar_plugin=no
1641                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
1642         else
1643                 AC_MSG_RESULT(no)
1644                 AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
1645         fi
1646 else
1647         DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
1648         AC_MSG_RESULT(no)
1651 AC_MSG_CHECKING([whether to build litehtml_viewer plugin])
1652 if test x"$enable_litehtml_viewer_plugin" != xno; then
1653         dependencies_missing=""
1655         if test x"$HAVE_CXX" = xno; then
1656                 dependencies_missing="C++ compiler $dependencies_missing"
1657         fi
1658         PKG_CHECK_EXISTS([glib-2.0 >= 2.36], [],
1659                 [dependencies_missing="glib-2.0 >= 2.36 $dependencies_missing"])
1660         if test x"$HAVE_CAIRO" = xno; then
1661                 dependencies_missing="cairo $dependencies_missing"
1662         fi
1663         if test x"$HAVE_FONTCONFIG" = xno; then
1664                 dependencies_missing="fontconfig $dependencies_missing"
1665         fi
1666         if test x"$HAVE_LIBGUMBO" = xno; then
1667                 dependencies_missing="libgumbo $dependencies_missing"
1668         fi
1669         if test x"$HAVE_CURL" = xno; then
1670                 dependencies_missing="libcurl $dependencies_missing"
1671         fi
1674         if test x"$dependencies_missing" = x; then
1675                 PLUGINS="$PLUGINS litehtml_viewer"
1676                 AC_MSG_RESULT(yes)
1677         elif test x"$enable_litehtml_viewer_plugin" = xauto; then
1678                 AC_MSG_RESULT(no)
1679                 AC_MSG_WARN("Plugin litehtml_viewer will not be built; missing $dependencies_missing")
1680                 enable_litehtml_viewer_plugin=no
1681                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS litehtml_viewer"
1682         else
1683                 AC_MSG_RESULT(no)
1684                 AC_MSG_ERROR("Plugin litehtml_viewer cannot be built; missing $dependencies_missing")
1685         fi
1686 else
1687         DISABLED_PLUGINS="$DISABLED_PLUGINS litehtml_viewer"
1688         AC_MSG_RESULT(no)
1691 AC_MSG_CHECKING([whether to build mailmbox plugin])
1692 if test x"$enable_mailmbox_plugin" != xno; then
1693         PLUGINS="$PLUGINS mailmbox"
1694         AC_MSG_RESULT(yes)
1695 else
1696         DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
1697         AC_MSG_RESULT(no)
1700 AC_MSG_CHECKING([whether to build managesieve plugin])
1701 if test x"$enable_managesieve_plugin" != xno; then
1702         PLUGINS="$PLUGINS managesieve"
1703         AC_MSG_RESULT(yes)
1704 else
1705         DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
1706         AC_MSG_RESULT(no)
1709 AC_MSG_CHECKING([whether to build newmail plugin])
1710 if test x"$enable_newmail_plugin" != xno; then
1711         PLUGINS="$PLUGINS newmail"
1712         AC_MSG_RESULT(yes)
1713 else
1714         DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
1715         AC_MSG_RESULT(no)
1718 AC_MSG_CHECKING([whether to build notification plugin])
1719 if test x"$enable_notification_plugin" != xno; then
1720         PLUGINS="$PLUGINS notification"
1721         AC_MSG_RESULT(yes)
1723         AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
1724         AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
1725         AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
1726         AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
1727         if test x"$platform_win32" = xno; then
1728                 AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
1729         fi
1731         notification_features="banner command"
1732         notification_missing_dependencies=""
1733         if test x"$HAVE_HOTKEYS" = xyes; then
1734                 notification_features="$notification_features hotkeys"
1735         else
1736                 notification_missing_dependencies="$notification_missing_dependencies hotkeys"
1737         fi
1738         notification_features="$notification_features lcdproc"
1739         if test x"$HAVE_UNITY" = xyes; then
1740                 notification_features="$notification_features unity/messaging-menu"
1741         else
1742                 notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
1743         fi
1744         if test x"$HAVE_LIBNOTIFY" = xyes; then
1745                 notification_features="$notification_features libnotify"
1746         else
1747                 notification_missing_dependencies="$notification_missing_dependencies libnotify"
1748         fi
1749         if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1750                 notification_features="$notification_features libcanberra-gtk"
1751         else
1752                 notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk"
1753         fi
1754         notification_features="$notification_features popup trayicon"
1755 else
1756         DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
1757         AC_MSG_RESULT(no)
1760 AC_MSG_CHECKING([whether to build pdf_viewer plugin])
1761 if test x"$enable_pdf_viewer_plugin" != xno; then
1762         dependencies_missing=""
1764         if test x"$HAVE_POPPLER" = xno; then
1765                 dependencies_missing="libpoppler-glib $dependencies_missing"
1766         fi
1768         if test x"$dependencies_missing" = x; then
1769                 PLUGINS="$PLUGINS pdf_viewer"
1770                 AC_MSG_RESULT(yes)
1771         elif test x"$enable_pdf_viewer_plugin" = xauto; then
1772                 AC_MSG_RESULT(no)
1773                 AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
1774                 enable_pdf_viewer_plugin=no
1775                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
1776         else
1777                 AC_MSG_RESULT(no)
1778                 AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
1779         fi
1780 else
1781         DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
1782         AC_MSG_RESULT(no)
1785 AC_MSG_CHECKING([whether to build perl plugin])
1786 if test x"$enable_perl_plugin" != xno; then
1787         dependencies_missing=""
1789         if test x"$HAVE_LIBPERL" = xno; then
1790                 dependencies_missing="libperl $dependencies_missing"
1791         fi
1793         if test x"$dependencies_missing" = x; then
1794                 PLUGINS="$PLUGINS perl"
1795                 AC_MSG_RESULT(yes)
1796         elif test x"$enable_perl_plugin" = xauto; then
1797                 AC_MSG_RESULT(no)
1798                 AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
1799                 enable_perl_plugin=no
1800                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
1801         else
1802                 AC_MSG_RESULT(no)
1803                 AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
1804         fi
1805 else
1806         DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
1807         AC_MSG_RESULT(no)
1810 AC_MSG_CHECKING([whether to build python plugin])
1811 if test x"$enable_python_plugin" != xno; then
1812         dependencies_missing=""
1814         if test x"$HAVE_PYTHON" = xno; then
1815                 dependencies_missing="$missing_python $dependencies_missing"
1816         fi
1818         if test x"$dependencies_missing" = x; then
1819                 PLUGINS="$PLUGINS python"
1820                 AC_MSG_RESULT(yes)
1821         elif test x"$enable_python_plugin" = xauto; then
1822                 AC_MSG_RESULT(no)
1823                 AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
1824                 enable_python_plugin=no
1825                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
1826         else
1827                 AC_MSG_RESULT(no)
1828                 AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
1829         fi
1830 else
1831         DISABLED_PLUGINS="$DISABLED_PLUGINS python"
1832         AC_MSG_RESULT(no)
1835 AC_MSG_CHECKING([whether to build pgpcore plugin])
1836 if test x"$enable_pgpcore_plugin" != xno; then
1837         dependencies_missing=""
1839         if test x"$HAVE_GPGME" = xno; then
1840                 dependencies_missing="libgpgme $dependencies_missing"
1841         fi
1843         if test x"$dependencies_missing" = x; then
1844                 PLUGINS="$PLUGINS pgpcore"
1845                 AC_MSG_RESULT(yes)
1846         elif test x"$enable_pgpcore_plugin" = xauto; then
1847                 AC_MSG_RESULT(no)
1848                 AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
1849                 enable_pgpcore_plugin=no
1850                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
1851         else
1852                 AC_MSG_RESULT(no)
1853                 AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
1854         fi
1855 else
1856         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
1857         AC_MSG_RESULT(no)
1860 AC_MSG_CHECKING([whether to build pgpmime plugin])
1861 if test x"$enable_pgpmime_plugin" != xno; then
1862         dependencies_missing=""
1864         if test x"$HAVE_GPGME" = xno; then
1865                 dependencies_missing="libgpgme $dependencies_missing"
1866         fi
1867         if test x"$enable_pgpcore_plugin" = xno; then
1868                 dependencies_missing="pgpcore plugin $dependencies_missing"
1869         fi
1871         if test x"$dependencies_missing" = x; then
1872                 PLUGINS="$PLUGINS pgpmime"
1873                 AC_MSG_RESULT(yes)
1874         elif test x"$enable_pgpmime_plugin" = xauto; then
1875                 AC_MSG_RESULT(no)
1876                 AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
1877                 enable_pgpmime_plugin=no
1878                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
1879         else
1880                 AC_MSG_RESULT(no)
1881                 AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
1882         fi
1883 else
1884         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
1885         AC_MSG_RESULT(no)
1888 AC_MSG_CHECKING([whether to build pgpinline plugin])
1889 if test x"$enable_pgpinline_plugin" != xno; then
1890         dependencies_missing=""
1892         if test x"$HAVE_GPGME" = xno; then
1893                 dependencies_missing="libgpgme $dependencies_missing"
1894         fi
1895         if test x"$enable_pgpcore_plugin" = xno; then
1896                 dependencies_missing="pgpcore plugin $dependencies_missing"
1897         fi
1899         if test x"$dependencies_missing" = x; then
1900                 PLUGINS="$PLUGINS pgpinline"
1901                 AC_MSG_RESULT(yes)
1902         elif test x"$enable_pgpinline_plugin" = xauto; then
1903                 AC_MSG_RESULT(no)
1904                 AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
1905                 enable_pgpinline_plugin=no
1906                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
1907         else
1908                 AC_MSG_RESULT(no)
1909                 AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
1910         fi
1911 else
1912         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
1913         AC_MSG_RESULT(no)
1916 AC_MSG_CHECKING([whether to build rssyl plugin])
1917 if test x"$enable_rssyl_plugin" != xno; then
1918         dependencies_missing=""
1920         if test x"$HAVE_EXPAT" = xno; then
1921                 dependencies_missing="expat $dependencies_missing"
1922         fi
1923         if test x"$HAVE_CURL" = xno; then
1924                 dependencies_missing="libcurl $dependencies_missing"
1925         fi
1927         if test x"$dependencies_missing" = x; then
1928                 PLUGINS="$PLUGINS rssyl"
1929                 AC_MSG_RESULT(yes)
1930         elif test x"$enable_rssyl_plugin" = xauto; then
1931                 AC_MSG_RESULT(no)
1932                 AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
1933                 enable_rssyl_plugin=no
1934                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
1935         else
1936                 AC_MSG_RESULT(no)
1937                 AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
1938         fi
1939 else
1940         DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
1941         AC_MSG_RESULT(no)
1944 AC_MSG_CHECKING([whether to build spamassassin plugin])
1945 if test x"$enable_spamassassin_plugin" != xno; then
1946         PLUGINS="$PLUGINS spamassassin"
1947         AC_MSG_RESULT(yes)
1948         AC_SPAMASSASSIN
1950         dnl check for zlib (optional)
1951         spamassassin_zlib=0
1952         SPAMASSASSIN_CFLAGS=""
1953         SPAMASSASSIN_LIBS=""
1954         AC_CHECK_HEADER([zlib.h],
1955                         [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
1956                         [spamassassin_zlib=1],
1957                         [spamassassin_zlib=0])
1958         if test $spamassassin_zlib -eq 1; then
1959                 AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
1960                 AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
1961                 if test $spamassassin_zlib -eq 1; then
1962                         AC_MSG_RESULT(yes)
1963                         SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
1964                         SPAMASSASSIN_LIBS="-lz"
1965                 else
1966                         AC_MSG_RESULT(no)
1967                 fi
1968         fi
1969         AC_SUBST(SPAMASSASSIN_CFLAGS)
1970         AC_SUBST(SPAMASSASSIN_LIBS)
1971 else
1972         DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
1973         AC_MSG_RESULT(no)
1976 AC_MSG_CHECKING([whether to build smime plugin])
1977 if test x"$enable_smime_plugin" != xno; then
1978         dependencies_missing=""
1980         if test x"$HAVE_GPGME" = xno; then
1981                 dependencies_missing="libgpgme $dependencies_missing"
1982         fi
1983         if test x"$enable_pgpcore_plugin" = xno; then
1984                 dependencies_missing="pgpcore plugin $dependencies_missing"
1985         fi
1987         if test x"$dependencies_missing" = x; then
1988                 PLUGINS="$PLUGINS smime"
1989                 AC_MSG_RESULT(yes)
1990         elif test x"$enable_smime_plugin" = xauto; then
1991                 AC_MSG_RESULT(no)
1992                 AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
1993                 enable_smime_plugin=no
1994                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
1995         else
1996                 AC_MSG_RESULT(no)
1997                 AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
1998         fi
1999 else
2000         DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
2001         AC_MSG_RESULT(no)
2004 AC_MSG_CHECKING([whether to build spam_report plugin])
2005 if test x"$enable_spam_report_plugin" != xno; then
2006         dependencies_missing=""
2008         if test x"$HAVE_CURL" = xno; then
2009                 dependencies_missing="libcurl $dependencies_missing"
2010         fi
2012         if test x"$dependencies_missing" = x; then
2013                 PLUGINS="$PLUGINS spam_report"
2014                 AC_MSG_RESULT(yes)
2015         elif test x"$enable_spam_report_plugin" = xauto; then
2016                 AC_MSG_RESULT(no)
2017                 AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
2018                 enable_spam_report_plugin=no
2019                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
2020         else
2021                 AC_MSG_RESULT(no)
2022                 AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
2023         fi
2024 else
2025         DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
2026         AC_MSG_RESULT(no)
2029 AC_MSG_CHECKING([whether to build tnef_parse plugin])
2030 if test x"$enable_tnef_parse_plugin" != xno; then
2031         dependencies_missing=""
2033         if test $have_ytnef -eq 0; then
2034                 dependencies_missing="libytnef"
2035         fi
2037         if test x"$dependencies_missing" = x; then
2038                 PLUGINS="$PLUGINS tnef_parse"
2039                 AC_MSG_RESULT(yes)
2040         elif test x"$enable_tnef_parse_plugin" = xauto; then
2041                 AC_MSG_RESULT(no)
2042                 AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
2043                 enable_tnef_parse_plugin=no
2044                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
2045         else
2046                 AC_MSG_RESULT(no)
2047                 AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
2048         fi
2049 else
2050         DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
2051         AC_MSG_RESULT(no)
2055 AC_MSG_CHECKING([whether to build vcalendar plugin])
2056 if test x"$enable_vcalendar_plugin" != xno; then
2057         dependencies_missing=""
2059         if test x"$HAVE_CURL" = xno; then
2060                 dependencies_missing="libcurl $dependencies_missing"
2061         fi
2063   if test x"$HAVE_LIBICAL" = xno; then
2064     dependencies_missing="libical $dependencies_missing"
2065   fi
2067         if test x"$HAVE_PERL" = xno; then
2068                 dependencies_missing="perl $dependencies_missing"
2069         fi
2071         if test x"$dependencies_missing" = x; then
2072                 PLUGINS="$PLUGINS vcalendar"
2073                 AC_MSG_RESULT(yes)
2074         elif test x"$enable_vcalendar_plugin" = xauto; then
2075                 AC_MSG_RESULT(no)
2076                 AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
2077                 enable_vcalendar_plugin=no
2078                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
2079         else
2080                 AC_MSG_RESULT(no)
2081                 AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
2082         fi
2083 else
2084         DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
2085         AC_MSG_RESULT(no)
2088 dnl And finally the automake conditionals.
2090 AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN,      test x"$enable_acpi_notifier_plugin" != xno)
2091 AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN,     test x"$enable_address_keeper_plugin" != xno)
2092 AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN,            test x"$enable_archive_plugin" != xno)
2093 AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN,        test x"$enable_att_remover_plugin" != xno)
2094 AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN,       test x"$enable_attachwarner_plugin" != xno)
2095 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN,         test x"$enable_bogofilter_plugin" != xno)
2096 AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,           test x"$enable_bsfilter_plugin" != xno)
2097 AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,              test x"$enable_clamd_plugin" != xno)
2098 AM_CONDITIONAL(BUILD_DEMO_PLUGIN,               test x"$enable_demo_plugin" != xno)
2099 AM_CONDITIONAL(BUILD_DILLO_PLUGIN,              test x"$enable_dillo_plugin" != xno)
2100 AM_CONDITIONAL(BUILD_FANCY_PLUGIN,              test x"$enable_fancy_plugin" != xno)
2101 AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,          test x"$enable_fetchinfo_plugin" != xno)
2102 AM_CONDITIONAL(BUILD_GDATA_PLUGIN,              test x"$enable_gdata_plugin" != xno)
2103 AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN,         test x"$enable_libravatar_plugin" != xno)
2104 AM_CONDITIONAL(BUILD_LITEHTML_VIEWER_PLUGIN,    test x"$enable_litehtml_viewer_plugin" != xno)
2105 AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN,           test x"$enable_mailmbox_plugin" != xno)
2106 AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN,        test x"$enable_managesieve_plugin" != xno)
2107 AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN,            test x"$enable_newmail_plugin" != xno)
2108 AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN,       test x"$enable_notification_plugin" != xno)
2109 AM_CONDITIONAL(BUILD_HOTKEYS,                   test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
2110 AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN,         test x"$enable_pdf_viewer_plugin" != xno)
2111 AM_CONDITIONAL(BUILD_PERL_PLUGIN,               test x"$enable_perl_plugin" != xno)
2112 AM_CONDITIONAL(BUILD_PYTHON_PLUGIN,             test x"$enable_python_plugin" != xno)
2113 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN,            test x"$enable_pgpcore_plugin" != xno)
2114 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN,            test x"$enable_pgpmime_plugin" != xno)
2115 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN,          test x"$enable_pgpinline_plugin" != xno)
2116 AM_CONDITIONAL(BUILD_RSSYL_PLUGIN,              test x"$enable_rssyl_plugin" != xno)
2117 AM_CONDITIONAL(BUILD_SMIME_PLUGIN,              test x"$enable_smime_plugin" != xno)
2118 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN,       test x"$enable_spamassassin_plugin" != xno)
2119 AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN,        test x"$enable_spam_report_plugin" != xno)
2120 AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN,         test x"$enable_tnef_parse_plugin" != xno)
2121 AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN,          test x"$enable_vcalendar_plugin" != xno)
2124 dnl ****************************
2125 dnl ** Final configure output **
2126 dnl ****************************
2128 AC_OUTPUT([
2129 Makefile
2130 m4/Makefile
2131 po/Makefile.in
2132 src/common/version.h
2133 src/Makefile
2134 src/w32-resource.rc
2135 src/common/Makefile
2136 src/common/passcrypt.h
2137 src/common/tests/Makefile
2138 src/gtk/Makefile
2139 src/etpan/Makefile
2140 src/plugins/Makefile
2141 src/plugins/acpi_notifier/Makefile
2142 src/plugins/address_keeper/Makefile
2143 src/plugins/address_keeper/version.rc
2144 src/plugins/archive/Makefile
2145 src/plugins/att_remover/Makefile
2146 src/plugins/att_remover/version.rc
2147 src/plugins/attachwarner/Makefile
2148 src/plugins/attachwarner/version.rc
2149 src/plugins/bogofilter/Makefile
2150 src/plugins/bsfilter/Makefile
2151 src/plugins/bsfilter/version.rc
2152 src/plugins/clamd/Makefile
2153 src/plugins/clamd/libclamd/Makefile
2154 src/plugins/demo/Makefile
2155 src/plugins/dillo/Makefile
2156 src/plugins/fancy/Makefile
2157 src/plugins/fancy/version.rc
2158 src/plugins/fetchinfo/Makefile
2159 src/plugins/fetchinfo/version.rc
2160 src/plugins/gdata/Makefile
2161 src/plugins/litehtml_viewer/Makefile
2162 src/plugins/litehtml_viewer/version.rc
2163 src/plugins/litehtml_viewer/litehtml/Makefile
2164 src/plugins/libravatar/Makefile
2165 src/plugins/libravatar/version.rc
2166 src/plugins/mailmbox/Makefile
2167 src/plugins/mailmbox/version.rc
2168 src/plugins/managesieve/Makefile
2169 src/plugins/managesieve/version.rc
2170 src/plugins/newmail/Makefile
2171 src/plugins/notification/Makefile
2172 src/plugins/notification/version.rc
2173 src/plugins/notification/gtkhotkey/Makefile
2174 src/plugins/pdf_viewer/Makefile
2175 src/plugins/pdf_viewer/version.rc
2176 src/plugins/perl/Makefile
2177 src/plugins/perl/tools/Makefile
2178 src/plugins/python/Makefile
2179 src/plugins/python/examples/Makefile
2180 src/plugins/pgpcore/Makefile
2181 src/plugins/pgpcore/version.rc
2182 src/plugins/pgpcore/tests/Makefile
2183 src/plugins/pgpmime/Makefile
2184 src/plugins/pgpmime/version.rc
2185 src/plugins/pgpinline/Makefile
2186 src/plugins/pgpinline/version.rc
2187 src/plugins/rssyl/Makefile
2188 src/plugins/rssyl/version.rc
2189 src/plugins/rssyl/tests/Makefile
2190 src/plugins/rssyl/libfeed/Makefile
2191 src/plugins/rssyl/libfeed/tests/Makefile
2192 src/plugins/smime/Makefile
2193 src/plugins/smime/version.rc
2194 src/plugins/spamassassin/Makefile
2195 src/plugins/spam_report/Makefile
2196 src/plugins/spam_report/version.rc
2197 src/plugins/tnef_parse/Makefile
2198 src/plugins/tnef_parse/version.rc
2199 src/plugins/vcalendar/Makefile
2200 src/plugins/vcalendar/version.rc
2201 src/tests/Makefile
2202 doc/Makefile
2203 doc/man/Makefile
2204 tools/Makefile
2205 config/Makefile
2206 manual/Makefile
2207 manual/dtd/Makefile
2208 manual/dist/Makefile
2209 manual/dist/pdf/Makefile
2210 manual/dist/ps/Makefile
2211 manual/dist/html/Makefile
2212 manual/dist/txt/Makefile
2213 manual/fr/Makefile
2214 manual/fr/dist/Makefile
2215 manual/fr/dist/pdf/Makefile
2216 manual/fr/dist/ps/Makefile
2217 manual/fr/dist/html/Makefile
2218 manual/fr/dist/txt/Makefile
2219 manual/es/Makefile
2220 manual/es/dist/Makefile
2221 manual/es/dist/pdf/Makefile
2222 manual/es/dist/ps/Makefile
2223 manual/es/dist/html/Makefile
2224 manual/es/dist/txt/Makefile
2225 claws-mail.pc
2228 dnl Output the configuration summary
2229 echo ""
2230 echo "$PACKAGE $VERSION"
2231 echo ""
2232 if test x"$enable_alternate_addressbook" = xyes; then
2233         echo "Using Address Book : Alternate experimental interface"
2234 else
2235         echo "Using Address Book : Original stable interface"
2236         echo "JPilot             : $enable_jpilot"
2237         echo "LDAP               : $enable_ldap"
2239 echo "gnuTLS             : $enable_gnutls"
2240 echo "iconv              : $am_cv_func_iconv"
2241 echo "compface           : $enable_compface"
2242 echo "IPv6               : $enable_ipv6"
2243 echo "enchant            : $enable_enchant"
2244 echo "IMAP4              : $enable_libetpan"
2245 echo "NNTP               : $enable_libetpan"
2246 echo "Crash dialog       : $enable_crash_dialog"
2247 echo "LibSM              : $enable_libsm"
2248 echo "DBUS               : $enable_dbus"
2249 echo "NetworkManager     : $enable_networkmanager"
2250 echo "Manual             : $enable_manual"
2251 echo "Generic UMPC code  : $enable_generic_umpc"
2252 echo "SVG support        : $enable_svg"
2253 echo "Config dir         : $ac_cv_with_config_dir"
2254 echo "Password crypto    : $pwd_crypto"
2255 echo "Unit tests         : $enable_tests"
2257 echo "Plugins"
2258 echo "   Built:"
2259 for plugin in $PLUGINS; do
2260 echo "            - $plugin"
2261 if test x"$plugin" = xnotification; then
2262         echo "                Features:"
2263         for notif_feature in $notification_features; do
2264                 echo "                    $notif_feature"
2265         done;
2266         if test "x$notification_missing_dependencies" != x; then
2267                 echo "                Disabled due to missing dependencies:"
2268                 for notif_miss_dep in $notification_missing_dependencies; do
2269                         echo "                    $notif_miss_dep"
2270                 done;
2271         fi
2273 done;
2274 if test "x$DISABLED_PLUGINS" != x; then
2275 echo "   Disabled:"
2276 for plugin in $DISABLED_PLUGINS; do
2277 echo "            - $plugin"
2278 done;
2281 if test "x$MISSING_DEPS_PLUGINS" != x; then
2282 echo "   Disabled due to missing dependencies:"
2283 for plugin in $MISSING_DEPS_PLUGINS; do
2284 echo "            - $plugin"
2285 done;
2287 echo ""
2288 echo "The binary will be installed in $prefix/bin"
2289 echo ""
2290 echo "Configure finished, type 'make' to build."