fix bug 4547, '--enable-tests makes compilation fail'
[claws.git] / configure.ac
blobe7eba44de33c0ef624639e58f669fad847479594
2 AC_PREREQ([2.69])
3 AC_INIT
4 AC_CONFIG_SRCDIR([src/main.c])
5 AC_CONFIG_AUX_DIR(config)
6 AC_CONFIG_MACRO_DIR([m4])
8 PACKAGE=claws-mail
10 dnl version number
11 INTERFACE_AGE=0
12 BINARY_AGE=0
13 EXTRA_RELEASE=
14 EXTRA_GTK3_VERSION=
16 if test \( -d .git \); then
17     AC_CHECK_PROG([GIT], [git], [yes], [no], [$PATH])
18     if test \( "$GIT" = "no" \); then
19         AC_MSG_ERROR([*** git not found. See http://git-scm.com/])
20     else
21         GIT_VERSION=`git describe --abbrev=6 --dirty --always`
22         echo "echo ${GIT_VERSION}" > ./version
23     fi
24 else
25     GIT_VERSION=`sh -c ". $srcdir/version"`
28 if test \( -z "$GIT_VERSION" \); then
29         AC_MSG_ERROR([*** could not determine program version])
32 MAJOR_VERSION=${GIT_VERSION%%.*}
33 MINOR_VERSION=${GIT_VERSION#*.}
34 MINOR_VERSION=${MINOR_VERSION%%.*}
35 MICRO_VERSION=${GIT_VERSION##*.}
36 MICRO_VERSION=${MICRO_VERSION%%-*}
37 EXTRA_VERSION=${GIT_VERSION#*-}
38 EXTRA_VERSION=${EXTRA_VERSION%%-*}
40 if test \( "x$EXTRA_VERSION" != "x" -a `echo -n $EXTRA_VERSION | wc -c` -lt 5 \); then
41     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}git${EXTRA_VERSION}
42 else
43     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
44     EXTRA_VERSION=0
47 if test \( "x$EXTRA_RELEASE" != "x" \); then
48     VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK3_VERSION}
51 dnl set $target
52 AC_CANONICAL_TARGET
54 dnl
55 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
56 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
57 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
58 AC_SUBST(PACKAGE)
59 AC_SUBST(VERSION)
60 AC_SUBST(MAJOR_VERSION)
61 AC_SUBST(MINOR_VERSION)
62 AC_SUBST(MICRO_VERSION)
63 AC_SUBST(EXTRA_VERSION)
64 AC_SUBST(GIT_VERSION)
66 AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
67 AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
69 dnl Require pkg-config
70 m4_ifndef([PKG_PROG_PKG_CONFIG],
71     [m4_fatal([Could not locate the pkg-config autoconf macros. These
72 are usually located in /usr/share/aclocal/pkg.m4. If your macros
73 are in a different location, try setting the environment variable
74 ACLOCAL_FLAGS before running ./autogen.sh or autoreconf again. E.g.:
75 export ACLOCAL_FLAGS="-I/other/macro/dir"])
77 PKG_PROG_PKG_CONFIG
79 dnl libtool versioning
80 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
81 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
82 LT_REVISION=$INTERFACE_AGE
83 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
84 AC_SUBST(LT_RELEASE)
85 AC_SUBST(LT_CURRENT)
86 AC_SUBST(LT_REVISION)
87 AC_SUBST(LT_AGE)
89 dnl Specify a header configuration file
90 AC_CONFIG_HEADERS(config.h)
91 AC_CONFIG_HEADERS(claws-features.h)
93 AM_MAINTAINER_MODE
94 AC_USE_SYSTEM_EXTENSIONS
96 dnl Checks for programs.
97 dnl AC_ARG_PROGRAM
98 AC_PROG_CC
99 AC_SEARCH_LIBS([strerror],[cposix])
100 AC_PROG_INSTALL
101 AC_PROG_LN_S
102 AC_PROG_MAKE_SET
103 AC_PROG_CPP
104 dnl AC_PROG_RANLIB
105 AC_PROG_LEX(noyywrap)
106 AC_PROG_YACC
107 AC_LIB_PREFIX
108 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
109 [AC_REQUIRE(AC_CANONICAL_HOST)_LT_SET_OPTION([LT_INIT],[win32-dll])
110 m4_warn([obsolete],[AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
111 put the 'win32-dll' option into LT_INIT's first parameter.])
114 LT_INIT
115 LT_PROG_RC
116 LT_LANG([Windows Resource])
117 LT_INIT
118 AC_PROG_AWK
120 dnl AC_PROG_CXX will set CXX=g++ even if it finds no useable C++
121 dnl compiler, so we have to check whether the program named by
122 dnl CXX exists.
123 AC_PROG_CXX
124 AC_PATH_PROG(REAL_CXX, $CXX)
125 HAVE_CXX=no
126 if test -n "$REAL_CXX"; then
127         HAVE_CXX=yes
130 AC_SYS_LARGEFILE
132 dnl ******************************
133 dnl Checks for host
134 dnl Not needed anymore because we
135 dnl do AC_CANONICAL_TARGET above
136 dnl ******************************
137 dnl AC_CANONICAL_HOST
139 dnl Copied from the official gtk+-2 configure.in
140 AC_MSG_CHECKING([for host platform])
141 case "$host" in
142   *-*-mingw*|*-*-cygwin*)
143     platform_win32=yes
144     LDFLAGS="$LDFLAGS -mwindows -Wl,--export-all-symbols"
145     ;;
146         *-apple-*)
147                 platform_osx=yes
148                 LDFLAGS="$LDFLAGS -Wl,-export_dynamic"
149                 ;;
150   *)
151     platform_win32=no
152                 platform_osx=no
153                 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
154     ;;
155 esac
156 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
157 AM_CONDITIONAL(PLATFORM_OSX, test x"$platform_osx" = x"yes")
158 AC_MSG_RESULT([$host])
160 AC_MSG_CHECKING([for native Win32])
161 case "$host" in
162   *-*-mingw*)
163     os_win32=yes
164     ;;
165   *)
166     os_win32=no
167     ;;
168 esac
169 AC_MSG_RESULT([$os_win32])
170 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
172 AC_MSG_CHECKING([for Cygwin])
173 case "$host" in
174   *-*-cygwin*)
175     env_cygwin=yes
176     ;;
177   *)
178     env_cygwin=no
179     ;;
180 esac
181 AC_MSG_RESULT([$env_cygwin])
182 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
184 AC_MSG_CHECKING([for time_t format specifier])
185 _gcc_cflags_save=$CFLAGS
186 CFLAGS="-Wformat -Werror"
187 AC_COMPILE_IFELSE([
188         AC_LANG_PROGRAM([[
189                 #include <stdio.h>
190                 #include <time.h>
191                 ]],[[printf("%lld", time(NULL));]])],
192         [time_t_long_long=yes],
193         [time_t_long_long=no])
194 CFLAGS=$_gcc_cflags_save
196 if test x"$time_t_long_long" = xyes; then
197         time_t_fmt=lld
198 else
199         time_t_fmt=ld
201 AC_MSG_RESULT([$time_t_fmt])
202 AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"],
203         [Define printf format specifier for time_t])
205 AM_CFLAGS="-Wall"
206 if test $USE_MAINTAINER_MODE = yes; then
207         AM_CFLAGS="$AM_CFLAGS -g"
210 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
211 _gcc_cflags_save=$CFLAGS
212 CFLAGS="-Wno-pointer-sign"
213 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
214 AC_MSG_RESULT($_gcc_psign)
215 CFLAGS=$_gcc_cflags_save;
216 if test x"$_gcc_psign" = xyes ; then
217         AM_CFLAGS="$AM_CFLAGS -Wno-pointer-sign"
220 pthread_name=
221 case "$target" in
222 *-darwin*)
223         AM_CFLAGS="$AM_CFLAGS -no-cpp-precomp -fno-common"
224         ;;
225 *-*-mingw*)
226         # Note that we need to link to pthread in all cases. This
227         # is because some locking is used even when pthread support is
228         # disabled.
229         pthread_name=pthread
230         AM_CFLAGS="$AM_CFLAGS -mms-bitfields"
231         LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
232         ;;
233 *-*-solaris*)
234         AM_CFLAGS="$AM_CFLAGS -std=gnu99"
235         AC_DEFINE([SOLARIS], [], [Target is Solaris])
236         ;;
237 esac
239 AC_SUBST(AM_CFLAGS)
241 dnl Checks for iconv
242 AM_ICONV
244 dnl floor and ceil are  in -lm
245 LIBS="$LIBS -lm"
248 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
250 syl_save_LIBS=$LIBS
251 LIBS="$LIBS $GTK_LIBS"
252 AC_CHECK_FUNCS(bind_textdomain_codeset)
253 LIBS=$syl_save_LIBS
255 dnl for gettext
256 ALL_LINGUAS="ca cs da de el_GR en_GB es fi fr hu id_ID it ja nb nl pl pt_BR ro ru sk sv tr zh_TW"
257 GETTEXT_PACKAGE=claws-mail
258 AC_SUBST(GETTEXT_PACKAGE)
259 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
261 AM_GNU_GETTEXT_VERSION([0.18])
262 AM_GNU_GETTEXT([external])
264 AC_ARG_ENABLE(manual,
265                 [  --disable-manual                Do not build user manual],
266                 [enable_manual=$enableval], [enable_manual=yes])
268 AC_ARG_ENABLE(libsm,
269                 [  --disable-libsm                 Do not build libSM support for session management],
270                 [enable_libsm=$enableval], [enable_libsm=yes])
272 AC_ARG_ENABLE(ipv6,
273                 [  --disable-ipv6                  Do not build IPv6 support],
274                 [enable_ipv6=$enableval], [enable_ipv6=yes])
276 AC_ARG_ENABLE(gnutls,
277                 [  --disable-gnutls                Do not build GnuTLS support for TLS],
278                     [enable_gnutls=$enableval], [enable_gnutls=yes])
280 AC_ARG_ENABLE(enchant,
281                 [  --disable-enchant               Do not build Enchant support for spell-checking],
282                 [enable_enchant=$enableval], [enable_enchant=yes])
284 AC_ARG_ENABLE(crash-dialog,
285                 [  --enable-crash-dialog           Build crash dialog],
286                 [enable_crash_dialog=$enableval], [enable_crash_dialog=no])
288 AC_ARG_ENABLE(generic-umpc,
289                 [  --enable-generic-umpc           Build generic UMPC code],
290                 [enable_generic_umpc=$enableval], [enable_generic_umpc=no])
292 AC_ARG_ENABLE(compface,
293                 [  --disable-compface              Do not build compface support for X-Face],
294                 [enable_compface=$enableval], [enable_compface=yes])
296 AC_ARG_ENABLE(pthread,
297                 [  --disable-pthread               Do not build pthread support],
298                 [enable_pthread=$enableval], [enable_pthread=yes])
300 AC_ARG_ENABLE(startup-notification,
301                 [  --disable-startup-notification  Do not startup notification support],
302                 [enable_startup_notification=$enableval], [enable_startup_notification=yes])
304 AC_ARG_ENABLE(dbus,
305                 [  --disable-dbus                  Do not build DBUS support],
306                 [enable_dbus=$enableval], [enable_dbus=yes])
308 AC_ARG_ENABLE(ldap,
309                 [  --disable-ldap                  Do not build LDAP support],
310                 [enable_ldap=$enableval], [enable_ldap=yes])
312 AC_ARG_ENABLE(jpilot,
313                 [  --disable-jpilot                Do not build JPilot support],
314                 [enable_jpilot=$enableval], [enable_jpilot=yes])
316 AC_ARG_ENABLE(networkmanager,
317                 [  --disable-networkmanager        Do not build NetworkManager support],
318                 [enable_networkmanager=$enableval], [enable_networkmanager=yes])
320 AC_ARG_ENABLE(libetpan,
321                 [  --disable-libetpan              Do not build libetpan support for IMAP4/NNTP],
322                 [enable_libetpan=$enableval], [enable_libetpan=yes])
324 AC_ARG_ENABLE(valgrind,
325                 [  --disable-valgrind              Do not build valgrind support for debugging],
326                 [enable_valgrind=$enableval], [enable_valgrind=yes])
328 AC_ARG_ENABLE(alternate-addressbook,
329                 [  --enable-alternate-addressbook  Build alternate external address book support],
330                 [enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
332 AC_ARG_ENABLE(svg,
333         [  --disable-svg                   Do not build SVG support],
334         [enable_svg=$enableval], [enable_svg=yes])
336 AC_ARG_ENABLE(tests,
337                                 [  --enable-tests                   Build unit tests],
338                                 [enable_tests=$enableval], [enable_tests=no])
340 manualdir='${docdir}/manual'
341 AC_ARG_WITH(manualdir,
342         [  --with-manualdir=DIR    Manual directory],
343         [manualdir="$withval"])
344 AC_SUBST(manualdir)
346 dnl ******************************
347 dnl ** Check for required tools **
348 dnl ** to build manuals         **
349 dnl ******************************
351 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
352 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
353 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
354 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
356 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
357 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
358 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
359 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
361 if test x"$enable_manual" = x"yes"; then
362     if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
363         -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
364             enable_manual=yes
365         else
366             enable_manual=no
367     fi
370 AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
372 dnl Set PACKAGE_DATA_DIR in config.h.
373 if test "x${datarootdir}" = 'x${prefix}/share'; then
374         if test "x${prefix}" = "xNONE"; then
375                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
376         else
377                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
378         fi
379 else
380         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
383 AC_CHECK_LIB(xpg4, setlocale)
385 SM_LIBS=""
386 dnl Check for LibSM
387 AC_MSG_CHECKING([whether to use LibSM])
388 if test x"$enable_libsm" = xyes; then
389         AC_MSG_RESULT(yes)
390         AC_CHECK_LIB(SM, SmcSaveYourselfDone,
391                 [SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
392                 $X_LIBS -lICE)
393         AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
394         if test x"$enable_libsm" = xyes; then
395                 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
396         else
397                 AC_MSG_RESULT(not found)
398                 AC_MSG_WARN([*** LibSM will not be supported ***])
399         fi
400 else
401         AC_MSG_RESULT(no)
403 AC_SUBST(SM_LIBS)
405 dnl Check for __VA_OPT__ macro
406 AC_CACHE_CHECK([for __VA_OPT__],
407         [ac_cv_va_opt],
408         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[#define va_opt_printf(format, ...) fprintf(stderr, format __VA_OPT__(,) __VA_ARGS__)
409                 va_opt_printf("success\n");]])],[ac_cv_va_opt=yes],[ac_cv_va_opt=no])]
411 if test "$ac_cv_va_opt" = yes; then
412         AC_DEFINE([HAVE_VA_OPT], [1], [Define if __VA_OPT__ macro works])
415 dnl Check for d_type member in struct dirent
416 AC_MSG_CHECKING([whether struct dirent has d_type member])
417 AC_CACHE_VAL(ac_cv_dirent_d_type,[
418         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dirent.h>]], [[struct dirent d; d.d_type = DT_REG;]])],[ac_cv_dirent_d_type=yes],[ac_cv_dirent_d_type=no])
420 AC_MSG_RESULT($ac_cv_dirent_d_type)
421 if test $ac_cv_dirent_d_type = yes; then
422         AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
423                   Define if `struct dirent' has `d_type' member.)
426 # Check whether mkdir does not take the permission argument.
427 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
429 dnl Checks for header files.
430 AC_HEADER_DIRENT
432 AC_HEADER_SYS_WAIT
433 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
434                  sys/param.h sys/utsname.h sys/select.h \
435                  wchar.h wctype.h locale.h netdb.h)
436 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
437 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
439 dnl Checks for typedefs, structures, and compiler characteristics.
440 AC_C_CONST
441 AC_TYPE_OFF_T
442 AC_TYPE_PID_T
443 AC_TYPE_SIZE_T
444 AC_STRUCT_TM
446 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
447 AC_CHECK_SIZEOF(unsigned short, 2)
448 AC_CHECK_SIZEOF(unsigned int, 4)
449 AC_CHECK_SIZEOF(unsigned long, 4)
451 dnl Checks for library functions.
452 AC_FUNC_ALLOCA
453 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr strcasestr \
454                uname flock lockf inet_aton inet_addr \
455                fchmod mkstemp truncate getuid regcomp)
457 AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
459 dnl *****************
460 dnl ** common code **
461 dnl *****************
463 dnl check for glib
464 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36 gmodule-2.0 >= 2.36 gobject-2.0 >= 2.36 gthread-2.0 >= 2.36])
466 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
467 AC_SUBST(GLIB_GENMARSHAL)
469 AC_SUBST(GLIB_CFLAGS)
470 AC_SUBST(GLIB_LIBS)
472 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
474 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
475 syl_save_LIBS=$LIBS
476 LIBS="$LIBS $GTK_LIBS"
477 AC_CHECK_FUNCS(bind_textdomain_codeset)
478 LIBS=$syl_save_LIBS
480 dnl check for IPv6 option
481 dnl automated checks for IPv6 support.
482 AC_MSG_CHECKING([whether to use IPv6])
483 if test x"$enable_ipv6" = xyes; then
484         AC_MSG_RESULT(yes)
485         AC_MSG_CHECKING([for IPv6 support])
486         if test x"$platform_win32" = xyes; then
487                 AC_CACHE_VAL(ac_cv_ipv6,[
488                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
489                                         #include <ws2tcpip.h>
490                                 ]], [[struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
491                 ])
492         else
493                 AC_CACHE_VAL(ac_cv_ipv6,[
494                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
495                                         #define INET6
496                                         #include <sys/types.h>
497                                         #include <netinet/in.h>
498                                 ]], [[int x = IPPROTO_IPV6; struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
499                 ])
500         fi
501         AC_MSG_RESULT($ac_cv_ipv6)
502         if test $ac_cv_ipv6 = yes; then
503                 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
504         else
505                 AC_MSG_WARN(*** IPv6 will not be supported ***)
506                 enable_ipv6=no
507         fi
508 else
509         AC_MSG_RESULT(no)
512 dnl GNUTLS
513 AC_MSG_CHECKING([whether to use GnuTLS])
514 AC_MSG_RESULT($enable_gnutls)
515 if test "x$enable_gnutls" != "xno"; then
516         PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
517         [
518                 AC_DEFINE(USE_GNUTLS, 1, gnutls)
519                 echo "Building with GnuTLS"
520                 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
521                 [
522                         dnl No linking against libgcrypt needed
523                 ],
524                 [
525                         dnl linking against libgcrypt *is* needed
526                         GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
527                 ])
528         ],
529         [
530                 echo "Building without GnuTLS"
531                 AC_MSG_RESULT([*** GnuTLS support is recommended ])
532                 AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
533                 AC_MSG_ERROR([GnuTLS not found])
534         ])
535         AC_SUBST(GNUTLS_LIBS)
536         AC_SUBST(GNUTLS_CFLAGS)
539 PKG_CHECK_MODULES(NETTLE, nettle)
540 AC_SUBST(NETTLE_LIBS)
542 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
543             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
544 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
546 dnl RC dir (will be default at a certain point in time)
547 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .claws-mail)],
548               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
550 dnl Set correct default value based on platform
551 if test x"$ac_cv_with_config_dir" = x""; then
552         if test x"$platform_win32" = xyes; then
553                 ac_cv_with_config_dir="Claws-mail"
554         else
555                 ac_cv_with_config_dir=".claws-mail"
556         fi
558 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
560 AC_ARG_WITH(password-encryption, [  --with-password-encryption=PROVIDER    Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
561                                                 pwd_crypto="$withval", pwd_crypto="default")
563 if test x"$pwd_crypto" = xdefault; then
564         if test x"$enable_gnutls" = xyes; then
565                 if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
566                         pwd_crypto="gnutls"
567                 fi
568         fi
570 if test x"$pwd_crypto" = xdefault; then
571         pwd_crypto="old"
574 case $pwd_crypto in
575         gnutls)
576                 if test x"$enable_gnutls" = xno; then
577                         AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
578                 fi
579                 if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
580                         AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
581                 fi
582                 AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
583                 ;;
584         old)
585                 AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
586                 ;;
587         *)
588                 AC_MSG_ERROR([Unknown password encryption provider requested.])
589                 ;;
590 esac
593 dnl ************************
594 dnl ** GTK user interface **
595 dnl ************************
597 dnl Checks for GTK
598 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.20 cairo)
600 AC_ARG_ENABLE(deprecated,
601                 [  --disable-deprecated            Disable deprecated GTK functions],
602                 gtkdeprecated=$enableval)
603 AC_MSG_CHECKING([whether to use deprecated GTK functions])
604 if test x"$gtkdeprecated" != xno; then
605         AC_MSG_RESULT(yes)
606 else
607         GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
608         AC_MSG_RESULT(no)
611 dnl Make sure the code does not regress to using deprecated GTK stuff...
612 GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
614 AC_SUBST(GTK_CFLAGS)
615 AC_SUBST(GTK_LIBS)
617 dnl enchant is used for spell checking
618 AC_MSG_CHECKING([whether to use enchant])
619 AC_MSG_RESULT($enable_enchant)
620 if test $enable_enchant = yes; then
621         PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
622         [
623                 AC_DEFINE(USE_ENCHANT, 1, enchant)
624                 echo "Building with enchant"
625                 enable_enchant=yes
626         ],
627         [
628                 PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
629                 [
630                         AC_DEFINE(USE_ENCHANT, 1, enchant-2)
631                         echo "Building with enchant-2"
632                         enable_enchant=yes
633                 ],
634                 [
635                         echo "Building without enchant-notification"
636                         enable_enchant=no
637                 ])
638         ])
639         AC_SUBST(ENCHANT_CFLAGS)
640         AC_SUBST(ENCHANT_LIBS)
643 dnl want crash dialog
644 if test $enable_crash_dialog = yes; then
645 dnl check if GDB is somewhere
646         AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
647         AC_MSG_CHECKING([whether to use crash dialog])
648         if test $enable_crash_dialog = yes; then
649                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
650         fi
651         AC_MSG_RESULT($enable_crash_dialog)
654 dnl generic umpc
655 if test $enable_generic_umpc = yes; then
656         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
657         AC_MSG_RESULT($enable_generic_umpc)
660 dnl Check for X-Face support
661 AC_MSG_CHECKING([whether to use compface])
662 if test x"$enable_compface" = xyes; then
663         AC_MSG_RESULT(yes)
664         AC_CHECK_LIB(compface, uncompface,
665                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
666                 [enable_compface=no])
667         if test x"$enable_compface" = xyes; then
668                 COMPFACE_LIBS="-lcompface"
669         else
670                 COMPFACE_LIBS=""
671         fi
672         AC_SUBST(COMPFACE_LIBS)
673 else
674         AC_MSG_RESULT(no)
677 dnl check for pthread support
678 AC_MSG_CHECKING([whether to use pthread])
679 if test x$enable_pthread = xno; then
680         AC_MSG_RESULT(no)
681 else
682         AC_MSG_RESULT(yes)
684         # For W32 we need to use a special ptrhead lib. In this case we can't
685         # use AC_CHECK_LIB because it has no means of checking for a
686         # library installed under a different name.  Checking for the
687         # header is okay.
688         if test -n "${pthread_name}" ; then
689            enable_pthread=yes
690         else
691         AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
692         fi
693         AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
695         if test x$enable_pthread = xyes; then
696                 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
697                 if test -z "${pthread_name}" ; then
698                 PTHREAD_LIBS="-lpthread"
699         fi
700         fi
703 AC_SUBST(PTHREAD_LIBS)
706 dnl Check whether we need to pass -lresolv
707 dnl We know that we don't need it for W32.
709 if test x$os_win32 = xno; then
710   t_oldLibs="$LIBS"
711   LIBS="$LIBS"
712   ac_cv_var__res_options=no
713   AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
714              #include <sys/socket.h>
715              #include <netinet/in.h>
716              #include <arpa/nameser.h>
717              #include <resolv.h>]], [[_res.options = RES_INIT;]])],[ac_cv_var__res_options=yes],[]);
718   if test "$ac_cv_var__res_options" != "yes"; then
719         LIBRESOLV="-lresolv"
720   fi
721   LIBS="$t_oldLibs"
723   if test "x$LIBRESOLV" = "x"; then
724         AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
725         LIBS="$t_oldLibs"
726   fi
728 AC_SUBST(LIBRESOLV)
730 LIBS="$LIBS $LIBRESOLV"
732 dnl #######################################################################
733 dnl # Check for startup notification
734 dnl #######################################################################
735 if test "x$enable_startup_notification" = "xyes"; then
736         PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
737         [
738                 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
739                 echo "Building with libstartup-notification"
740                 enable_startup_notification=yes
741         ],
742         [
743                 echo "Building without libstartup-notification"
744                 enable_startup_notification=no
745         ])
747         AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
748         AC_SUBST(STARTUP_NOTIFICATION_LIBS)
751 dnl #######################################################################
752 dnl # Check for D-Bus support
753 dnl #######################################################################
754 if test "x$enable_dbus" = "xyes"; then
755         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
756         [
757                 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
758                 enable_dbus=yes
759         ],
760         [
761                 echo "D-Bus requirements not met. D-Bus support not activated."
762                 enable_dbus=no
763         ])
764         AC_SUBST(DBUS_CFLAGS)
765         AC_SUBST(DBUS_LIBS)
768 dnl #######################################################################
769 dnl # Configure address book support
770 dnl #######################################################################
772 dnl #######################################################################
773 dnl # Check for alternate address book support
774 dnl #######################################################################
775 AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
776 if test x"$enable_dbus" = xyes; then
777         AC_MSG_RESULT([yes])
778         AC_MSG_CHECKING([whether to enable alternate address book])
779         if test x"$enable_alternate_addressbook" = xyes; then
780                 AC_MSG_RESULT([yes])
781                 PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
782                 [
783                         AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
784                         enable_alternate_addressbook=yes
785                         AC_SUBST(CONTACTS_CFLAGS)
786                         AC_SUBST(CONTACTS_LIBS)
787                 ],
788                 [
789                         enable_alternate_addressbook=no
790                 ])
791         else
792                 AC_MSG_RESULT([no])
793                 enable_alternate_addressbook=no
794         fi
795 else
796         AC_MSG_RESULT([no])
797         enable_alternate_addressbook=no
800 dnl #######################################################################
801 dnl # Check for old address book support
802 dnl #######################################################################
803 if test x"$enable_alternate_addressbook" = xno; then
804         dnl for LDAP support in addressbook
805         dnl no check for libraries; dynamically loaded
806         AC_MSG_CHECKING([whether to use LDAP])
807         if test x"$enable_ldap" = xno; then
808                 AC_MSG_RESULT(no)
809         elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
810                 AC_MSG_RESULT(no - LDAP support needs pthread support)
812                 enable_ldap=no
813         elif test x"$platform_win32" = xyes; then
814                 AC_MSG_RESULT(yes)
815                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
816                 LDAP_LIBS="-lwldap32"
817                 AC_SUBST(LDAP_LIBS)
818         else
819                 AC_MSG_RESULT(yes)
821                 dnl check for available libraries, and pull them in
822                 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
823                 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
824                 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
825                 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
826                                  $LDAP_LIBS)
828                 AC_CHECK_HEADERS(ldap.h lber.h,
829                                  [ enable_ldap=yes ],
830                                  [ enable_ldap=no ])
832                 if test "$enable_ldap" = yes; then
833                         AC_CHECK_LIB(ldap, ldap_open,
834                                          [ enable_ldap=yes ],
835                                          [ enable_ldap=no ],
836                                          $LDAP_LIBS)
838                         AC_CHECK_LIB(ldap, ldap_start_tls_s,
839                                              [ ac_cv_have_tls=yes ],
840                                              [ ac_cv_have_tls=no ])
842                 fi
844                 AC_MSG_CHECKING([whether ldap library is available])
845                 AC_MSG_RESULT($enable_ldap)
847                 AC_MSG_CHECKING([whether TLS library is available])
848                 AC_MSG_RESULT($ac_cv_have_tls)
850                 if test "$enable_ldap" = yes; then
851                         AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
852                         LDAP_LIBS="$LDAP_LIBS -lldap"
853                         AC_SUBST(LDAP_LIBS)
854                         if test "$ac_cv_have_tls" = yes; then
855                                 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
856                         fi
857                         dnl As of OpenLDAP API version 3000 a number of functions has
858                         dnl been deprecated. As Claws-mail compiles and runs on many
859                         dnl platforms and many versions of OpenLDAP we need to be able
860                         dnl to switch between the old and new API because new API has
861                         dnl added new functions replacing old ones and at the same time
862                         dnl old functions has been changed.
863                         dnl If cross-compiling defaults to enable deprecated features
864                         dnl for maximum portability
865                         AC_MSG_CHECKING([The API version of OpenLDAP])
866                         AC_RUN_IFELSE(
867                                 [AC_LANG_PROGRAM(
868                                  [#include <ldap.h>],
869                                  [if (LDAP_API_VERSION >= 3000)
870                                                 return 1
871                                 ])],
872                                 [AC_MSG_RESULT([version < 3000])
873                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
874                                 [AC_MSG_RESULT([version >= 3000])
875                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
876                                 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
877                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
878                                  AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
879                         )
880                 fi
881         fi
883         dnl for JPilot support in addressbook
884         dnl no check for libraries; these are dynamically loaded
885         AC_MSG_CHECKING([whether to use JPilot])
886         if test "$enable_jpilot" = yes; then
887                 AC_MSG_RESULT(yes)
888                 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
889                                  [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
890                                  [ enable_jpilot=no ])
891                 if test "$enable_jpilot" = no; then
892                         AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
893                                          [ enable_jpilot=yes
894                                            AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
895                 fi
897                 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
898                 if test x"$enable_jpilot" = xyes; then
899                         AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
900                 else
901                         AC_MSG_NOTICE([JPilot support not available])
902                 fi
903                 AC_SUBST(JPILOT_LIBS)
904         else
905                 AC_MSG_RESULT(no)
906         fi
909 AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
911 dnl #######################################################################
912 dnl # Check for NetworkManager support
913 dnl #######################################################################
914 if test x"$enable_dbus" = xyes; then
915         if test x"$enable_networkmanager" = xyes; then
916                 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
917                 [
918                         AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
919                         echo "Building with NetworkManager support"
920                         enable_networkmanager=yes
921                 ],
922                 [
923                         echo "NetworkManager not found."
924                         enable_networkmanager=no
925                 ])
926                 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
927         fi
928 else
929         echo "NetworkManager support deactivated as D-Bus requirements were not met."
930         enable_networkmanager=no
933 dnl Libetpan
934 AC_MSG_CHECKING([whether to use libetpan])
935 if test x"$enable_libetpan" = xyes; then
936     AC_MSG_RESULT(yes)
938     libetpan_config=no
939     libetpan_result=no
940     libetpan_versiontype=0
942     # since 1.9.4, libetpan uses pkg-config
943     PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
944     [
945         LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
946         libetpan_config=yes
947     ],
948     [
949         # before 1.9.4, libetpan uses its own libetpan-config script
950         AC_PATH_PROG(libetpanconfig, [libetpan-config])
951         if test "x$libetpanconfig" != "x"; then
952             LIBETPAN_CFLAGS="`$libetpanconfig --cflags`"
953             LIBETPAN_LIBS="`$libetpanconfig --libs`"
954             # support libetpan version like x.x and x.x.x
955             libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
956             if test $libetpan_versiontype -eq 1; then
957                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
958             else
959                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
960             fi
961             libetpan_config=yes
962         fi
963     ])
964     if test "x$libetpan_config" = "xyes"; then
965         AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
966         if test "x$libetpan_result" = "xyes"; then
967             AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
968             LIBS="$LIBS $LIBETPAN_LIBS"
969             AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libetpan/dbstorage.h>]], [[db_mailstorage_init(NULL, NULL);]])],[libetpan_result=yes],[libetpan_result=no])
970             AC_MSG_RESULT([$libetpan_result])
971         fi
972     fi
973     if test "x$libetpan_result" = "xyes"; then
974         if test $libetpan_versiontype -eq 1; then
975             if test "$LIBETPAN_VERSION" -lt "57"; then
976                 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
977                 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
978                 AC_MSG_ERROR([libetpan 0.57 not found])
979             fi
980         fi
981         AC_SUBST(LIBETPAN_CFLAGS)
982         AC_SUBST(LIBETPAN_LIBS)
983         AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
984     else
985         AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
986         AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
987         AC_MSG_ERROR([libetpan 0.57 not found])
988     fi
989 else
990     AC_MSG_RESULT(no)
992 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
994 dnl librsvg
995 AC_MSG_CHECKING([whether to use librsvg])
996 if test x"$enable_svg" = xyes; then
997         AC_MSG_RESULT(yes)
998     PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
999     [
1000         AC_SUBST(SVG_CFLAGS)
1001         AC_SUBST(SVG_LIBS)
1002                 AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
1003                 enable_svg=yes
1004         ],
1005         [
1006                 AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
1007                 enable_svg=no
1008         ])
1009 else
1010         AC_MSG_RESULT(no)
1013 AC_MSG_CHECKING([whether to use valgrind])
1014 if test x$enable_valgrind = xyes; then
1015         AC_MSG_RESULT(yes)
1016         PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1017                           enable_valgrind=yes, enable_valgrind=no)
1018         if test x"$enable_valgrind" = xyes; then
1019                 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1020         else
1021                 AC_MSG_RESULT(not found)
1022         fi
1023 else
1024         AC_MSG_RESULT(no)
1026 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
1028 AC_MSG_CHECKING([whether to build unit tests])
1029 if test x$enable_tests = xyes; then
1030         AC_MSG_RESULT(yes)
1031 else
1032         AC_MSG_RESULT(no)
1034 AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
1036 dnl *************************
1037 dnl ** section for plugins **
1038 dnl *************************
1040 PLUGINS=""
1041 DISABLED_PLUGINS=""
1042 MISSING_DEPS_PLUGINS=""
1044 dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
1045 dnl or (auto-)disabled (no for both)
1047 dnl All plugins are auto-enabled except for Demo which is just there to help
1048 dnl potential plugins writers.
1050 AC_ARG_ENABLE(acpi_notifier-plugin,
1051                 [  --disable-acpi_notifier-plugin  Do not build acpi_notifier plugin],
1052                 [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
1054 AC_ARG_ENABLE(address_keeper-plugin,
1055                 [  --disable-address_keeper-plugin Do not build address_keeper plugin],
1056                 [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
1058 AC_ARG_ENABLE(archive-plugin,
1059                 [  --disable-archive-plugin        Do not build archive plugin],
1060                 [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
1062 AC_ARG_ENABLE(att_remover-plugin,
1063                 [  --disable-att_remover-plugin    Do not build att_remover plugin],
1064                 [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
1066 AC_ARG_ENABLE(attachwarner-plugin,
1067                 [  --disable-attachwarner-plugin   Do not build attachwarner plugin],
1068                 [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
1070 AC_ARG_ENABLE(bogofilter-plugin,
1071                 [  --disable-bogofilter-plugin     Do not build bogofilter plugin],
1072                 [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
1074 AC_ARG_ENABLE(bsfilter-plugin,
1075                 [  --disable-bsfilter-plugin       Do not build bsfilter plugin],
1076                 [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
1078 AC_ARG_ENABLE(clamd-plugin,
1079                 [  --disable-clamd-plugin          Do not build clamd plugin],
1080                 [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
1082 AC_ARG_ENABLE(dillo-plugin,
1083                 [  --disable-dillo-plugin          Do not build dillo plugin],
1084                 [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
1086 AC_ARG_ENABLE(fancy-plugin,
1087                 [  --disable-fancy-plugin          Do not build fancy plugin],
1088                 [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
1090 AC_ARG_ENABLE(fetchinfo-plugin,
1091                 [  --disable-fetchinfo-plugin      Do not build fetchinfo plugin],
1092                 [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
1094 AC_ARG_ENABLE(gdata-plugin,
1095                 [  --disable-gdata-plugin          Do not build gdata plugin],
1096                 [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
1098 AC_ARG_ENABLE(keyword_warner-plugin,
1099                 [  --disable-keyword_warner-plugin   Do not build keyword_warner plugin],
1100                 [enable_keyword_warner_plugin=$enableval], [enable_keyword_warner_plugin=auto])
1102 AC_ARG_ENABLE(libravatar-plugin,
1103                 [  --disable-libravatar-plugin     Do not build libravatar  plugin],
1104                 [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
1106 AC_ARG_ENABLE(litehtml_viewer-plugin,
1107                 [  --disable-litehtml_viewer-plugin       Do not build litehtml_viewer plugin],
1108                 [enable_litehtml_viewer_plugin=$enableval], [enable_litehtml_viewer_plugin=auto])
1110 AC_ARG_ENABLE(mailmbox-plugin,
1111                 [  --disable-mailmbox-plugin       Do not build mailmbox plugin],
1112                 [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
1114 AC_ARG_ENABLE(managesieve-plugin,
1115                 [  --disable-managesieve-plugin    Do not build managesieve plugin],
1116                 [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
1118 AC_ARG_ENABLE(newmail-plugin,
1119                 [  --disable-newmail-plugin        Do not build newmail plugin],
1120                 [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
1122 AC_ARG_ENABLE(notification-plugin,
1123                 [  --disable-notification-plugin   Do not build notification plugin],
1124                 [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
1126 AC_ARG_ENABLE(pdf_viewer-plugin,
1127                 [  --disable-pdf_viewer-plugin     Do not build pdf_viewer plugin],
1128                 [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
1130 AC_ARG_ENABLE(perl-plugin,
1131                 [  --disable-perl-plugin           Do not build perl plugin],
1132                 [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
1134 AC_ARG_ENABLE(python-plugin,
1135                 [  --disable-python-plugin         Do not build python plugin],
1136                 [enable_python_plugin=$enableval], [enable_python_plugin=auto])
1138 AC_ARG_ENABLE(pgpcore-plugin,
1139                 [  --disable-pgpcore-plugin        Do not build pgpcore plugin],
1140                 [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
1142 AC_ARG_ENABLE(pgpmime-plugin,
1143                 [  --disable-pgpmime-plugin        Do not build pgpmime plugin],
1144                 [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
1146 AC_ARG_ENABLE(pgpinline-plugin,
1147                 [  --disable-pgpinline-plugin      Do not build pgpinline plugin],
1148                 [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
1150 AC_ARG_ENABLE(rssyl-plugin,
1151                 [  --disable-rssyl-plugin          Do not build rssyl plugin],
1152                 [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
1154 AC_ARG_ENABLE(smime-plugin,
1155                 [  --disable-smime-plugin          Do not build smime plugin],
1156                 [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
1158 AC_ARG_ENABLE(spamassassin-plugin,
1159                 [  --disable-spamassassin-plugin   Do not build spamassassin plugin],
1160                 [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
1162 AC_ARG_ENABLE(spam_report-plugin,
1163                 [  --disable-spam_report-plugin    Do not build spam_report plugin],
1164                 [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
1166 AC_ARG_ENABLE(tnef_parse-plugin,
1167                 [  --disable-tnef_parse-plugin     Do not build tnef_parse plugin],
1168                 [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
1170 AC_ARG_ENABLE(vcalendar-plugin,
1171                 [  --disable-vcalendar-plugin      Do not build vcalendar plugin],
1172                 [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
1174 dnl disabled by default
1175 AC_ARG_ENABLE(demo-plugin,
1176                 [  --enable-demo-plugin            Build demo plugin],
1177                 [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
1180 dnl Then we check (unconditionnaly) for plugins dependencies
1181 dnl Some dependencies are optional, some mandatory. This is taken care of
1182 dnl later.
1184 dnl During this dependancy check we do the checks themselves, define HAVE_X to
1185 dnl either yes or no, and do the AC_SUBST calls.
1187 dnl Archive:            libarchive
1188 dnl Fancy:              Webkit, curl, optionally libsoup-gnome
1189 dnl Gdata:              libgdata
1190 dnl Litehtml            a C++ compiler, >=glib-2.36, cairo, fontconfig, gumbo, curl
1191 dnl Libravatar:         libcurl
1192 dnl Notification:       optionally libnotify  unity/messaging-menu
1193 dnl                                libcanberra_gtk3 hotkey
1194 dnl Pdf-Viewer:         libpoppler
1195 dnl Perl:               sed perl
1196 dnl PGP/Core:           libgpgme
1197 dnl PGP/Mime:           pgpcore libgpgme
1198 dnl PGP/Inline:         pgpcore libgpgme
1199 dnl S/Mime:             pgpcore libgpgme
1200 dnl Python:             Python
1201 dnl RSSyl:              expat libcurl
1202 dnl SpamReport:         libcurl
1203 dnl vCalendar:          libcurl, libical
1204 dnl tnef_parse:         libytnef
1206 dnl libcurl ********************************************************************
1207 PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
1208 AC_SUBST(CURL_LIBS)
1209 AC_SUBST(CURL_CFLAGS)
1211 dnl expat **********************************************************************
1212 PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
1214 if test x"$HAVE_EXPAT" = xno; then
1215         AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
1216         AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
1217         if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
1218                 HAVE_EXPAT=yes
1219                 EXPAT_CFLAGS=""
1220                 EXPAT_LIBS="-lexpat"
1221         fi
1224 AC_SUBST(EXPAT_CFLAGS)
1225 AC_SUBST(EXPAT_LIBS)
1227 dnl webkit *********************************************************************
1228 PKG_CHECK_MODULES(WEBKIT, webkit2gtk-4.0 >= 2.18.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
1229 AC_SUBST(WEBKIT_LIBS)
1230 AC_SUBST(WEBKIT_CFLAGS)
1232 dnl libsoup ********************************************************************
1233 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
1234 if test x"$HAVE_LIBSOUP" = xyes; then
1235         AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
1237 AC_SUBST(LIBSOUP_CFLAGS)
1238 AC_SUBST(LIBSOUP_LIBS)
1240 dnl libsoup-gnome **************************************************************
1241 PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
1242 if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
1243         AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
1245 AC_SUBST(LIBSOUP_GNOME_CFLAGS)
1246 AC_SUBST(LIBSOUP_GNOME_LIBS)
1248 dnl libarchive *****************************************************************
1249 PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
1250 AC_SUBST(ARCHIVE_LIBS)
1251 AC_SUBST(ARCHIVE_CFLAGS)
1252 AC_CHECK_LIB([archive], [archive_read_new],
1253                        ARCHIVE_LIBS=-larchive
1254                        HAVE_ARCHIVE=yes
1255                        AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
1256                        HAVE_ARCHIVE=no
1257                        )
1259 dnl libgdata *******************************************************************
1260 PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
1261 AC_SUBST(GDATA_CFLAGS)
1262 AC_SUBST(GDATA_LIBS)
1264 dnl cairo **********************************************************************
1265 PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
1266 AC_SUBST(CAIRO_CFLAGS)
1267 AC_SUBST(CAIRO_LIBS)
1269 dnl fontconfig *****************************************************************
1270 PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no)
1271 AC_SUBST(FONTCONFIG_CFLAGS)
1272 AC_SUBST(FONTCONFIG_LIBS)
1274 dnl gumbo **********************************************************************
1275 PKG_CHECK_MODULES(LIBGUMBO, gumbo >= 0.10, HAVE_LIBGUMBO=yes, HAVE_LIBGUMBO=no)
1276 AC_SUBST(LIBGUMBO_CFLAGS)
1277 AC_SUBST(LIBGUMBO_LIBS)
1279 dnl libical ********************************************************************
1280 PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
1281 AC_SUBST(LIBICAL_CFLAGS)
1282 AC_SUBST(LIBICAL_LIBS)
1284 dnl Poppler ********************************************************************
1285 PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
1286 AC_SUBST(POPPLER_LIBS)
1287 AC_SUBST(POPPLER_CFLAGS)
1289 dnl check for Poppler extra features that we conditionally support
1290 if test x"$HAVE_POPPLER" = xyes; then
1291         OLD_CFLAGS=$CFLAGS
1292         CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
1293         AC_CHECK_DECL(POPPLER_DEST_NAMED,
1294                 [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
1295                 ,[#include <poppler-action.h>])
1296         AC_CHECK_DECL(POPPLER_DEST_XYZ,
1297                 [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
1298                 ,[#include <poppler-action.h>])
1299         CFLAGS=$OLD_CFLAGS
1302 dnl perl ***********************************************************************
1303 AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
1304 if test x"$HAVE_PERL" = xyes; then
1305         AC_MSG_CHECKING(for perl >= 5.8.0)
1306         PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
1307         if test "$PERL_VER" = "yes"; then
1308                 AC_MSG_RESULT(yes)
1309         else
1310                 AC_MSG_RESULT(no)
1311                 HAVE_PERL=no
1312         fi
1314 if test x"$HAVE_PERL" = xyes; then
1315         AC_MSG_CHECKING(for Perl compile flags)
1316         PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
1317         PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
1318         PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
1319         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
1320         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
1321         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
1322         AC_MSG_RESULT(ok)
1323         AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
1324         
1325         if test x"$HAVE_PERL" = xyes; then
1326                 AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)], 
1327                                              [ HAVE_LIBPERL=no ])
1328         fi
1329         if test x"$HAVE_LIBPERL" = xno; then
1330                 LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
1331                 LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
1332                 AC_MSG_CHECKING([for libperl.so])
1333                 if test -f "$LIBPERL_PREFIX/libperl.so"; then
1334                         AC_MSG_RESULT(yes)
1335                         HAVE_LIBPERL=yes
1336                 else
1337                         AC_MSG_RESULT(no)
1338                 fi      
1339         fi
1340         PERL="perl"
1341         AC_SUBST(PERL)
1342         AC_SUBST(PERL_CFLAGS)
1343         AC_SUBST(PERL_LDFLAGS)
1346 dnl Gpgme **********************************************************************
1347 AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
1348 if test x"$HAVE_GPGME" = xyes; then
1349         AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
1350         AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
1353 dnl Python *********************************************************************
1354 PKG_CHECK_MODULES(PYTHON, python3, HAVE_PYTHON=yes, HAVE_PYTHON=no)
1355 PKG_CHECK_MODULES(PYTHONEMBED, python3-embed, HAVE_PYTHONEMBED=yes, HAVE_PYTHONEMBED=no)
1356 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0, HAVE_PYGOBJ=yes, HAVE_PYGOBJ=no)
1358 AC_SUBST(PYTHON_SHARED_LIB)
1359 AC_SUBST(PYTHON_CFLAGS)
1360 AC_SUBST(PYTHON_LIBS)
1361 AC_SUBST(PYTHONEMBED_SHARED_LIB)
1362 AC_SUBST(PYTHONEMBED_CFLAGS)
1363 AC_SUBST(PYTHONEMBED_LIBS)
1364 AC_SUBST(PYGOBJECT_CFLAGS)
1365 AC_SUBST(PYGOBJECT_LIBS)
1367 dnl libnotify ******************************************************************
1368 PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
1369 if test x"$HAVE_LIBNOTIFY" = xyes; then
1370         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
1372 AC_SUBST(libnotify_CFLAGS)
1373 AC_SUBST(libnotify_LIBS)
1375 dnl libcanberra-gtk3 ************************************************************
1376 PKG_CHECK_MODULES(libcanberra_gtk3, libcanberra-gtk3, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
1377 if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1378         AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk3 support is enabled])
1380 AC_SUBST(libcanberra_gtk3_CFLAGS)
1381 AC_SUBST(libcanberra_gtk3_LIBS)
1383 dnl unity/messaging-menu *******************************************************
1384 PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
1385 if test x"$HAVE_UNITY" = xyes; then
1386         AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
1388 AC_SUBST(unity_CFLAGS)
1389 AC_SUBST(unity_LIBS)
1391 dnl hotkeys ********************************************************************
1392 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)
1393 if test x"$HAVE_HOTKEYS" = xyes; then
1394         AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
1396 AC_SUBST(CM_NP_HOTKEY_CFLAGS)
1397 AC_SUBST(CM_NP_HOTKEY_LIBS)
1399 dnl libytnef *******************************************************************
1400 YTNEF_CFLAGS=""
1401 YTNEF_LIBS=""
1402 have_ytnef=0
1403 # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
1404 # accordingly
1405 AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
1406 if test $have_ytnef -eq 0; then
1407         AC_CHECK_HEADER(libytnef/ytnef.h,
1408                                                                         [have_ytnef=1;
1409                                                                          YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
1410                                                                         [have_ytnef=0])
1412 if test $have_ytnef -eq 1; then
1413         AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
1414         # Now we have to figure out which libytnef version we're using,
1415         # based on whether SwapDDWord takes one argument or two.
1416         if test "x${YTNEF_CFLAGS}" = "x"; then
1417                 ytnef_include="#include <ytnef.h>"
1418         else
1419                 ytnef_include="#include <libytnef/ytnef.h>"
1420         fi
1421         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
1422                                                                         ${ytnef_include}]], [[SwapDDWord(0, 0);]])],[have_ytnef=1],[have_ytnef=0])
1423         if test $have_ytnef -eq 0; then
1424                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
1425                                                                                 ${ytnef_include}]], [[SwapDDWord(0);]])],[have_ytnef=1;
1426                                                                                  YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],[have_ytnef=0])
1427         fi
1428         if test $have_ytnef -eq 1; then
1429                 YTNEF_LIBS="-lytnef"
1430                 AC_MSG_RESULT(ok)
1431         else
1432                 AC_MSG_RESULT(no idea, unsupported libytnef version?)
1433         fi
1435 AC_SUBST(YTNEF_CFLAGS)
1436 AC_SUBST(YTNEF_LIBS)
1438 dnl Third, we now cross the requested plugins and the available dependencies
1439 dnl If some dependencies are missing and the plugin was explicitely enabled,
1440 dnl we error out, else we only inform.
1442 AC_MSG_CHECKING([whether to build acpi_notifier plugin])
1443 if test x"$enable_acpi_notifier_plugin" != xno; then
1444         PLUGINS="$PLUGINS acpi_notifier"
1445         AC_MSG_RESULT(yes)
1446 else
1447         DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
1448         AC_MSG_RESULT(no)
1451 AC_MSG_CHECKING([whether to build address_keeper plugin])
1452 if test x"$enable_address_keeper_plugin" != xno; then
1453         PLUGINS="$PLUGINS address_keeper"
1454         AC_MSG_RESULT(yes)
1455 else
1456         DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
1457         AC_MSG_RESULT(no)
1460 AC_MSG_CHECKING([whether to build archive plugin])
1461 if test x"$enable_archive_plugin" != xno; then
1462         dependencies_missing=""
1464         if test x"$HAVE_ARCHIVE" = xno; then
1465                 dependencies_missing="libarchive $dependencies_missing"
1466         fi
1468         if test x"$dependencies_missing" = x; then
1469                 PLUGINS="$PLUGINS archive"
1470                 AC_MSG_RESULT(yes)
1471         elif test x"$enable_archive_plugin" = xauto; then
1472                 AC_MSG_RESULT(no)
1473                 AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
1474                 enable_archive_plugin=no
1475                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
1476         else
1477                 AC_MSG_RESULT(no)
1478                 AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
1479         fi
1480 else
1481         DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
1482         AC_MSG_RESULT(no)
1485 AC_MSG_CHECKING([whether to build att_remover plugin])
1486 if test x"$enable_att_remover_plugin" != xno; then
1487         PLUGINS="$PLUGINS att_remover"
1488         AC_MSG_RESULT(yes)
1489 else
1490         DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
1491         AC_MSG_RESULT(no)
1494 AC_MSG_CHECKING([whether to build attachwarner plugin])
1495 if test x"$enable_attachwarner_plugin" != xno; then
1496         PLUGINS="$PLUGINS attachwarner"
1497         AC_MSG_RESULT(yes)
1498 else
1499         DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
1500         AC_MSG_RESULT(no)
1503 AC_MSG_CHECKING([whether to build bogofilter plugin])
1504 if test x"$enable_bogofilter_plugin" != xno; then
1505         PLUGINS="$PLUGINS bogofilter"
1506         AC_MSG_RESULT(yes)
1507 else
1508         DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
1509         AC_MSG_RESULT(no)
1512 AC_MSG_CHECKING([whether to build bsfilter plugin])
1513 if test x"$enable_bsfilter_plugin" != xno; then
1514         PLUGINS="$PLUGINS bsfilter"
1515         AC_MSG_RESULT(yes)
1516 else
1517         DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
1518         AC_MSG_RESULT(no)
1521 AC_MSG_CHECKING([whether to build clamd plugin])
1522 if test x"$enable_clamd_plugin" != xno; then
1523         PLUGINS="$PLUGINS clamd"
1524         AC_MSG_RESULT(yes)
1525 else
1526         DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
1527         AC_MSG_RESULT(no)
1530 AC_MSG_CHECKING([whether to build demo plugin])
1531 if test x"$enable_demo_plugin" != xno; then
1532         PLUGINS="$PLUGINS demo"
1533         AC_MSG_RESULT(yes)
1534 else
1535         DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
1536         AC_MSG_RESULT(no)
1539 AC_MSG_CHECKING([whether to build Dillo plugin])
1540 if test x"$enable_dillo_plugin" != xno; then
1541         PLUGINS="$PLUGINS dillo"
1542         AC_MSG_RESULT(yes)
1543 else
1544         DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
1545         AC_MSG_RESULT(no)
1548 AC_MSG_CHECKING([whether to build fancy plugin])
1549 if test x"$enable_fancy_plugin" != xno; then
1550         dependencies_missing=""
1552         if test x"$HAVE_WEBKIT" = xno; then
1553                 dependencies_missing="libwebkit2gtk-4.0 $dependencies_missing"
1554         fi
1555         if test x"$HAVE_CURL" = xno; then
1556                 dependencies_missing="libcurl $dependencies_missing"
1557         fi
1559         if test x"$dependencies_missing" = x; then
1560                 PLUGINS="$PLUGINS fancy"
1561                 AC_MSG_RESULT(yes)
1562         elif test x"$enable_fancy_plugin" = xauto; then
1563                 AC_MSG_RESULT(no)
1564                 AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
1565                 enable_fancy_plugin=no
1566                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
1567         else
1568                 AC_MSG_RESULT(no)
1569                 AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
1570         fi
1571 else
1572         DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
1573         AC_MSG_RESULT(no)
1576 AC_MSG_CHECKING([whether to build fetchinfo plugin])
1577 if test x"$enable_fetchinfo_plugin" != xno; then
1578         PLUGINS="$PLUGINS fetchinfo"
1579         AC_MSG_RESULT(yes)
1580 else
1581         DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
1582         AC_MSG_RESULT(no)
1585 AC_MSG_CHECKING([whether to build gdata plugin])
1586 if test x"$enable_gdata_plugin" != xno; then
1587         dependencies_missing=""
1589         if test x"$HAVE_GDATA" = xno; then
1590                 dependencies_missing="libgdata $dependencies_missing"
1591         fi
1593         if test x"$dependencies_missing" = x; then
1594                 PLUGINS="$PLUGINS gdata"
1595                 AC_MSG_RESULT(yes)
1596         elif test x"$enable_gdata_plugin" = xauto; then
1597                 AC_MSG_RESULT(no)
1598                 AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
1599                 enable_gdata_plugin=no
1600                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
1601         else
1602                 AC_MSG_RESULT(no)
1603                 AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
1604         fi
1605 else
1606         DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
1607         AC_MSG_RESULT(no)
1610 AC_MSG_CHECKING([whether to build keyword_warner plugin])
1611 if test x"$enable_keyword_warner_plugin" != xno; then
1612         PLUGINS="$PLUGINS keyword_warner"
1613         AC_MSG_RESULT(yes)
1614 else
1615         DISABLED_PLUGINS="$DISABLED_PLUGINS keyword_warner"
1616         AC_MSG_RESULT(no)
1619 AC_MSG_CHECKING([whether to build libravatar plugin])
1620 if test x"$enable_libravatar_plugin" != xno; then
1621         dependencies_missing=""
1623         if test x"$HAVE_CURL" = xno; then
1624                 dependencies_missing="libcurl $dependencies_missing"
1625         fi
1627         if test x"$dependencies_missing" = x; then
1628                 PLUGINS="$PLUGINS libravatar"
1629                 AC_MSG_RESULT(yes)
1630         elif test x"$enable_libravatar_plugin" = xauto; then
1631                 AC_MSG_RESULT(no)
1632                 AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
1633                 enable_libravatar_plugin=no
1634                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
1635         else
1636                 AC_MSG_RESULT(no)
1637                 AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
1638         fi
1639 else
1640         DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
1641         AC_MSG_RESULT(no)
1644 AC_MSG_CHECKING([whether to build litehtml_viewer plugin])
1645 if test x"$enable_litehtml_viewer_plugin" != xno; then
1646         dependencies_missing=""
1648         if test x"$HAVE_CXX" = xno; then
1649                 dependencies_missing="C++ compiler $dependencies_missing"
1650         fi
1651         PKG_CHECK_EXISTS([glib-2.0 >= 2.36], [],
1652                 [dependencies_missing="glib-2.0 >= 2.36 $dependencies_missing"])
1653         if test x"$HAVE_CAIRO" = xno; then
1654                 dependencies_missing="cairo $dependencies_missing"
1655         fi
1656         if test x"$HAVE_FONTCONFIG" = xno; then
1657                 dependencies_missing="fontconfig $dependencies_missing"
1658         fi
1659         if test x"$HAVE_LIBGUMBO" = xno; then
1660                 dependencies_missing="libgumbo $dependencies_missing"
1661         fi
1662         if test x"$HAVE_CURL" = xno; then
1663                 dependencies_missing="libcurl $dependencies_missing"
1664         fi
1667         if test x"$dependencies_missing" = x; then
1668                 PLUGINS="$PLUGINS litehtml_viewer"
1669                 AC_MSG_RESULT(yes)
1670         elif test x"$enable_litehtml_viewer_plugin" = xauto; then
1671                 AC_MSG_RESULT(no)
1672                 AC_MSG_WARN("Plugin litehtml_viewer will not be built; missing $dependencies_missing")
1673                 enable_litehtml_viewer_plugin=no
1674                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS litehtml_viewer"
1675         else
1676                 AC_MSG_RESULT(no)
1677                 AC_MSG_ERROR("Plugin litehtml_viewer cannot be built; missing $dependencies_missing")
1678         fi
1679 else
1680         DISABLED_PLUGINS="$DISABLED_PLUGINS litehtml_viewer"
1681         AC_MSG_RESULT(no)
1684 AC_MSG_CHECKING([whether to build mailmbox plugin])
1685 if test x"$enable_mailmbox_plugin" != xno; then
1686         PLUGINS="$PLUGINS mailmbox"
1687         AC_MSG_RESULT(yes)
1688 else
1689         DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
1690         AC_MSG_RESULT(no)
1693 AC_MSG_CHECKING([whether to build managesieve plugin])
1694 if test x"$enable_managesieve_plugin" != xno; then
1695         PLUGINS="$PLUGINS managesieve"
1696         AC_MSG_RESULT(yes)
1697 else
1698         DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
1699         AC_MSG_RESULT(no)
1702 AC_MSG_CHECKING([whether to build newmail plugin])
1703 if test x"$enable_newmail_plugin" != xno; then
1704         PLUGINS="$PLUGINS newmail"
1705         AC_MSG_RESULT(yes)
1706 else
1707         DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
1708         AC_MSG_RESULT(no)
1711 AC_MSG_CHECKING([whether to build notification plugin])
1712 if test x"$enable_notification_plugin" != xno; then
1713         PLUGINS="$PLUGINS notification"
1714         AC_MSG_RESULT(yes)
1716         AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
1717         AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
1718         AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
1719         AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
1720         if test x"$platform_win32" = xno; then
1721                 AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
1722         fi
1724         notification_features="banner command"
1725         notification_missing_dependencies=""
1726         if test x"$HAVE_HOTKEYS" = xyes; then
1727                 notification_features="$notification_features hotkeys"
1728         else
1729                 notification_missing_dependencies="$notification_missing_dependencies hotkeys"
1730         fi
1731         notification_features="$notification_features lcdproc"
1732         if test x"$HAVE_UNITY" = xyes; then
1733                 notification_features="$notification_features unity/messaging-menu"
1734         else
1735                 notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
1736         fi
1737         if test x"$HAVE_LIBNOTIFY" = xyes; then
1738                 notification_features="$notification_features libnotify"
1739         else
1740                 notification_missing_dependencies="$notification_missing_dependencies libnotify"
1741         fi
1742         if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1743                 notification_features="$notification_features libcanberra-gtk3"
1744         else
1745                 notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk3"
1746         fi
1747         notification_features="$notification_features popup trayicon"
1748 else
1749         DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
1750         AC_MSG_RESULT(no)
1753 AC_MSG_CHECKING([whether to build pdf_viewer plugin])
1754 if test x"$enable_pdf_viewer_plugin" != xno; then
1755         dependencies_missing=""
1757         if test x"$HAVE_POPPLER" = xno; then
1758                 dependencies_missing="libpoppler-glib $dependencies_missing"
1759         fi
1761         if test x"$dependencies_missing" = x; then
1762                 PLUGINS="$PLUGINS pdf_viewer"
1763                 AC_MSG_RESULT(yes)
1764         elif test x"$enable_pdf_viewer_plugin" = xauto; then
1765                 AC_MSG_RESULT(no)
1766                 AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
1767                 enable_pdf_viewer_plugin=no
1768                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
1769         else
1770                 AC_MSG_RESULT(no)
1771                 AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
1772         fi
1773 else
1774         DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
1775         AC_MSG_RESULT(no)
1778 AC_MSG_CHECKING([whether to build perl plugin])
1779 if test x"$enable_perl_plugin" != xno; then
1780         dependencies_missing=""
1782         if test x"$HAVE_LIBPERL" = xno; then
1783                 dependencies_missing="libperl $dependencies_missing"
1784         fi
1786         if test x"$dependencies_missing" = x; then
1787                 PLUGINS="$PLUGINS perl"
1788                 AC_MSG_RESULT(yes)
1789         elif test x"$enable_perl_plugin" = xauto; then
1790                 AC_MSG_RESULT(no)
1791                 AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
1792                 enable_perl_plugin=no
1793                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
1794         else
1795                 AC_MSG_RESULT(no)
1796                 AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
1797         fi
1798 else
1799         DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
1800         AC_MSG_RESULT(no)
1803 AC_MSG_CHECKING([whether to build python plugin])
1804 if test x"$enable_python_plugin" != xno; then
1805         dependencies_missing=""
1807         if test x"$HAVE_PYTHON" = xno; then
1808                 dependencies_missing="python3 $dependencies_missing"
1809         fi
1810         if test x"$HAVE_PYGOBJ" = xno; then
1811                 dependencies_missing="pygobject-3.0 $dependencies_missing"
1812         fi
1814         if test x"$dependencies_missing" = x; then
1815                 PLUGINS="$PLUGINS python"
1816                 AC_MSG_RESULT(yes)
1817         elif test x"$enable_python_plugin" = xauto; then
1818                 AC_MSG_RESULT(no)
1819                 AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
1820                 enable_python_plugin=no
1821                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
1822         else
1823                 AC_MSG_RESULT(no)
1824                 AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
1825         fi
1826 else
1827         DISABLED_PLUGINS="$DISABLED_PLUGINS python"
1828         AC_MSG_RESULT(no)
1831 AC_MSG_CHECKING([whether to build pgpcore plugin])
1832 if test x"$enable_pgpcore_plugin" != xno; then
1833         dependencies_missing=""
1835         if test x"$HAVE_GPGME" = xno; then
1836                 dependencies_missing="libgpgme $dependencies_missing"
1837         fi
1839         if test x"$dependencies_missing" = x; then
1840                 PLUGINS="$PLUGINS pgpcore"
1841                 AC_MSG_RESULT(yes)
1842         elif test x"$enable_pgpcore_plugin" = xauto; then
1843                 AC_MSG_RESULT(no)
1844                 AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
1845                 enable_pgpcore_plugin=no
1846                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
1847         else
1848                 AC_MSG_RESULT(no)
1849                 AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
1850         fi
1851 else
1852         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
1853         AC_MSG_RESULT(no)
1856 AC_MSG_CHECKING([whether to build pgpmime plugin])
1857 if test x"$enable_pgpmime_plugin" != xno; then
1858         dependencies_missing=""
1860         if test x"$HAVE_GPGME" = xno; then
1861                 dependencies_missing="libgpgme $dependencies_missing"
1862         fi
1863         if test x"$enable_pgpcore_plugin" = xno; then
1864                 dependencies_missing="pgpcore plugin $dependencies_missing"
1865         fi
1867         if test x"$dependencies_missing" = x; then
1868                 PLUGINS="$PLUGINS pgpmime"
1869                 AC_MSG_RESULT(yes)
1870         elif test x"$enable_pgpmime_plugin" = xauto; then
1871                 AC_MSG_RESULT(no)
1872                 AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
1873                 enable_pgpmime_plugin=no
1874                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
1875         else
1876                 AC_MSG_RESULT(no)
1877                 AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
1878         fi
1879 else
1880         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
1881         AC_MSG_RESULT(no)
1884 AC_MSG_CHECKING([whether to build pgpinline plugin])
1885 if test x"$enable_pgpinline_plugin" != xno; then
1886         dependencies_missing=""
1888         if test x"$HAVE_GPGME" = xno; then
1889                 dependencies_missing="libgpgme $dependencies_missing"
1890         fi
1891         if test x"$enable_pgpcore_plugin" = xno; then
1892                 dependencies_missing="pgpcore plugin $dependencies_missing"
1893         fi
1895         if test x"$dependencies_missing" = x; then
1896                 PLUGINS="$PLUGINS pgpinline"
1897                 AC_MSG_RESULT(yes)
1898         elif test x"$enable_pgpinline_plugin" = xauto; then
1899                 AC_MSG_RESULT(no)
1900                 AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
1901                 enable_pgpinline_plugin=no
1902                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
1903         else
1904                 AC_MSG_RESULT(no)
1905                 AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
1906         fi
1907 else
1908         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
1909         AC_MSG_RESULT(no)
1912 AC_MSG_CHECKING([whether to build rssyl plugin])
1913 if test x"$enable_rssyl_plugin" != xno; then
1914         dependencies_missing=""
1916         if test x"$HAVE_EXPAT" = xno; then
1917                 dependencies_missing="expat $dependencies_missing"
1918         fi
1919         if test x"$HAVE_CURL" = xno; then
1920                 dependencies_missing="libcurl $dependencies_missing"
1921         fi
1923         if test x"$dependencies_missing" = x; then
1924                 PLUGINS="$PLUGINS rssyl"
1925                 AC_MSG_RESULT(yes)
1926         elif test x"$enable_rssyl_plugin" = xauto; then
1927                 AC_MSG_RESULT(no)
1928                 AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
1929                 enable_rssyl_plugin=no
1930                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
1931         else
1932                 AC_MSG_RESULT(no)
1933                 AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
1934         fi
1935 else
1936         DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
1937         AC_MSG_RESULT(no)
1940 AC_MSG_CHECKING([whether to build spamassassin plugin])
1941 if test x"$enable_spamassassin_plugin" != xno; then
1942         PLUGINS="$PLUGINS spamassassin"
1943         AC_MSG_RESULT(yes)
1944         AC_SPAMASSASSIN
1946         dnl check for zlib (optional)
1947         spamassassin_zlib=0
1948         SPAMASSASSIN_CFLAGS=""
1949         SPAMASSASSIN_LIBS=""
1950         AC_CHECK_HEADER([zlib.h],
1951                         [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
1952                         [spamassassin_zlib=1],
1953                         [spamassassin_zlib=0])
1954         if test $spamassassin_zlib -eq 1; then
1955                 AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
1956                 AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
1957                 if test $spamassassin_zlib -eq 1; then
1958                         AC_MSG_RESULT(yes)
1959                         SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
1960                         SPAMASSASSIN_LIBS="-lz"
1961                 else
1962                         AC_MSG_RESULT(no)
1963                 fi
1964         fi
1965         AC_SUBST(SPAMASSASSIN_CFLAGS)
1966         AC_SUBST(SPAMASSASSIN_LIBS)
1967 else
1968         DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
1969         AC_MSG_RESULT(no)
1972 AC_MSG_CHECKING([whether to build smime plugin])
1973 if test x"$enable_smime_plugin" != xno; then
1974         dependencies_missing=""
1976         if test x"$HAVE_GPGME" = xno; then
1977                 dependencies_missing="libgpgme $dependencies_missing"
1978         fi
1979         if test x"$enable_pgpcore_plugin" = xno; then
1980                 dependencies_missing="pgpcore plugin $dependencies_missing"
1981         fi
1983         if test x"$dependencies_missing" = x; then
1984                 PLUGINS="$PLUGINS smime"
1985                 AC_MSG_RESULT(yes)
1986         elif test x"$enable_smime_plugin" = xauto; then
1987                 AC_MSG_RESULT(no)
1988                 AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
1989                 enable_smime_plugin=no
1990                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
1991         else
1992                 AC_MSG_RESULT(no)
1993                 AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
1994         fi
1995 else
1996         DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
1997         AC_MSG_RESULT(no)
2000 AC_MSG_CHECKING([whether to build spam_report plugin])
2001 if test x"$enable_spam_report_plugin" != xno; then
2002         dependencies_missing=""
2004         if test x"$HAVE_CURL" = xno; then
2005                 dependencies_missing="libcurl $dependencies_missing"
2006         fi
2008         if test x"$dependencies_missing" = x; then
2009                 PLUGINS="$PLUGINS spam_report"
2010                 AC_MSG_RESULT(yes)
2011         elif test x"$enable_spam_report_plugin" = xauto; then
2012                 AC_MSG_RESULT(no)
2013                 AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
2014                 enable_spam_report_plugin=no
2015                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
2016         else
2017                 AC_MSG_RESULT(no)
2018                 AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
2019         fi
2020 else
2021         DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
2022         AC_MSG_RESULT(no)
2025 AC_MSG_CHECKING([whether to build tnef_parse plugin])
2026 if test x"$enable_tnef_parse_plugin" != xno; then
2027         dependencies_missing=""
2029         if test $have_ytnef -eq 0; then
2030                 dependencies_missing="libytnef"
2031         fi
2033         if test x"$dependencies_missing" = x; then
2034                 PLUGINS="$PLUGINS tnef_parse"
2035                 AC_MSG_RESULT(yes)
2036         elif test x"$enable_tnef_parse_plugin" = xauto; then
2037                 AC_MSG_RESULT(no)
2038                 AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
2039                 enable_tnef_parse_plugin=no
2040                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
2041         else
2042                 AC_MSG_RESULT(no)
2043                 AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
2044         fi
2045 else
2046         DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
2047         AC_MSG_RESULT(no)
2051 AC_MSG_CHECKING([whether to build vcalendar plugin])
2052 if test x"$enable_vcalendar_plugin" != xno; then
2053         dependencies_missing=""
2055         if test x"$HAVE_CURL" = xno; then
2056                 dependencies_missing="libcurl $dependencies_missing"
2057         fi
2059   if test x"$HAVE_LIBICAL" = xno; then
2060     dependencies_missing="libical $dependencies_missing"
2061   fi
2063         if test x"$HAVE_PERL" = xno; then
2064                 dependencies_missing="perl $dependencies_missing"
2065         fi
2067         if test x"$dependencies_missing" = x; then
2068                 PLUGINS="$PLUGINS vcalendar"
2069                 AC_MSG_RESULT(yes)
2070         elif test x"$enable_vcalendar_plugin" = xauto; then
2071                 AC_MSG_RESULT(no)
2072                 AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
2073                 enable_vcalendar_plugin=no
2074                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
2075         else
2076                 AC_MSG_RESULT(no)
2077                 AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
2078         fi
2079 else
2080         DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
2081         AC_MSG_RESULT(no)
2084 dnl And finally the automake conditionals.
2086 AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN,      test x"$enable_acpi_notifier_plugin" != xno)
2087 AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN,     test x"$enable_address_keeper_plugin" != xno)
2088 AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN,            test x"$enable_archive_plugin" != xno)
2089 AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN,        test x"$enable_att_remover_plugin" != xno)
2090 AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN,       test x"$enable_attachwarner_plugin" != xno)
2091 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN,         test x"$enable_bogofilter_plugin" != xno)
2092 AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,           test x"$enable_bsfilter_plugin" != xno)
2093 AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,              test x"$enable_clamd_plugin" != xno)
2094 AM_CONDITIONAL(BUILD_DEMO_PLUGIN,               test x"$enable_demo_plugin" != xno)
2095 AM_CONDITIONAL(BUILD_DILLO_PLUGIN,              test x"$enable_dillo_plugin" != xno)
2096 AM_CONDITIONAL(BUILD_FANCY_PLUGIN,              test x"$enable_fancy_plugin" != xno)
2097 AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,          test x"$enable_fetchinfo_plugin" != xno)
2098 AM_CONDITIONAL(BUILD_GDATA_PLUGIN,              test x"$enable_gdata_plugin" != xno)
2099 AM_CONDITIONAL(BUILD_KEYWORD_WARNER_PLUGIN,     test x"$enable_keyword_warner_plugin" != xno)
2100 AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN,         test x"$enable_libravatar_plugin" != xno)
2101 AM_CONDITIONAL(BUILD_LITEHTML_VIEWER_PLUGIN,    test x"$enable_litehtml_viewer_plugin" != xno)
2102 AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN,           test x"$enable_mailmbox_plugin" != xno)
2103 AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN,        test x"$enable_managesieve_plugin" != xno)
2104 AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN,            test x"$enable_newmail_plugin" != xno)
2105 AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN,       test x"$enable_notification_plugin" != xno)
2106 AM_CONDITIONAL(BUILD_HOTKEYS,                   test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
2107 AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN,         test x"$enable_pdf_viewer_plugin" != xno)
2108 AM_CONDITIONAL(BUILD_PERL_PLUGIN,               test x"$enable_perl_plugin" != xno)
2109 AM_CONDITIONAL(BUILD_PYTHON_PLUGIN,             test x"$enable_python_plugin" != xno)
2110 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN,            test x"$enable_pgpcore_plugin" != xno)
2111 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN,            test x"$enable_pgpmime_plugin" != xno)
2112 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN,          test x"$enable_pgpinline_plugin" != xno)
2113 AM_CONDITIONAL(BUILD_RSSYL_PLUGIN,              test x"$enable_rssyl_plugin" != xno)
2114 AM_CONDITIONAL(BUILD_SMIME_PLUGIN,              test x"$enable_smime_plugin" != xno)
2115 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN,       test x"$enable_spamassassin_plugin" != xno)
2116 AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN,        test x"$enable_spam_report_plugin" != xno)
2117 AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN,         test x"$enable_tnef_parse_plugin" != xno)
2118 AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN,          test x"$enable_vcalendar_plugin" != xno)
2121 dnl ****************************
2122 dnl ** Final configure output **
2123 dnl ****************************
2125 AC_CONFIG_FILES([
2126 Makefile
2127 m4/Makefile
2128 po/Makefile.in
2129 src/common/version.h
2130 src/Makefile
2131 src/w32-resource.rc
2132 src/common/Makefile
2133 src/common/passcrypt.h
2134 src/common/tests/Makefile
2135 src/gtk/Makefile
2136 src/etpan/Makefile
2137 src/plugins/Makefile
2138 src/plugins/acpi_notifier/Makefile
2139 src/plugins/address_keeper/Makefile
2140 src/plugins/address_keeper/version.rc
2141 src/plugins/archive/Makefile
2142 src/plugins/att_remover/Makefile
2143 src/plugins/att_remover/version.rc
2144 src/plugins/attachwarner/Makefile
2145 src/plugins/attachwarner/version.rc
2146 src/plugins/bogofilter/Makefile
2147 src/plugins/bsfilter/Makefile
2148 src/plugins/bsfilter/version.rc
2149 src/plugins/clamd/Makefile
2150 src/plugins/clamd/libclamd/Makefile
2151 src/plugins/demo/Makefile
2152 src/plugins/dillo/Makefile
2153 src/plugins/fancy/Makefile
2154 src/plugins/fancy/version.rc
2155 src/plugins/fetchinfo/Makefile
2156 src/plugins/fetchinfo/version.rc
2157 src/plugins/gdata/Makefile
2158 src/plugins/keyword_warner/Makefile
2159 src/plugins/keyword_warner/version.rc
2160 src/plugins/litehtml_viewer/Makefile
2161 src/plugins/litehtml_viewer/version.rc
2162 src/plugins/litehtml_viewer/litehtml/Makefile
2163 src/plugins/libravatar/Makefile
2164 src/plugins/libravatar/version.rc
2165 src/plugins/mailmbox/Makefile
2166 src/plugins/mailmbox/version.rc
2167 src/plugins/managesieve/Makefile
2168 src/plugins/managesieve/version.rc
2169 src/plugins/newmail/Makefile
2170 src/plugins/notification/Makefile
2171 src/plugins/notification/version.rc
2172 src/plugins/notification/gtkhotkey/Makefile
2173 src/plugins/pdf_viewer/Makefile
2174 src/plugins/pdf_viewer/version.rc
2175 src/plugins/perl/Makefile
2176 src/plugins/perl/tools/Makefile
2177 src/plugins/python/Makefile
2178 src/plugins/python/examples/Makefile
2179 src/plugins/pgpcore/Makefile
2180 src/plugins/pgpcore/version.rc
2181 src/plugins/pgpmime/Makefile
2182 src/plugins/pgpmime/version.rc
2183 src/plugins/pgpinline/Makefile
2184 src/plugins/pgpinline/version.rc
2185 src/plugins/rssyl/Makefile
2186 src/plugins/rssyl/version.rc
2187 src/plugins/rssyl/tests/Makefile
2188 src/plugins/rssyl/libfeed/Makefile
2189 src/plugins/rssyl/libfeed/tests/Makefile
2190 src/plugins/smime/Makefile
2191 src/plugins/smime/version.rc
2192 src/plugins/spamassassin/Makefile
2193 src/plugins/spam_report/Makefile
2194 src/plugins/spam_report/version.rc
2195 src/plugins/tnef_parse/Makefile
2196 src/plugins/tnef_parse/version.rc
2197 src/plugins/vcalendar/Makefile
2198 src/plugins/vcalendar/version.rc
2199 src/tests/Makefile
2200 doc/Makefile
2201 doc/man/Makefile
2202 tools/Makefile
2203 config/Makefile
2204 manual/Makefile
2205 claws-mail.pc
2207 AC_OUTPUT
2209 dnl Output the configuration summary
2210 echo ""
2211 echo "$PACKAGE $VERSION"
2212 echo ""
2213 if test x"$enable_alternate_addressbook" = xyes; then
2214         echo "Using Address Book : Alternate experimental interface"
2215 else
2216         echo "Using Address Book : Original stable interface"
2217         echo "JPilot             : $enable_jpilot"
2218         echo "LDAP               : $enable_ldap"
2220 echo "gnuTLS             : $enable_gnutls"
2221 echo "iconv              : $am_cv_func_iconv"
2222 echo "compface           : $enable_compface"
2223 echo "IPv6               : $enable_ipv6"
2224 echo "enchant            : $enable_enchant"
2225 echo "IMAP4              : $enable_libetpan"
2226 echo "NNTP               : $enable_libetpan"
2227 echo "Crash dialog       : $enable_crash_dialog"
2228 echo "LibSM              : $enable_libsm"
2229 echo "DBUS               : $enable_dbus"
2230 echo "NetworkManager     : $enable_networkmanager"
2231 echo "Manual             : $enable_manual"
2232 echo "Generic UMPC code  : $enable_generic_umpc"
2233 echo "SVG support        : $enable_svg"
2234 echo "Config dir         : $ac_cv_with_config_dir"
2235 echo "Password crypto    : $pwd_crypto"
2236 echo "Unit tests         : $enable_tests"
2238 echo "Plugins"
2239 echo "   Built:"
2240 for plugin in $PLUGINS; do
2241 echo "            - $plugin"
2242 if test x"$plugin" = xnotification; then
2243         echo "                Features:"
2244         for notif_feature in $notification_features; do
2245                 echo "                    $notif_feature"
2246         done;
2247         if test "x$notification_missing_dependencies" != x; then
2248                 echo "                Disabled due to missing dependencies:"
2249                 for notif_miss_dep in $notification_missing_dependencies; do
2250                         echo "                    $notif_miss_dep"
2251                 done;
2252         fi
2254 done;
2255 if test "x$DISABLED_PLUGINS" != x; then
2256 echo "   Disabled:"
2257 for plugin in $DISABLED_PLUGINS; do
2258 echo "            - $plugin"
2259 done;
2262 if test "x$MISSING_DEPS_PLUGINS" != x; then
2263 echo "   Disabled due to missing dependencies:"
2264 for plugin in $MISSING_DEPS_PLUGINS; do
2265 echo "            - $plugin"
2266 done;
2268 echo ""
2269 echo "The binary will be installed in $prefix/bin"
2270 echo ""
2271 echo "Configure finished, type 'make' to build."