Fix -Wmaybe-uninitialized warning on Windows
[claws.git] / configure.ac
blob9106719b7dc6c26cdd7cf8c310fd82e1466c3eee
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
93 AC_GNU_SOURCE
95 dnl Checks for programs.
96 dnl AC_ARG_PROGRAM
97 AC_PROG_CC
98 AC_ISC_POSIX
99 AC_PROG_INSTALL
100 AC_PROG_LN_S
101 AC_PROG_MAKE_SET
102 AC_PROG_CPP
103 dnl AC_PROG_RANLIB
104 AM_PROG_LEX
105 AC_PROG_YACC
106 AC_LIB_PREFIX
107 AC_LIBTOOL_WIN32_DLL
108 LT_INIT
109 LT_AC_PROG_RC
110 AC_LIBTOOL_RC
111 AC_PROG_LIBTOOL
112 AC_PROG_AWK
114 dnl AC_PROG_CXX will set CXX=g++ even if it finds no useable C++
115 dnl compiler, so we have to check whether the program named by
116 dnl CXX exists.
117 AC_PROG_CXX
118 AC_PATH_PROG(REAL_CXX, $CXX)
119 HAVE_CXX=no
120 if test -n "$REAL_CXX"; then
121         HAVE_CXX=yes
124 AC_SYS_LARGEFILE
126 dnl ******************************
127 dnl Checks for host
128 dnl Not needed anymore because we
129 dnl do AC_CANONICAL_SYSTEM above
130 dnl ******************************
131 dnl AC_CANONICAL_HOST
133 dnl Copied from the official gtk+-2 configure.in
134 AC_MSG_CHECKING([for host platform])
135 case "$host" in
136   *-*-mingw*|*-*-cygwin*)
137     platform_win32=yes
138     LDFLAGS="$LDFLAGS -mwindows -Wl,--export-all-symbols"
139     ;;
140         *-apple-*)
141                 platform_osx=yes
142                 LDFLAGS="$LDFLAGS -Wl,-export_dynamic"
143                 ;;
144   *)
145     platform_win32=no
146                 platform_osx=no
147                 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
148     ;;
149 esac
150 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
151 AM_CONDITIONAL(PLATFORM_OSX, test x"$platform_osx" = x"yes")
152 AC_MSG_RESULT([$host])
154 AC_MSG_CHECKING([for native Win32])
155 case "$host" in
156   *-*-mingw*)
157     os_win32=yes
158     ;;
159   *)
160     os_win32=no
161     ;;
162 esac
163 AC_MSG_RESULT([$os_win32])
164 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
166 AC_MSG_CHECKING([for Cygwin])
167 case "$host" in
168   *-*-cygwin*)
169     env_cygwin=yes
170     ;;
171   *)
172     env_cygwin=no
173     ;;
174 esac
175 AC_MSG_RESULT([$env_cygwin])
176 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
178 AC_MSG_CHECKING([for time_t format specifier])
179 _gcc_cflags_save=$CFLAGS
180 CFLAGS="-Wformat -Werror"
181 AC_COMPILE_IFELSE([
182         AC_LANG_PROGRAM([[
183                 #include <stdio.h>
184                 #include <time.h>
185                 ]],[[printf("%lld", time(NULL));]])],
186         [time_t_long_long=yes],
187         [time_t_long_long=no])
188 CFLAGS=$_gcc_cflags_save
190 if test x"$time_t_long_long" = xyes; then
191         time_t_fmt=lld
192 else
193         time_t_fmt=ld
195 AC_MSG_RESULT([$time_t_fmt])
196 AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"],
197         [Define printf format specifier for time_t])
199 AM_CFLAGS="-Wall"
200 if test $USE_MAINTAINER_MODE = yes; then
201         AM_CFLAGS="$AM_CFLAGS -g"
204 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
205 _gcc_cflags_save=$CFLAGS
206 CFLAGS="-Wno-pointer-sign"
207 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
208 AC_MSG_RESULT($_gcc_psign)
209 CFLAGS=$_gcc_cflags_save;
210 if test x"$_gcc_psign" = xyes ; then
211         AM_CFLAGS="$AM_CFLAGS -Wno-pointer-sign"
214 pthread_name=
215 case "$target" in
216 *-darwin*)
217         AM_CFLAGS="$AM_CFLAGS -no-cpp-precomp -fno-common"
218         ;;
219 *-*-mingw*)
220         # Note that we need to link to pthread in all cases. This
221         # is because some locking is used even when pthread support is
222         # disabled.
223         pthread_name=pthread
224         AM_CFLAGS="$AM_CFLAGS -mms-bitfields"
225         LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
226         ;;
227 *-*-solaris*)
228         AM_CFLAGS="$AM_CFLAGS -std=gnu99"
229         AC_DEFINE([SOLARIS], [], [Target is Solaris])
230         ;;
231 esac
233 AC_SUBST(AM_CFLAGS)
235 dnl Checks for iconv
236 AM_ICONV
238 dnl floor and ceil are  in -lm
239 LIBS="$LIBS -lm"
242 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
244 syl_save_LIBS=$LIBS
245 LIBS="$LIBS $GTK_LIBS"
246 AC_CHECK_FUNCS(bind_textdomain_codeset)
247 LIBS=$syl_save_LIBS
249 dnl for gettext
250 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"
251 GETTEXT_PACKAGE=claws-mail
252 AC_SUBST(GETTEXT_PACKAGE)
253 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
255 AM_GNU_GETTEXT_VERSION([0.18])
256 AM_GNU_GETTEXT([external])
258 AC_ARG_ENABLE(manual,
259                 [  --disable-manual                Do not build user manual],
260                 [enable_manual=$enableval], [enable_manual=yes])
262 AC_ARG_ENABLE(libsm,
263                 [  --disable-libsm                 Do not build libSM support for session management],
264                 [enable_libsm=$enableval], [enable_libsm=yes])
266 AC_ARG_ENABLE(ipv6,
267                 [  --disable-ipv6                  Do not build IPv6 support],
268                 [enable_ipv6=$enableval], [enable_ipv6=yes])
270 AC_ARG_ENABLE(gnutls,
271                 [  --disable-gnutls                Do not build GnuTLS support for TLS],
272                     [enable_gnutls=$enableval], [enable_gnutls=yes])
274 AC_ARG_ENABLE(enchant,
275                 [  --disable-enchant               Do not build Enchant support for spell-checking],
276                 [enable_enchant=$enableval], [enable_enchant=yes])
278 AC_ARG_ENABLE(crash-dialog,
279                 [  --enable-crash-dialog           Build crash dialog],
280                 [enable_crash_dialog=$enableval], [enable_crash_dialog=no])
282 AC_ARG_ENABLE(generic-umpc,
283                 [  --enable-generic-umpc           Build generic UMPC code],
284                 [enable_generic_umpc=$enableval], [enable_generic_umpc=no])
286 AC_ARG_ENABLE(compface,
287                 [  --disable-compface              Do not build compface support for X-Face],
288                 [enable_compface=$enableval], [enable_compface=yes])
290 AC_ARG_ENABLE(pthread,
291                 [  --disable-pthread               Do not build pthread support],
292                 [enable_pthread=$enableval], [enable_pthread=yes])
294 AC_ARG_ENABLE(startup-notification,
295                 [  --disable-startup-notification  Do not startup notification support],
296                 [enable_startup_notification=$enableval], [enable_startup_notification=yes])
298 AC_ARG_ENABLE(dbus,
299                 [  --disable-dbus                  Do not build DBUS support],
300                 [enable_dbus=$enableval], [enable_dbus=yes])
302 AC_ARG_ENABLE(ldap,
303                 [  --disable-ldap                  Do not build LDAP support],
304                 [enable_ldap=$enableval], [enable_ldap=yes])
306 AC_ARG_ENABLE(jpilot,
307                 [  --disable-jpilot                Do not build JPilot support],
308                 [enable_jpilot=$enableval], [enable_jpilot=yes])
310 AC_ARG_ENABLE(networkmanager,
311                 [  --disable-networkmanager        Do not build NetworkManager support],
312                 [enable_networkmanager=$enableval], [enable_networkmanager=yes])
314 AC_ARG_ENABLE(libetpan,
315                 [  --disable-libetpan              Do not build libetpan support for IMAP4/NNTP],
316                 [enable_libetpan=$enableval], [enable_libetpan=yes])
318 AC_ARG_ENABLE(valgrind,
319                 [  --disable-valgrind              Do not build valgrind support for debugging],
320                 [enable_valgrind=$enableval], [enable_valgrind=yes])
322 AC_ARG_ENABLE(alternate-addressbook,
323                 [  --enable-alternate-addressbook  Build alternate external address book support],
324                 [enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
326 AC_ARG_ENABLE(svg,
327         [  --disable-svg                   Do not build SVG support],
328         [enable_svg=$enableval], [enable_svg=yes])
330 AC_ARG_ENABLE(tests,
331                                 [  --enable-tests                   Build unit tests],
332                                 [enable_tests=$enableval], [enable_tests=no])
334 manualdir='${docdir}/manual'
335 AC_ARG_WITH(manualdir,
336         [  --with-manualdir=DIR    Manual directory],
337         [manualdir="$withval"])
338 AC_SUBST(manualdir)
340 dnl ******************************
341 dnl ** Check for required tools **
342 dnl ** to build manuals         **
343 dnl ******************************
345 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
346 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
347 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
348 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
350 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
351 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
352 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
353 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
355 if test x"$enable_manual" = x"yes"; then
356     if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
357         -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
358             enable_manual=yes
359         else
360             enable_manual=no
361     fi
364 AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
366 dnl Set PACKAGE_DATA_DIR in config.h.
367 if test "x${datarootdir}" = 'x${prefix}/share'; then
368         if test "x${prefix}" = "xNONE"; then
369                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
370         else
371                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
372         fi
373 else
374         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
377 AC_CHECK_LIB(xpg4, setlocale)
379 SM_LIBS=""
380 dnl Check for LibSM
381 AC_MSG_CHECKING([whether to use LibSM])
382 if test x"$enable_libsm" = xyes; then
383         AC_MSG_RESULT(yes)
384         AC_CHECK_LIB(SM, SmcSaveYourselfDone,
385                 [SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
386                 $X_LIBS -lICE)
387         AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
388         if test x"$enable_libsm" = xyes; then
389                 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
390         else
391                 AC_MSG_RESULT(not found)
392                 AC_MSG_WARN([*** LibSM will not be supported ***])
393         fi
394 else
395         AC_MSG_RESULT(no)
397 AC_SUBST(SM_LIBS)
399 dnl Check for __VA_OPT__ macro
400 AC_CACHE_CHECK([for __VA_OPT__],
401         [ac_cv_va_opt],
402         [AC_TRY_COMPILE([#include <stdio.h>],
403                 [#define va_opt_printf(format, ...) fprintf(stderr, format __VA_OPT__(,) __VA_ARGS__)
404                 va_opt_printf("success\n");],
405                 [ac_cv_va_opt=yes],
406                 [ac_cv_va_opt=no])]
408 if test "$ac_cv_va_opt" = yes; then
409         AC_DEFINE([HAVE_VA_OPT], [1], [Define if __VA_OPT__ macro works])
412 dnl Check for d_type member in struct dirent
413 AC_MSG_CHECKING([whether struct dirent has d_type member])
414 AC_CACHE_VAL(ac_cv_dirent_d_type,[
415         AC_TRY_COMPILE([#include <dirent.h>],
416                        [struct dirent d; d.d_type = DT_REG;],
417                        ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
419 AC_MSG_RESULT($ac_cv_dirent_d_type)
420 if test $ac_cv_dirent_d_type = yes; then
421         AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
422                   Define if `struct dirent' has `d_type' member.)
425 # Check whether mkdir does not take the permission argument.
426 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
428 dnl Checks for header files.
429 AC_HEADER_DIRENT
430 AC_HEADER_STDC
431 AC_HEADER_SYS_WAIT
432 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
433                  sys/param.h sys/utsname.h sys/select.h \
434                  wchar.h wctype.h locale.h netdb.h)
435 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
436 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
438 dnl Checks for typedefs, structures, and compiler characteristics.
439 AC_C_CONST
440 AC_TYPE_OFF_T
441 AC_TYPE_PID_T
442 AC_TYPE_SIZE_T
443 AC_STRUCT_TM
445 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
446 dnl may be defined only in wchar.h (this happens with gcc-2.96).
447 dnl So we need to use this extended macro.
448 CLAWS_CHECK_TYPE(wint_t, unsigned int,
450 #if HAVE_WCHAR_H
451 #include <wchar.h>
452 #endif
453 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
455 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
456 AC_CHECK_SIZEOF(unsigned short, 2)
457 AC_CHECK_SIZEOF(unsigned int, 4)
458 AC_CHECK_SIZEOF(unsigned long, 4)
460 dnl Checks for library functions.
461 AC_FUNC_ALLOCA
462 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr strcasestr \
463                uname flock lockf inet_aton inet_addr \
464                fchmod mkstemp truncate getuid regcomp)
466 AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
468 dnl *****************
469 dnl ** common code **
470 dnl *****************
472 dnl check for glib
473 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36 gmodule-2.0 >= 2.36 gobject-2.0 >= 2.36 gthread-2.0 >= 2.36])
475 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
476 AC_SUBST(GLIB_GENMARSHAL)
478 AC_SUBST(GLIB_CFLAGS)
479 AC_SUBST(GLIB_LIBS)
481 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
483 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
484 syl_save_LIBS=$LIBS
485 LIBS="$LIBS $GTK_LIBS"
486 AC_CHECK_FUNCS(bind_textdomain_codeset)
487 LIBS=$syl_save_LIBS
489 dnl check for IPv6 option
490 dnl automated checks for IPv6 support.
491 AC_MSG_CHECKING([whether to use IPv6])
492 if test x"$enable_ipv6" = xyes; then
493         AC_MSG_RESULT(yes)
494         AC_MSG_CHECKING([for IPv6 support])
495         if test x"$platform_win32" = xyes; then
496                 AC_CACHE_VAL(ac_cv_ipv6,[
497                         AC_TRY_COMPILE([
498                                         #include <ws2tcpip.h>
499                                 ], [struct in6_addr a;],
500                                 ac_cv_ipv6=yes, ac_cv_ipv6=no)
501                 ])
502         else
503                 AC_CACHE_VAL(ac_cv_ipv6,[
504                         AC_TRY_COMPILE([
505                                         #define INET6
506                                         #include <sys/types.h>
507                                         #include <netinet/in.h>
508                                 ], [int x = IPPROTO_IPV6; struct in6_addr a;],
509                                 ac_cv_ipv6=yes, ac_cv_ipv6=no)
510                 ])
511         fi
512         AC_MSG_RESULT($ac_cv_ipv6)
513         if test $ac_cv_ipv6 = yes; then
514                 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
515         else
516                 AC_MSG_WARN(*** IPv6 will not be supported ***)
517                 enable_ipv6=no
518         fi
519 else
520         AC_MSG_RESULT(no)
523 dnl GNUTLS
524 AC_MSG_CHECKING([whether to use GnuTLS])
525 AC_MSG_RESULT($enable_gnutls)
526 if test "x$enable_gnutls" != "xno"; then
527         PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
528         [
529                 AC_DEFINE(USE_GNUTLS, 1, gnutls)
530                 echo "Building with GnuTLS"
531                 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
532                 [
533                         dnl No linking against libgcrypt needed
534                 ],
535                 [
536                         dnl linking against libgcrypt *is* needed
537                         GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
538                 ])
539         ],
540         [
541                 echo "Building without GnuTLS"
542                 AC_MSG_RESULT([*** GnuTLS support is recommended ])
543                 AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
544                 AC_MSG_ERROR([GnuTLS not found])
545         ])
546         AC_SUBST(GNUTLS_LIBS)
547         AC_SUBST(GNUTLS_CFLAGS)
550 PKG_CHECK_MODULES(NETTLE, nettle)
551 AC_SUBST(NETTLE_LIBS)
553 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
554             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
555 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
557 dnl RC dir (will be default at a certain point in time)
558 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .claws-mail)],
559               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
561 dnl Set correct default value based on platform
562 if test x"$ac_cv_with_config_dir" = x""; then
563         if test x"$platform_win32" = xyes; then
564                 ac_cv_with_config_dir="Claws-mail"
565         else
566                 ac_cv_with_config_dir=".claws-mail"
567         fi
569 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
571 AC_ARG_WITH(password-encryption, [  --with-password-encryption=PROVIDER    Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
572                                                 pwd_crypto="$withval", pwd_crypto="default")
574 if test x"$pwd_crypto" = xdefault; then
575         if test x"$enable_gnutls" = xyes; then
576                 if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
577                         pwd_crypto="gnutls"
578                 fi
579         fi
581 if test x"$pwd_crypto" = xdefault; then
582         pwd_crypto="old"
585 case $pwd_crypto in
586         gnutls)
587                 if test x"$enable_gnutls" = xno; then
588                         AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
589                 fi
590                 if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
591                         AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
592                 fi
593                 AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
594                 ;;
595         old)
596                 AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
597                 ;;
598         *)
599                 AC_MSG_ERROR([Unknown password encryption provider requested.])
600                 ;;
601 esac
604 dnl ************************
605 dnl ** GTK user interface **
606 dnl ************************
608 dnl Checks for GTK
609 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
611 AC_ARG_ENABLE(deprecated,
612                 [  --disable-deprecated            Disable deprecated GTK functions],
613                 gtkdeprecated=$enableval)
614 AC_MSG_CHECKING([whether to use deprecated GTK functions])
615 if test x"$gtkdeprecated" != xno; then
616         AC_MSG_RESULT(yes)
617 else
618         GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
619         AC_MSG_RESULT(no)
622 dnl Make sure the code does not regress to using deprecated GTK stuff...
623 GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
625 AC_SUBST(GTK_CFLAGS)
626 AC_SUBST(GTK_LIBS)
628 dnl enchant is used for spell checking
629 AC_MSG_CHECKING([whether to use enchant])
630 AC_MSG_RESULT($enable_enchant)
631 if test $enable_enchant = yes; then
632         PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
633         [
634                 AC_DEFINE(USE_ENCHANT, 1, enchant)
635                 echo "Building with enchant"
636                 enable_enchant=yes
637         ],
638         [
639                 PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
640                 [
641                         AC_DEFINE(USE_ENCHANT, 1, enchant-2)
642                         echo "Building with enchant-2"
643                         enable_enchant=yes
644                 ],
645                 [
646                         echo "Building without enchant-notification"
647                         enable_enchant=no
648                 ])
649         ])
650         AC_SUBST(ENCHANT_CFLAGS)
651         AC_SUBST(ENCHANT_LIBS)
654 dnl want crash dialog
655 if test $enable_crash_dialog = yes; then
656 dnl check if GDB is somewhere
657         AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
658         AC_MSG_CHECKING([whether to use crash dialog])
659         if test $enable_crash_dialog = yes; then
660                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
661         fi
662         AC_MSG_RESULT($enable_crash_dialog)
665 dnl generic umpc
666 if test $enable_generic_umpc = yes; then
667         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
668         AC_MSG_RESULT($enable_generic_umpc)
671 dnl Check for X-Face support
672 AC_MSG_CHECKING([whether to use compface])
673 if test x"$enable_compface" = xyes; then
674         AC_MSG_RESULT(yes)
675         AC_CHECK_LIB(compface, uncompface,
676                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
677                 [enable_compface=no])
678         if test x"$enable_compface" = xyes; then
679                 COMPFACE_LIBS="-lcompface"
680         else
681                 COMPFACE_LIBS=""
682         fi
683         AC_SUBST(COMPFACE_LIBS)
684 else
685         AC_MSG_RESULT(no)
688 dnl check for pthread support
689 AC_MSG_CHECKING([whether to use pthread])
690 if test x$enable_pthread = xno; then
691         AC_MSG_RESULT(no)
692 else
693         AC_MSG_RESULT(yes)
695         # For W32 we need to use a special ptrhead lib. In this case we can't
696         # use AC_CHECK_LIB because it has no means of checking for a
697         # library installed under a different name.  Checking for the
698         # header is okay.
699         if test -n "${pthread_name}" ; then
700            enable_pthread=yes
701         else
702         AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
703         fi
704         AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
706         if test x$enable_pthread = xyes; then
707                 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
708                 if test -z "${pthread_name}" ; then
709                 PTHREAD_LIBS="-lpthread"
710         fi
711         fi
714 AC_SUBST(PTHREAD_LIBS)
717 dnl Check whether we need to pass -lresolv
718 dnl We know that we don't need it for W32.
720 if test x$os_win32 = xno; then
721   t_oldLibs="$LIBS"
722   LIBS="$LIBS"
723   ac_cv_var__res_options=no
724   AC_TRY_LINK([#include <sys/types.h>
725              #include <sys/socket.h>
726              #include <netinet/in.h>
727              #include <arpa/nameser.h>
728              #include <resolv.h>],
729                 [_res.options = RES_INIT;],
730                 ac_cv_var__res_options=yes);
731   if test "$ac_cv_var__res_options" != "yes"; then
732         LIBRESOLV="-lresolv"
733   fi
734   LIBS="$t_oldLibs"
736   if test "x$LIBRESOLV" = "x"; then
737         AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
738         LIBS="$t_oldLibs"
739   fi
741 AC_SUBST(LIBRESOLV)
743 LIBS="$LIBS $LIBRESOLV"
745 dnl #######################################################################
746 dnl # Check for startup notification
747 dnl #######################################################################
748 if test "x$enable_startup_notification" = "xyes"; then
749         PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
750         [
751                 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
752                 echo "Building with libstartup-notification"
753                 enable_startup_notification=yes
754         ],
755         [
756                 echo "Building without libstartup-notification"
757                 enable_startup_notification=no
758         ])
760         AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
761         AC_SUBST(STARTUP_NOTIFICATION_LIBS)
764 dnl #######################################################################
765 dnl # Check for D-Bus support
766 dnl #######################################################################
767 if test "x$enable_dbus" = "xyes"; then
768         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
769         [
770                 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
771                 enable_dbus=yes
772         ],
773         [
774                 echo "D-Bus requirements not met. D-Bus support not activated."
775                 enable_dbus=no
776         ])
777         AC_SUBST(DBUS_CFLAGS)
778         AC_SUBST(DBUS_LIBS)
781 dnl #######################################################################
782 dnl # Configure address book support
783 dnl #######################################################################
785 dnl #######################################################################
786 dnl # Check for alternate address book support
787 dnl #######################################################################
788 AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
789 if test x"$enable_dbus" = xyes; then
790         AC_MSG_RESULT([yes])
791         AC_MSG_CHECKING([whether to enable alternate address book])
792         if test x"$enable_alternate_addressbook" = xyes; then
793                 AC_MSG_RESULT([yes])
794                 PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
795                 [
796                         AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
797                         enable_alternate_addressbook=yes
798                         AC_SUBST(CONTACTS_CFLAGS)
799                         AC_SUBST(CONTACTS_LIBS)
800                 ],
801                 [
802                         enable_alternate_addressbook=no
803                 ])
804         else
805                 AC_MSG_RESULT([no])
806                 enable_alternate_addressbook=no
807         fi
808 else
809         AC_MSG_RESULT([no])
810         enable_alternate_addressbook=no
813 dnl #######################################################################
814 dnl # Check for old address book support
815 dnl #######################################################################
816 if test x"$enable_alternate_addressbook" = xno; then
817         dnl for LDAP support in addressbook
818         dnl no check for libraries; dynamically loaded
819         AC_MSG_CHECKING([whether to use LDAP])
820         if test x"$enable_ldap" = xno; then
821                 AC_MSG_RESULT(no)
822         elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
823                 AC_MSG_RESULT(no - LDAP support needs pthread support)
825                 enable_ldap=no
826         elif test x"$platform_win32" = xyes; then
827                 AC_MSG_RESULT(yes)
828                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
829                 LDAP_LIBS="-lwldap32"
830                 AC_SUBST(LDAP_LIBS)
831         else
832                 AC_MSG_RESULT(yes)
834                 dnl check for available libraries, and pull them in
835                 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
836                 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
837                 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
838                 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
839                                  $LDAP_LIBS)
841                 AC_CHECK_HEADERS(ldap.h lber.h,
842                                  [ enable_ldap=yes ],
843                                  [ enable_ldap=no ])
845                 if test "$enable_ldap" = yes; then
846                         AC_CHECK_LIB(ldap, ldap_open,
847                                          [ enable_ldap=yes ],
848                                          [ enable_ldap=no ],
849                                          $LDAP_LIBS)
851                         AC_CHECK_LIB(ldap, ldap_start_tls_s,
852                                              [ ac_cv_have_tls=yes ],
853                                              [ ac_cv_have_tls=no ])
855                 fi
857                 AC_MSG_CHECKING([whether ldap library is available])
858                 AC_MSG_RESULT($enable_ldap)
860                 AC_MSG_CHECKING([whether TLS library is available])
861                 AC_MSG_RESULT($ac_cv_have_tls)
863                 if test "$enable_ldap" = yes; then
864                         AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
865                         LDAP_LIBS="$LDAP_LIBS -lldap"
866                         AC_SUBST(LDAP_LIBS)
867                         if test "$ac_cv_have_tls" = yes; then
868                                 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
869                         fi
870                         dnl As of OpenLDAP API version 3000 a number of functions has
871                         dnl been deprecated. As Claws-mail compiles and runs on many
872                         dnl platforms and many versions of OpenLDAP we need to be able
873                         dnl to switch between the old and new API because new API has
874                         dnl added new functions replacing old ones and at the same time
875                         dnl old functions has been changed.
876                         dnl If cross-compiling defaults to enable deprecated features
877                         dnl for maximum portability
878                         AC_MSG_CHECKING([The API version of OpenLDAP])
879                         AC_RUN_IFELSE(
880                                 [AC_LANG_PROGRAM(
881                                  [#include <ldap.h>],
882                                  [if (LDAP_API_VERSION >= 3000)
883                                                 return 1
884                                 ])],
885                                 [AC_MSG_RESULT([version < 3000])
886                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
887                                 [AC_MSG_RESULT([version >= 3000])
888                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
889                                 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
890                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
891                                  AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
892                         )
893                 fi
894         fi
896         dnl for JPilot support in addressbook
897         dnl no check for libraries; these are dynamically loaded
898         AC_MSG_CHECKING([whether to use JPilot])
899         if test "$enable_jpilot" = yes; then
900                 AC_MSG_RESULT(yes)
901                 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
902                                  [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
903                                  [ enable_jpilot=no ])
904                 if test "$enable_jpilot" = no; then
905                         AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
906                                          [ enable_jpilot=yes
907                                            AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
908                 fi
910                 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
911                 if test x"$enable_jpilot" = xyes; then
912                         AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
913                 else
914                         AC_MSG_NOTICE([JPilot support not available])
915                 fi
916                 AC_SUBST(JPILOT_LIBS)
917         else
918                 AC_MSG_RESULT(no)
919         fi
922 AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
924 dnl #######################################################################
925 dnl # Check for NetworkManager support
926 dnl #######################################################################
927 if test x"$enable_dbus" = xyes; then
928         if test x"$enable_networkmanager" = xyes; then
929                 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
930                 [
931                         AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
932                         echo "Building with NetworkManager support"
933                         enable_networkmanager=yes
934                 ],
935                 [
936                         echo "NetworkManager not found."
937                         enable_networkmanager=no
938                 ])
939                 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
940         fi
941 else
942         echo "NetworkManager support deactivated as D-Bus requirements were not met."
943         enable_networkmanager=no
946 dnl Libetpan
947 AC_MSG_CHECKING([whether to use libetpan])
948 if test x"$enable_libetpan" = xyes; then
949     AC_MSG_RESULT(yes)
951     libetpan_config=no
952     libetpan_result=no
953     libetpan_versiontype=0
955     # since 1.9.4, libetpan uses pkg-config
956     PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
957     [
958         LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
959         libetpan_config=yes
960     ],
961     [
962         # before 1.9.4, libetpan uses its own libetpan-config script
963         AC_PATH_PROG(libetpanconfig, [libetpan-config])
964         if test "x$libetpanconfig" != "x"; then
965             LIBETPAN_CFLAGS="`$libetpanconfig --cflags`"
966             LIBETPAN_LIBS="`$libetpanconfig --libs`"
967             # support libetpan version like x.x and x.x.x
968             libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
969             if test $libetpan_versiontype -eq 1; then
970                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
971             else
972                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
973             fi
974             libetpan_config=yes
975         fi
976     ])
977     if test "x$libetpan_config" = "xyes"; then
978         AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
979         if test "x$libetpan_result" = "xyes"; then
980             AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
981             LIBS="$LIBS $LIBETPAN_LIBS"
982             AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
983             AC_MSG_RESULT([$libetpan_result])
984         fi
985     fi
986     if test "x$libetpan_result" = "xyes"; then
987         if test $libetpan_versiontype -eq 1; then
988             if test "$LIBETPAN_VERSION" -lt "57"; then
989                 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
990                 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
991                 AC_MSG_ERROR([libetpan 0.57 not found])
992             fi
993         fi
994         AC_SUBST(LIBETPAN_CFLAGS)
995         AC_SUBST(LIBETPAN_LIBS)
996         AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
997     else
998         AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
999         AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1000         AC_MSG_ERROR([libetpan 0.57 not found])
1001     fi
1002 else
1003     AC_MSG_RESULT(no)
1005 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1007 dnl librsvg
1008 AC_MSG_CHECKING([whether to use librsvg])
1009 if test x"$enable_svg" = xyes; then
1010         AC_MSG_RESULT(yes)
1011     PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
1012     [
1013         AC_SUBST(SVG_CFLAGS)
1014         AC_SUBST(SVG_LIBS)
1015                 AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
1016                 enable_svg=yes
1017         ],
1018         [
1019                 AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
1020                 enable_svg=no
1021         ])
1022 else
1023         AC_MSG_RESULT(no)
1026 AC_MSG_CHECKING([whether to use valgrind])
1027 if test x$enable_valgrind = xyes; then
1028         AC_MSG_RESULT(yes)
1029         PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1030                           enable_valgrind=yes, enable_valgrind=no)
1031         if test x"$enable_valgrind" = xyes; then
1032                 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1033         else
1034                 AC_MSG_RESULT(not found)
1035         fi
1036 else
1037         AC_MSG_RESULT(no)
1039 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
1041 AC_MSG_CHECKING([whether to build unit tests])
1042 if test x$enable_tests = xyes; then
1043         AC_MSG_RESULT(yes)
1044 else
1045         AC_MSG_RESULT(no)
1047 AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
1049 dnl *************************
1050 dnl ** section for plugins **
1051 dnl *************************
1053 PLUGINS=""
1054 DISABLED_PLUGINS=""
1055 MISSING_DEPS_PLUGINS=""
1057 dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
1058 dnl or (auto-)disabled (no for both)
1060 dnl All plugins are auto-enabled except for Demo which is just there to help
1061 dnl potential plugins writers.
1063 AC_ARG_ENABLE(acpi_notifier-plugin,
1064                 [  --disable-acpi_notifier-plugin  Do not build acpi_notifier plugin],
1065                 [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
1067 AC_ARG_ENABLE(address_keeper-plugin,
1068                 [  --disable-address_keeper-plugin Do not build address_keeper plugin],
1069                 [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
1071 AC_ARG_ENABLE(archive-plugin,
1072                 [  --disable-archive-plugin        Do not build archive plugin],
1073                 [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
1075 AC_ARG_ENABLE(att_remover-plugin,
1076                 [  --disable-att_remover-plugin    Do not build att_remover plugin],
1077                 [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
1079 AC_ARG_ENABLE(attachwarner-plugin,
1080                 [  --disable-attachwarner-plugin   Do not build attachwarner plugin],
1081                 [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
1083 AC_ARG_ENABLE(bogofilter-plugin,
1084                 [  --disable-bogofilter-plugin     Do not build bogofilter plugin],
1085                 [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
1087 AC_ARG_ENABLE(bsfilter-plugin,
1088                 [  --disable-bsfilter-plugin       Do not build bsfilter plugin],
1089                 [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
1091 AC_ARG_ENABLE(clamd-plugin,
1092                 [  --disable-clamd-plugin          Do not build clamd plugin],
1093                 [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
1095 AC_ARG_ENABLE(dillo-plugin,
1096                 [  --disable-dillo-plugin          Do not build dillo plugin],
1097                 [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
1099 AC_ARG_ENABLE(fancy-plugin,
1100                 [  --disable-fancy-plugin          Do not build fancy plugin],
1101                 [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
1103 AC_ARG_ENABLE(fetchinfo-plugin,
1104                 [  --disable-fetchinfo-plugin      Do not build fetchinfo plugin],
1105                 [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
1107 AC_ARG_ENABLE(gdata-plugin,
1108                 [  --disable-gdata-plugin          Do not build gdata plugin],
1109                 [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
1111 AC_ARG_ENABLE(libravatar-plugin,
1112                 [  --disable-libravatar-plugin     Do not build libravatar  plugin],
1113                 [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
1115 AC_ARG_ENABLE(litehtml_viewer-plugin,
1116                 [  --disable-litehtml_viewer-plugin       Do not build litehtml_viewer plugin],
1117                 [enable_litehtml_viewer_plugin=$enableval], [enable_litehtml_viewer_plugin=auto])
1119 AC_ARG_ENABLE(mailmbox-plugin,
1120                 [  --disable-mailmbox-plugin       Do not build mailmbox plugin],
1121                 [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
1123 AC_ARG_ENABLE(managesieve-plugin,
1124                 [  --disable-managesieve-plugin    Do not build managesieve plugin],
1125                 [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
1127 AC_ARG_ENABLE(newmail-plugin,
1128                 [  --disable-newmail-plugin        Do not build newmail plugin],
1129                 [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
1131 AC_ARG_ENABLE(notification-plugin,
1132                 [  --disable-notification-plugin   Do not build notification plugin],
1133                 [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
1135 AC_ARG_ENABLE(pdf_viewer-plugin,
1136                 [  --disable-pdf_viewer-plugin     Do not build pdf_viewer plugin],
1137                 [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
1139 AC_ARG_ENABLE(perl-plugin,
1140                 [  --disable-perl-plugin           Do not build perl plugin],
1141                 [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
1143 AC_ARG_ENABLE(python-plugin,
1144                 [  --disable-python-plugin         Do not build python plugin],
1145                 [enable_python_plugin=$enableval], [enable_python_plugin=auto])
1147 AC_ARG_ENABLE(pgpcore-plugin,
1148                 [  --disable-pgpcore-plugin        Do not build pgpcore plugin],
1149                 [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
1151 AC_ARG_ENABLE(pgpmime-plugin,
1152                 [  --disable-pgpmime-plugin        Do not build pgpmime plugin],
1153                 [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
1155 AC_ARG_ENABLE(pgpinline-plugin,
1156                 [  --disable-pgpinline-plugin      Do not build pgpinline plugin],
1157                 [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
1159 AC_ARG_ENABLE(rssyl-plugin,
1160                 [  --disable-rssyl-plugin          Do not build rssyl plugin],
1161                 [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
1163 AC_ARG_ENABLE(smime-plugin,
1164                 [  --disable-smime-plugin          Do not build smime plugin],
1165                 [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
1167 AC_ARG_ENABLE(spamassassin-plugin,
1168                 [  --disable-spamassassin-plugin   Do not build spamassassin plugin],
1169                 [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
1171 AC_ARG_ENABLE(spam_report-plugin,
1172                 [  --disable-spam_report-plugin    Do not build spam_report plugin],
1173                 [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
1175 AC_ARG_ENABLE(tnef_parse-plugin,
1176                 [  --disable-tnef_parse-plugin     Do not build tnef_parse plugin],
1177                 [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
1179 AC_ARG_ENABLE(vcalendar-plugin,
1180                 [  --disable-vcalendar-plugin      Do not build vcalendar plugin],
1181                 [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
1183 dnl disabled by default
1184 AC_ARG_ENABLE(demo-plugin,
1185                 [  --enable-demo-plugin            Build demo plugin],
1186                 [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
1189 dnl Then we check (unconditionnaly) for plugins dependencies
1190 dnl Some dependencies are optional, some mandatory. This is taken care of
1191 dnl later.
1193 dnl During this dependancy check we do the checks themselves, define HAVE_X to
1194 dnl either yes or no, and do the AC_SUBST calls.
1196 dnl Archive:            libarchive
1197 dnl Fancy:              Webkit, curl, optionally libsoup-gnome
1198 dnl Gdata:              libgdata
1199 dnl Litehtml            a C++ compiler, >=glib-2.36, cairo, fontconfig, gumbo, curl
1200 dnl Libravatar:         libcurl
1201 dnl Notification:       optionally libnotify  unity/messaging-menu
1202 dnl                                libcanberra_gtk hotkey
1203 dnl Pdf-Viewer:         libpoppler
1204 dnl Perl:               sed perl
1205 dnl PGP/Core:           libgpgme
1206 dnl PGP/Mime:           pgpcore libgpgme
1207 dnl PGP/Inline:         pgpcore libgpgme
1208 dnl S/Mime:             pgpcore libgpgme
1209 dnl Python:             Python
1210 dnl RSSyl:              expat libcurl
1211 dnl SpamReport:         libcurl
1212 dnl vCalendar:          libcurl, libical
1213 dnl tnef_parse:         libytnef
1215 dnl libcurl ********************************************************************
1216 PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
1217 AC_SUBST(CURL_LIBS)
1218 AC_SUBST(CURL_CFLAGS)
1220 dnl expat **********************************************************************
1221 PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
1223 if test x"$HAVE_EXPAT" = xno; then
1224         AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
1225         AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
1226         if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
1227                 HAVE_EXPAT=yes
1228                 EXPAT_CFLAGS=""
1229                 EXPAT_LIBS="-lexpat"
1230         fi
1233 AC_SUBST(EXPAT_CFLAGS)
1234 AC_SUBST(EXPAT_LIBS)
1236 dnl webkit *********************************************************************
1237 PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.10.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
1238 AC_SUBST(WEBKIT_LIBS)
1239 AC_SUBST(WEBKIT_CFLAGS)
1241 dnl libsoup ********************************************************************
1242 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
1243 if test x"$HAVE_LIBSOUP" = xyes; then
1244         AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
1246 AC_SUBST(LIBSOUP_CFLAGS)
1247 AC_SUBST(LIBSOUP_LIBS)
1249 dnl libsoup-gnome **************************************************************
1250 PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
1251 if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
1252         AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
1254 AC_SUBST(LIBSOUP_GNOME_CFLAGS)
1255 AC_SUBST(LIBSOUP_GNOME_LIBS)
1257 dnl libarchive *****************************************************************
1258 PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
1259 AC_SUBST(ARCHIVE_LIBS)
1260 AC_SUBST(ARCHIVE_CFLAGS)
1261 AC_CHECK_LIB([archive], [archive_read_new],
1262                        ARCHIVE_LIBS=-larchive
1263                        HAVE_ARCHIVE=yes
1264                        AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
1265                        HAVE_ARCHIVE=no
1266                        )
1268 dnl libgdata *******************************************************************
1269 PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
1270 AC_SUBST(GDATA_CFLAGS)
1271 AC_SUBST(GDATA_LIBS)
1273 dnl cairo **********************************************************************
1274 PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
1275 AC_SUBST(CAIRO_CFLAGS)
1276 AC_SUBST(CAIRO_LIBS)
1278 dnl fontconfig *****************************************************************
1279 PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no)
1280 AC_SUBST(FONTCONFIG_CFLAGS)
1281 AC_SUBST(FONTCONFIG_LIBS)
1283 dnl gumbo **********************************************************************
1284 PKG_CHECK_MODULES(LIBGUMBO, gumbo >= 0.10, HAVE_LIBGUMBO=yes, HAVE_LIBGUMBO=no)
1285 AC_SUBST(LIBGUMBO_CFLAGS)
1286 AC_SUBST(LIBGUMBO_LIBS)
1288 dnl libical ********************************************************************
1289 PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
1290 AC_SUBST(LIBICAL_CFLAGS)
1291 AC_SUBST(LIBICAL_LIBS)
1293 dnl Poppler ********************************************************************
1294 PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
1295 AC_SUBST(POPPLER_LIBS)
1296 AC_SUBST(POPPLER_CFLAGS)
1298 dnl check for Poppler extra features that we conditionally support
1299 if test x"$HAVE_POPPLER" = xyes; then
1300         OLD_CFLAGS=$CFLAGS
1301         CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
1302         AC_CHECK_DECL(POPPLER_DEST_NAMED,
1303                 [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
1304                 ,[#include <poppler-action.h>])
1305         AC_CHECK_DECL(POPPLER_DEST_XYZ,
1306                 [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
1307                 ,[#include <poppler-action.h>])
1308         CFLAGS=$OLD_CFLAGS
1311 dnl perl ***********************************************************************
1312 AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
1313 if test x"$HAVE_PERL" = xyes; then
1314         AC_MSG_CHECKING(for perl >= 5.8.0)
1315         PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
1316         if test "$PERL_VER" = "yes"; then
1317                 AC_MSG_RESULT(yes)
1318         else
1319                 AC_MSG_RESULT(no)
1320                 HAVE_PERL=no
1321         fi
1323 if test x"$HAVE_PERL" = xyes; then
1324         AC_MSG_CHECKING(for Perl compile flags)
1325         PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
1326         PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
1327         PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
1328         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
1329         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
1330         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
1331         AC_MSG_RESULT(ok)
1332         AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
1333         
1334         if test x"$HAVE_PERL" = xyes; then
1335                 AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)], 
1336                                              [ HAVE_LIBPERL=no ])
1337         fi
1338         if test x"$HAVE_LIBPERL" = xno; then
1339                 LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
1340                 LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
1341                 AC_MSG_CHECKING([for libperl.so])
1342                 if test -f "$LIBPERL_PREFIX/libperl.so"; then
1343                         AC_MSG_RESULT(yes)
1344                         HAVE_LIBPERL=yes
1345                 else
1346                         AC_MSG_RESULT(no)
1347                 fi      
1348         fi
1349         PERL="perl"
1350         AC_SUBST(PERL)
1351         AC_SUBST(PERL_CFLAGS)
1352         AC_SUBST(PERL_LDFLAGS)
1355 dnl Gpgme **********************************************************************
1356 AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
1357 if test x"$HAVE_GPGME" = xyes; then
1358         AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
1359         AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
1362 dnl Python *********************************************************************
1363 missing_python=""
1364 PKG_CHECK_MODULES(PYTHON, python2, HAVE_PYTHON=yes, HAVE_PYTHON=no)
1365 if test x"$HAVE_PYTHON" = xno; then
1366         missing_python="python2"
1368 if test x"$HAVE_PYTHON" = xyes; then
1369         PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.10.3, [AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])], HAVE_PYTHON=no)
1370         if test x"$HAVE_PYTHON" = xno; then
1371                 missing_python="pygtk-2.0 >= 2.10.3"
1372         fi
1374 AC_SUBST(PYTHON_SHARED_LIB)
1375 AC_SUBST(PYTHON_CFLAGS)
1376 AC_SUBST(PYTHON_LIBS)
1377 AC_SUBST(PYGTK_CFLAGS)
1378 AC_SUBST(PYGTK_LIBS)
1380 dnl libnotify ******************************************************************
1381 PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
1382 if test x"$HAVE_LIBNOTIFY" = xyes; then
1383         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
1385 AC_SUBST(libnotify_CFLAGS)
1386 AC_SUBST(libnotify_LIBS)
1388 dnl libcanberra-gtk ************************************************************
1389 PKG_CHECK_MODULES(libcanberra_gtk, libcanberra-gtk >= 0.6, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
1390 if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1391         AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk support is enabled])
1393 AC_SUBST(libcanberra_gtk_CFLAGS)
1394 AC_SUBST(libcanberra_gtk_LIBS)
1396 dnl unity/messaging-menu *******************************************************
1397 PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
1398 if test x"$HAVE_UNITY" = xyes; then
1399         AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
1401 AC_SUBST(unity_CFLAGS)
1402 AC_SUBST(unity_LIBS)
1404 dnl hotkeys ********************************************************************
1405 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)
1406 if test x"$HAVE_HOTKEYS" = xyes; then
1407         AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
1409 AC_SUBST(CM_NP_HOTKEY_CFLAGS)
1410 AC_SUBST(CM_NP_HOTKEY_LIBS)
1412 dnl libytnef *******************************************************************
1413 YTNEF_CFLAGS=""
1414 YTNEF_LIBS=""
1415 have_ytnef=0
1416 # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
1417 # accordingly
1418 AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
1419 if test $have_ytnef -eq 0; then
1420         AC_CHECK_HEADER(libytnef/ytnef.h,
1421                                                                         [have_ytnef=1;
1422                                                                          YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
1423                                                                         [have_ytnef=0])
1425 if test $have_ytnef -eq 1; then
1426         AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
1427         # Now we have to figure out which libytnef version we're using,
1428         # based on whether SwapDDWord takes one argument or two.
1429         if test "x${YTNEF_CFLAGS}" = "x"; then
1430                 ytnef_include="#include <ytnef.h>"
1431         else
1432                 ytnef_include="#include <libytnef/ytnef.h>"
1433         fi
1434         AC_TRY_COMPILE([#include <stdio.h>
1435                                                                         ${ytnef_include}],
1436                                                                         [SwapDDWord(0, 0);],
1437                                                                         [have_ytnef=1],
1438                                                                         [have_ytnef=0])
1439         if test $have_ytnef -eq 0; then
1440                 AC_TRY_COMPILE([#include <stdio.h>
1441                                                                                 ${ytnef_include}],
1442                                                                                 [SwapDDWord(0);],
1443                                                                                 [have_ytnef=1;
1444                                                                                  YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],
1445                                                                                 [have_ytnef=0])
1446         fi
1447         if test $have_ytnef -eq 1; then
1448                 YTNEF_LIBS="-lytnef"
1449                 AC_MSG_RESULT(ok)
1450         else
1451                 AC_MSG_RESULT(no idea, unsupported libytnef version?)
1452         fi
1454 AC_SUBST(YTNEF_CFLAGS)
1455 AC_SUBST(YTNEF_LIBS)
1457 dnl Third, we now cross the requested plugins and the available dependencies
1458 dnl If some dependencies are missing and the plugin was explicitely enabled,
1459 dnl we error out, else we only inform.
1461 AC_MSG_CHECKING([whether to build acpi_notifier plugin])
1462 if test x"$enable_acpi_notifier_plugin" != xno; then
1463         PLUGINS="$PLUGINS acpi_notifier"
1464         AC_MSG_RESULT(yes)
1465 else
1466         DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
1467         AC_MSG_RESULT(no)
1470 AC_MSG_CHECKING([whether to build address_keeper plugin])
1471 if test x"$enable_address_keeper_plugin" != xno; then
1472         PLUGINS="$PLUGINS address_keeper"
1473         AC_MSG_RESULT(yes)
1474 else
1475         DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
1476         AC_MSG_RESULT(no)
1479 AC_MSG_CHECKING([whether to build archive plugin])
1480 if test x"$enable_archive_plugin" != xno; then
1481         dependencies_missing=""
1483         if test x"$HAVE_ARCHIVE" = xno; then
1484                 dependencies_missing="libarchive $dependencies_missing"
1485         fi
1487         if test x"$dependencies_missing" = x; then
1488                 PLUGINS="$PLUGINS archive"
1489                 AC_MSG_RESULT(yes)
1490         elif test x"$enable_archive_plugin" = xauto; then
1491                 AC_MSG_RESULT(no)
1492                 AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
1493                 enable_archive_plugin=no
1494                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
1495         else
1496                 AC_MSG_RESULT(no)
1497                 AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
1498         fi
1499 else
1500         DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
1501         AC_MSG_RESULT(no)
1504 AC_MSG_CHECKING([whether to build att_remover plugin])
1505 if test x"$enable_att_remover_plugin" != xno; then
1506         PLUGINS="$PLUGINS att_remover"
1507         AC_MSG_RESULT(yes)
1508 else
1509         DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
1510         AC_MSG_RESULT(no)
1513 AC_MSG_CHECKING([whether to build attachwarner plugin])
1514 if test x"$enable_attachwarner_plugin" != xno; then
1515         PLUGINS="$PLUGINS attachwarner"
1516         AC_MSG_RESULT(yes)
1517 else
1518         DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
1519         AC_MSG_RESULT(no)
1522 AC_MSG_CHECKING([whether to build bogofilter plugin])
1523 if test x"$enable_bogofilter_plugin" != xno; then
1524         PLUGINS="$PLUGINS bogofilter"
1525         AC_MSG_RESULT(yes)
1526 else
1527         DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
1528         AC_MSG_RESULT(no)
1531 AC_MSG_CHECKING([whether to build bsfilter plugin])
1532 if test x"$enable_bsfilter_plugin" != xno; then
1533         PLUGINS="$PLUGINS bsfilter"
1534         AC_MSG_RESULT(yes)
1535 else
1536         DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
1537         AC_MSG_RESULT(no)
1540 AC_MSG_CHECKING([whether to build clamd plugin])
1541 if test x"$enable_clamd_plugin" != xno; then
1542         PLUGINS="$PLUGINS clamd"
1543         AC_MSG_RESULT(yes)
1544 else
1545         DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
1546         AC_MSG_RESULT(no)
1549 AC_MSG_CHECKING([whether to build demo plugin])
1550 if test x"$enable_demo_plugin" != xno; then
1551         PLUGINS="$PLUGINS demo"
1552         AC_MSG_RESULT(yes)
1553 else
1554         DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
1555         AC_MSG_RESULT(no)
1558 AC_MSG_CHECKING([whether to build Dillo plugin])
1559 if test x"$enable_dillo_plugin" != xno; then
1560         PLUGINS="$PLUGINS dillo"
1561         AC_MSG_RESULT(yes)
1562 else
1563         DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
1564         AC_MSG_RESULT(no)
1567 AC_MSG_CHECKING([whether to build fancy plugin])
1568 if test x"$enable_fancy_plugin" != xno; then
1569         dependencies_missing=""
1571         if test x"$HAVE_WEBKIT" = xno; then
1572                 dependencies_missing="libwebkit-1.0 $dependencies_missing"
1573         fi
1574         if test x"$HAVE_CURL" = xno; then
1575                 dependencies_missing="libcurl $dependencies_missing"
1576         fi
1578         if test x"$dependencies_missing" = x; then
1579                 PLUGINS="$PLUGINS fancy"
1580                 AC_MSG_RESULT(yes)
1581         elif test x"$enable_fancy_plugin" = xauto; then
1582                 AC_MSG_RESULT(no)
1583                 AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
1584                 enable_fancy_plugin=no
1585                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
1586         else
1587                 AC_MSG_RESULT(no)
1588                 AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
1589         fi
1590 else
1591         DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
1592         AC_MSG_RESULT(no)
1595 AC_MSG_CHECKING([whether to build fetchinfo plugin])
1596 if test x"$enable_fetchinfo_plugin" != xno; then
1597         PLUGINS="$PLUGINS fetchinfo"
1598         AC_MSG_RESULT(yes)
1599 else
1600         DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
1601         AC_MSG_RESULT(no)
1604 AC_MSG_CHECKING([whether to build gdata plugin])
1605 if test x"$enable_gdata_plugin" != xno; then
1606         dependencies_missing=""
1608         if test x"$HAVE_GDATA" = xno; then
1609                 dependencies_missing="libgdata $dependencies_missing"
1610         fi
1612         if test x"$dependencies_missing" = x; then
1613                 PLUGINS="$PLUGINS gdata"
1614                 AC_MSG_RESULT(yes)
1615         elif test x"$enable_gdata_plugin" = xauto; then
1616                 AC_MSG_RESULT(no)
1617                 AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
1618                 enable_gdata_plugin=no
1619                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
1620         else
1621                 AC_MSG_RESULT(no)
1622                 AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
1623         fi
1624 else
1625         DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
1626         AC_MSG_RESULT(no)
1629 AC_MSG_CHECKING([whether to build libravatar plugin])
1630 if test x"$enable_libravatar_plugin" != xno; then
1631         dependencies_missing=""
1633         if test x"$HAVE_CURL" = xno; then
1634                 dependencies_missing="libcurl $dependencies_missing"
1635         fi
1637         if test x"$dependencies_missing" = x; then
1638                 PLUGINS="$PLUGINS libravatar"
1639                 AC_MSG_RESULT(yes)
1640         elif test x"$enable_libravatar_plugin" = xauto; then
1641                 AC_MSG_RESULT(no)
1642                 AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
1643                 enable_libravatar_plugin=no
1644                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
1645         else
1646                 AC_MSG_RESULT(no)
1647                 AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
1648         fi
1649 else
1650         DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
1651         AC_MSG_RESULT(no)
1654 AC_MSG_CHECKING([whether to build litehtml_viewer plugin])
1655 if test x"$enable_litehtml_viewer_plugin" != xno; then
1656         dependencies_missing=""
1658         if test x"$HAVE_CXX" = xno; then
1659                 dependencies_missing="C++ compiler $dependencies_missing"
1660         fi
1661         PKG_CHECK_EXISTS([glib-2.0 >= 2.36], [],
1662                 [dependencies_missing="glib-2.0 >= 2.36 $dependencies_missing"])
1663         if test x"$HAVE_CAIRO" = xno; then
1664                 dependencies_missing="cairo $dependencies_missing"
1665         fi
1666         if test x"$HAVE_FONTCONFIG" = xno; then
1667                 dependencies_missing="fontconfig $dependencies_missing"
1668         fi
1669         if test x"$HAVE_LIBGUMBO" = xno; then
1670                 dependencies_missing="libgumbo $dependencies_missing"
1671         fi
1672         if test x"$HAVE_CURL" = xno; then
1673                 dependencies_missing="libcurl $dependencies_missing"
1674         fi
1677         if test x"$dependencies_missing" = x; then
1678                 PLUGINS="$PLUGINS litehtml_viewer"
1679                 AC_MSG_RESULT(yes)
1680         elif test x"$enable_litehtml_viewer_plugin" = xauto; then
1681                 AC_MSG_RESULT(no)
1682                 AC_MSG_WARN("Plugin litehtml_viewer will not be built; missing $dependencies_missing")
1683                 enable_litehtml_viewer_plugin=no
1684                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS litehtml_viewer"
1685         else
1686                 AC_MSG_RESULT(no)
1687                 AC_MSG_ERROR("Plugin litehtml_viewer cannot be built; missing $dependencies_missing")
1688         fi
1689 else
1690         DISABLED_PLUGINS="$DISABLED_PLUGINS litehtml_viewer"
1691         AC_MSG_RESULT(no)
1694 AC_MSG_CHECKING([whether to build mailmbox plugin])
1695 if test x"$enable_mailmbox_plugin" != xno; then
1696         PLUGINS="$PLUGINS mailmbox"
1697         AC_MSG_RESULT(yes)
1698 else
1699         DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
1700         AC_MSG_RESULT(no)
1703 AC_MSG_CHECKING([whether to build managesieve plugin])
1704 if test x"$enable_managesieve_plugin" != xno; then
1705         PLUGINS="$PLUGINS managesieve"
1706         AC_MSG_RESULT(yes)
1707 else
1708         DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
1709         AC_MSG_RESULT(no)
1712 AC_MSG_CHECKING([whether to build newmail plugin])
1713 if test x"$enable_newmail_plugin" != xno; then
1714         PLUGINS="$PLUGINS newmail"
1715         AC_MSG_RESULT(yes)
1716 else
1717         DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
1718         AC_MSG_RESULT(no)
1721 AC_MSG_CHECKING([whether to build notification plugin])
1722 if test x"$enable_notification_plugin" != xno; then
1723         PLUGINS="$PLUGINS notification"
1724         AC_MSG_RESULT(yes)
1726         AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
1727         AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
1728         AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
1729         AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
1730         if test x"$platform_win32" = xno; then
1731                 AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
1732         fi
1734         notification_features="banner command"
1735         notification_missing_dependencies=""
1736         if test x"$HAVE_HOTKEYS" = xyes; then
1737                 notification_features="$notification_features hotkeys"
1738         else
1739                 notification_missing_dependencies="$notification_missing_dependencies hotkeys"
1740         fi
1741         notification_features="$notification_features lcdproc"
1742         if test x"$HAVE_UNITY" = xyes; then
1743                 notification_features="$notification_features unity/messaging-menu"
1744         else
1745                 notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
1746         fi
1747         if test x"$HAVE_LIBNOTIFY" = xyes; then
1748                 notification_features="$notification_features libnotify"
1749         else
1750                 notification_missing_dependencies="$notification_missing_dependencies libnotify"
1751         fi
1752         if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1753                 notification_features="$notification_features libcanberra-gtk"
1754         else
1755                 notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk"
1756         fi
1757         notification_features="$notification_features popup trayicon"
1758 else
1759         DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
1760         AC_MSG_RESULT(no)
1763 AC_MSG_CHECKING([whether to build pdf_viewer plugin])
1764 if test x"$enable_pdf_viewer_plugin" != xno; then
1765         dependencies_missing=""
1767         if test x"$HAVE_POPPLER" = xno; then
1768                 dependencies_missing="libpoppler-glib $dependencies_missing"
1769         fi
1771         if test x"$dependencies_missing" = x; then
1772                 PLUGINS="$PLUGINS pdf_viewer"
1773                 AC_MSG_RESULT(yes)
1774         elif test x"$enable_pdf_viewer_plugin" = xauto; then
1775                 AC_MSG_RESULT(no)
1776                 AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
1777                 enable_pdf_viewer_plugin=no
1778                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
1779         else
1780                 AC_MSG_RESULT(no)
1781                 AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
1782         fi
1783 else
1784         DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
1785         AC_MSG_RESULT(no)
1788 AC_MSG_CHECKING([whether to build perl plugin])
1789 if test x"$enable_perl_plugin" != xno; then
1790         dependencies_missing=""
1792         if test x"$HAVE_LIBPERL" = xno; then
1793                 dependencies_missing="libperl $dependencies_missing"
1794         fi
1796         if test x"$dependencies_missing" = x; then
1797                 PLUGINS="$PLUGINS perl"
1798                 AC_MSG_RESULT(yes)
1799         elif test x"$enable_perl_plugin" = xauto; then
1800                 AC_MSG_RESULT(no)
1801                 AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
1802                 enable_perl_plugin=no
1803                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
1804         else
1805                 AC_MSG_RESULT(no)
1806                 AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
1807         fi
1808 else
1809         DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
1810         AC_MSG_RESULT(no)
1813 AC_MSG_CHECKING([whether to build python plugin])
1814 if test x"$enable_python_plugin" != xno; then
1815         dependencies_missing=""
1817         if test x"$HAVE_PYTHON" = xno; then
1818                 dependencies_missing="$missing_python $dependencies_missing"
1819         fi
1821         if test x"$dependencies_missing" = x; then
1822                 PLUGINS="$PLUGINS python"
1823                 AC_MSG_RESULT(yes)
1824         elif test x"$enable_python_plugin" = xauto; then
1825                 AC_MSG_RESULT(no)
1826                 AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
1827                 enable_python_plugin=no
1828                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
1829         else
1830                 AC_MSG_RESULT(no)
1831                 AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
1832         fi
1833 else
1834         DISABLED_PLUGINS="$DISABLED_PLUGINS python"
1835         AC_MSG_RESULT(no)
1838 AC_MSG_CHECKING([whether to build pgpcore plugin])
1839 if test x"$enable_pgpcore_plugin" != xno; then
1840         dependencies_missing=""
1842         if test x"$HAVE_GPGME" = xno; then
1843                 dependencies_missing="libgpgme $dependencies_missing"
1844         fi
1846         if test x"$dependencies_missing" = x; then
1847                 PLUGINS="$PLUGINS pgpcore"
1848                 AC_MSG_RESULT(yes)
1849         elif test x"$enable_pgpcore_plugin" = xauto; then
1850                 AC_MSG_RESULT(no)
1851                 AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
1852                 enable_pgpcore_plugin=no
1853                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
1854         else
1855                 AC_MSG_RESULT(no)
1856                 AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
1857         fi
1858 else
1859         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
1860         AC_MSG_RESULT(no)
1863 AC_MSG_CHECKING([whether to build pgpmime plugin])
1864 if test x"$enable_pgpmime_plugin" != xno; then
1865         dependencies_missing=""
1867         if test x"$HAVE_GPGME" = xno; then
1868                 dependencies_missing="libgpgme $dependencies_missing"
1869         fi
1870         if test x"$enable_pgpcore_plugin" = xno; then
1871                 dependencies_missing="pgpcore plugin $dependencies_missing"
1872         fi
1874         if test x"$dependencies_missing" = x; then
1875                 PLUGINS="$PLUGINS pgpmime"
1876                 AC_MSG_RESULT(yes)
1877         elif test x"$enable_pgpmime_plugin" = xauto; then
1878                 AC_MSG_RESULT(no)
1879                 AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
1880                 enable_pgpmime_plugin=no
1881                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
1882         else
1883                 AC_MSG_RESULT(no)
1884                 AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
1885         fi
1886 else
1887         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
1888         AC_MSG_RESULT(no)
1891 AC_MSG_CHECKING([whether to build pgpinline plugin])
1892 if test x"$enable_pgpinline_plugin" != xno; then
1893         dependencies_missing=""
1895         if test x"$HAVE_GPGME" = xno; then
1896                 dependencies_missing="libgpgme $dependencies_missing"
1897         fi
1898         if test x"$enable_pgpcore_plugin" = xno; then
1899                 dependencies_missing="pgpcore plugin $dependencies_missing"
1900         fi
1902         if test x"$dependencies_missing" = x; then
1903                 PLUGINS="$PLUGINS pgpinline"
1904                 AC_MSG_RESULT(yes)
1905         elif test x"$enable_pgpinline_plugin" = xauto; then
1906                 AC_MSG_RESULT(no)
1907                 AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
1908                 enable_pgpinline_plugin=no
1909                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
1910         else
1911                 AC_MSG_RESULT(no)
1912                 AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
1913         fi
1914 else
1915         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
1916         AC_MSG_RESULT(no)
1919 AC_MSG_CHECKING([whether to build rssyl plugin])
1920 if test x"$enable_rssyl_plugin" != xno; then
1921         dependencies_missing=""
1923         if test x"$HAVE_EXPAT" = xno; then
1924                 dependencies_missing="expat $dependencies_missing"
1925         fi
1926         if test x"$HAVE_CURL" = xno; then
1927                 dependencies_missing="libcurl $dependencies_missing"
1928         fi
1930         if test x"$dependencies_missing" = x; then
1931                 PLUGINS="$PLUGINS rssyl"
1932                 AC_MSG_RESULT(yes)
1933         elif test x"$enable_rssyl_plugin" = xauto; then
1934                 AC_MSG_RESULT(no)
1935                 AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
1936                 enable_rssyl_plugin=no
1937                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
1938         else
1939                 AC_MSG_RESULT(no)
1940                 AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
1941         fi
1942 else
1943         DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
1944         AC_MSG_RESULT(no)
1947 AC_MSG_CHECKING([whether to build spamassassin plugin])
1948 if test x"$enable_spamassassin_plugin" != xno; then
1949         PLUGINS="$PLUGINS spamassassin"
1950         AC_MSG_RESULT(yes)
1951         AC_SPAMASSASSIN
1953         dnl check for zlib (optional)
1954         spamassassin_zlib=0
1955         SPAMASSASSIN_CFLAGS=""
1956         SPAMASSASSIN_LIBS=""
1957         AC_CHECK_HEADER([zlib.h],
1958                         [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
1959                         [spamassassin_zlib=1],
1960                         [spamassassin_zlib=0])
1961         if test $spamassassin_zlib -eq 1; then
1962                 AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
1963                 AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
1964                 if test $spamassassin_zlib -eq 1; then
1965                         AC_MSG_RESULT(yes)
1966                         SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
1967                         SPAMASSASSIN_LIBS="-lz"
1968                 else
1969                         AC_MSG_RESULT(no)
1970                 fi
1971         fi
1972         AC_SUBST(SPAMASSASSIN_CFLAGS)
1973         AC_SUBST(SPAMASSASSIN_LIBS)
1974 else
1975         DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
1976         AC_MSG_RESULT(no)
1979 AC_MSG_CHECKING([whether to build smime plugin])
1980 if test x"$enable_smime_plugin" != xno; then
1981         dependencies_missing=""
1983         if test x"$HAVE_GPGME" = xno; then
1984                 dependencies_missing="libgpgme $dependencies_missing"
1985         fi
1986         if test x"$enable_pgpcore_plugin" = xno; then
1987                 dependencies_missing="pgpcore plugin $dependencies_missing"
1988         fi
1990         if test x"$dependencies_missing" = x; then
1991                 PLUGINS="$PLUGINS smime"
1992                 AC_MSG_RESULT(yes)
1993         elif test x"$enable_smime_plugin" = xauto; then
1994                 AC_MSG_RESULT(no)
1995                 AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
1996                 enable_smime_plugin=no
1997                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
1998         else
1999                 AC_MSG_RESULT(no)
2000                 AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
2001         fi
2002 else
2003         DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
2004         AC_MSG_RESULT(no)
2007 AC_MSG_CHECKING([whether to build spam_report plugin])
2008 if test x"$enable_spam_report_plugin" != xno; then
2009         dependencies_missing=""
2011         if test x"$HAVE_CURL" = xno; then
2012                 dependencies_missing="libcurl $dependencies_missing"
2013         fi
2015         if test x"$dependencies_missing" = x; then
2016                 PLUGINS="$PLUGINS spam_report"
2017                 AC_MSG_RESULT(yes)
2018         elif test x"$enable_spam_report_plugin" = xauto; then
2019                 AC_MSG_RESULT(no)
2020                 AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
2021                 enable_spam_report_plugin=no
2022                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
2023         else
2024                 AC_MSG_RESULT(no)
2025                 AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
2026         fi
2027 else
2028         DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
2029         AC_MSG_RESULT(no)
2032 AC_MSG_CHECKING([whether to build tnef_parse plugin])
2033 if test x"$enable_tnef_parse_plugin" != xno; then
2034         dependencies_missing=""
2036         if test $have_ytnef -eq 0; then
2037                 dependencies_missing="libytnef"
2038         fi
2040         if test x"$dependencies_missing" = x; then
2041                 PLUGINS="$PLUGINS tnef_parse"
2042                 AC_MSG_RESULT(yes)
2043         elif test x"$enable_tnef_parse_plugin" = xauto; then
2044                 AC_MSG_RESULT(no)
2045                 AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
2046                 enable_tnef_parse_plugin=no
2047                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
2048         else
2049                 AC_MSG_RESULT(no)
2050                 AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
2051         fi
2052 else
2053         DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
2054         AC_MSG_RESULT(no)
2058 AC_MSG_CHECKING([whether to build vcalendar plugin])
2059 if test x"$enable_vcalendar_plugin" != xno; then
2060         dependencies_missing=""
2062         if test x"$HAVE_CURL" = xno; then
2063                 dependencies_missing="libcurl $dependencies_missing"
2064         fi
2066   if test x"$HAVE_LIBICAL" = xno; then
2067     dependencies_missing="libical $dependencies_missing"
2068   fi
2070         if test x"$HAVE_PERL" = xno; then
2071                 dependencies_missing="perl $dependencies_missing"
2072         fi
2074         if test x"$dependencies_missing" = x; then
2075                 PLUGINS="$PLUGINS vcalendar"
2076                 AC_MSG_RESULT(yes)
2077         elif test x"$enable_vcalendar_plugin" = xauto; then
2078                 AC_MSG_RESULT(no)
2079                 AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
2080                 enable_vcalendar_plugin=no
2081                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
2082         else
2083                 AC_MSG_RESULT(no)
2084                 AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
2085         fi
2086 else
2087         DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
2088         AC_MSG_RESULT(no)
2091 dnl And finally the automake conditionals.
2093 AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN,      test x"$enable_acpi_notifier_plugin" != xno)
2094 AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN,     test x"$enable_address_keeper_plugin" != xno)
2095 AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN,            test x"$enable_archive_plugin" != xno)
2096 AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN,        test x"$enable_att_remover_plugin" != xno)
2097 AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN,       test x"$enable_attachwarner_plugin" != xno)
2098 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN,         test x"$enable_bogofilter_plugin" != xno)
2099 AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,           test x"$enable_bsfilter_plugin" != xno)
2100 AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,              test x"$enable_clamd_plugin" != xno)
2101 AM_CONDITIONAL(BUILD_DEMO_PLUGIN,               test x"$enable_demo_plugin" != xno)
2102 AM_CONDITIONAL(BUILD_DILLO_PLUGIN,              test x"$enable_dillo_plugin" != xno)
2103 AM_CONDITIONAL(BUILD_FANCY_PLUGIN,              test x"$enable_fancy_plugin" != xno)
2104 AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,          test x"$enable_fetchinfo_plugin" != xno)
2105 AM_CONDITIONAL(BUILD_GDATA_PLUGIN,              test x"$enable_gdata_plugin" != xno)
2106 AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN,         test x"$enable_libravatar_plugin" != xno)
2107 AM_CONDITIONAL(BUILD_LITEHTML_VIEWER_PLUGIN,    test x"$enable_litehtml_viewer_plugin" != xno)
2108 AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN,           test x"$enable_mailmbox_plugin" != xno)
2109 AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN,        test x"$enable_managesieve_plugin" != xno)
2110 AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN,            test x"$enable_newmail_plugin" != xno)
2111 AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN,       test x"$enable_notification_plugin" != xno)
2112 AM_CONDITIONAL(BUILD_HOTKEYS,                   test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
2113 AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN,         test x"$enable_pdf_viewer_plugin" != xno)
2114 AM_CONDITIONAL(BUILD_PERL_PLUGIN,               test x"$enable_perl_plugin" != xno)
2115 AM_CONDITIONAL(BUILD_PYTHON_PLUGIN,             test x"$enable_python_plugin" != xno)
2116 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN,            test x"$enable_pgpcore_plugin" != xno)
2117 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN,            test x"$enable_pgpmime_plugin" != xno)
2118 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN,          test x"$enable_pgpinline_plugin" != xno)
2119 AM_CONDITIONAL(BUILD_RSSYL_PLUGIN,              test x"$enable_rssyl_plugin" != xno)
2120 AM_CONDITIONAL(BUILD_SMIME_PLUGIN,              test x"$enable_smime_plugin" != xno)
2121 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN,       test x"$enable_spamassassin_plugin" != xno)
2122 AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN,        test x"$enable_spam_report_plugin" != xno)
2123 AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN,         test x"$enable_tnef_parse_plugin" != xno)
2124 AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN,          test x"$enable_vcalendar_plugin" != xno)
2127 dnl ****************************
2128 dnl ** Final configure output **
2129 dnl ****************************
2131 AC_OUTPUT([
2132 Makefile
2133 m4/Makefile
2134 po/Makefile.in
2135 src/common/version.h
2136 src/Makefile
2137 src/w32-resource.rc
2138 src/common/Makefile
2139 src/common/passcrypt.h
2140 src/common/tests/Makefile
2141 src/gtk/Makefile
2142 src/etpan/Makefile
2143 src/plugins/Makefile
2144 src/plugins/acpi_notifier/Makefile
2145 src/plugins/address_keeper/Makefile
2146 src/plugins/address_keeper/version.rc
2147 src/plugins/archive/Makefile
2148 src/plugins/att_remover/Makefile
2149 src/plugins/att_remover/version.rc
2150 src/plugins/attachwarner/Makefile
2151 src/plugins/attachwarner/version.rc
2152 src/plugins/bogofilter/Makefile
2153 src/plugins/bsfilter/Makefile
2154 src/plugins/bsfilter/version.rc
2155 src/plugins/clamd/Makefile
2156 src/plugins/clamd/libclamd/Makefile
2157 src/plugins/demo/Makefile
2158 src/plugins/dillo/Makefile
2159 src/plugins/fancy/Makefile
2160 src/plugins/fancy/version.rc
2161 src/plugins/fetchinfo/Makefile
2162 src/plugins/fetchinfo/version.rc
2163 src/plugins/gdata/Makefile
2164 src/plugins/litehtml_viewer/Makefile
2165 src/plugins/litehtml_viewer/version.rc
2166 src/plugins/litehtml_viewer/litehtml/Makefile
2167 src/plugins/libravatar/Makefile
2168 src/plugins/libravatar/version.rc
2169 src/plugins/mailmbox/Makefile
2170 src/plugins/mailmbox/version.rc
2171 src/plugins/managesieve/Makefile
2172 src/plugins/managesieve/version.rc
2173 src/plugins/newmail/Makefile
2174 src/plugins/notification/Makefile
2175 src/plugins/notification/version.rc
2176 src/plugins/notification/gtkhotkey/Makefile
2177 src/plugins/pdf_viewer/Makefile
2178 src/plugins/pdf_viewer/version.rc
2179 src/plugins/perl/Makefile
2180 src/plugins/perl/tools/Makefile
2181 src/plugins/python/Makefile
2182 src/plugins/python/examples/Makefile
2183 src/plugins/pgpcore/Makefile
2184 src/plugins/pgpcore/version.rc
2185 src/plugins/pgpcore/tests/Makefile
2186 src/plugins/pgpmime/Makefile
2187 src/plugins/pgpmime/version.rc
2188 src/plugins/pgpinline/Makefile
2189 src/plugins/pgpinline/version.rc
2190 src/plugins/rssyl/Makefile
2191 src/plugins/rssyl/version.rc
2192 src/plugins/rssyl/tests/Makefile
2193 src/plugins/rssyl/libfeed/Makefile
2194 src/plugins/rssyl/libfeed/tests/Makefile
2195 src/plugins/smime/Makefile
2196 src/plugins/smime/version.rc
2197 src/plugins/spamassassin/Makefile
2198 src/plugins/spam_report/Makefile
2199 src/plugins/spam_report/version.rc
2200 src/plugins/tnef_parse/Makefile
2201 src/plugins/tnef_parse/version.rc
2202 src/plugins/vcalendar/Makefile
2203 src/plugins/vcalendar/version.rc
2204 src/tests/Makefile
2205 doc/Makefile
2206 doc/man/Makefile
2207 tools/Makefile
2208 config/Makefile
2209 manual/Makefile
2210 manual/dtd/Makefile
2211 manual/dist/Makefile
2212 manual/dist/pdf/Makefile
2213 manual/dist/ps/Makefile
2214 manual/dist/html/Makefile
2215 manual/dist/txt/Makefile
2216 manual/fr/Makefile
2217 manual/fr/dist/Makefile
2218 manual/fr/dist/pdf/Makefile
2219 manual/fr/dist/ps/Makefile
2220 manual/fr/dist/html/Makefile
2221 manual/fr/dist/txt/Makefile
2222 manual/es/Makefile
2223 manual/es/dist/Makefile
2224 manual/es/dist/pdf/Makefile
2225 manual/es/dist/ps/Makefile
2226 manual/es/dist/html/Makefile
2227 manual/es/dist/txt/Makefile
2228 claws-mail.pc
2231 dnl Output the configuration summary
2232 echo ""
2233 echo "$PACKAGE $VERSION"
2234 echo ""
2235 if test x"$enable_alternate_addressbook" = xyes; then
2236         echo "Using Address Book : Alternate experimental interface"
2237 else
2238         echo "Using Address Book : Original stable interface"
2239         echo "JPilot             : $enable_jpilot"
2240         echo "LDAP               : $enable_ldap"
2242 echo "gnuTLS             : $enable_gnutls"
2243 echo "iconv              : $am_cv_func_iconv"
2244 echo "compface           : $enable_compface"
2245 echo "IPv6               : $enable_ipv6"
2246 echo "enchant            : $enable_enchant"
2247 echo "IMAP4              : $enable_libetpan"
2248 echo "NNTP               : $enable_libetpan"
2249 echo "Crash dialog       : $enable_crash_dialog"
2250 echo "LibSM              : $enable_libsm"
2251 echo "DBUS               : $enable_dbus"
2252 echo "NetworkManager     : $enable_networkmanager"
2253 echo "Manual             : $enable_manual"
2254 echo "Generic UMPC code  : $enable_generic_umpc"
2255 echo "SVG support        : $enable_svg"
2256 echo "Config dir         : $ac_cv_with_config_dir"
2257 echo "Password crypto    : $pwd_crypto"
2258 echo "Unit tests         : $enable_tests"
2260 echo "Plugins"
2261 echo "   Built:"
2262 for plugin in $PLUGINS; do
2263 echo "            - $plugin"
2264 if test x"$plugin" = xnotification; then
2265         echo "                Features:"
2266         for notif_feature in $notification_features; do
2267                 echo "                    $notif_feature"
2268         done;
2269         if test "x$notification_missing_dependencies" != x; then
2270                 echo "                Disabled due to missing dependencies:"
2271                 for notif_miss_dep in $notification_missing_dependencies; do
2272                         echo "                    $notif_miss_dep"
2273                 done;
2274         fi
2276 done;
2277 if test "x$DISABLED_PLUGINS" != x; then
2278 echo "   Disabled:"
2279 for plugin in $DISABLED_PLUGINS; do
2280 echo "            - $plugin"
2281 done;
2284 if test "x$MISSING_DEPS_PLUGINS" != x; then
2285 echo "   Disabled due to missing dependencies:"
2286 for plugin in $MISSING_DEPS_PLUGINS; do
2287 echo "            - $plugin"
2288 done;
2290 echo ""
2291 echo "The binary will be installed in $prefix/bin"
2292 echo ""
2293 echo "Configure finished, type 'make' to build."