optionally (via hidden pref) use bold font in summaryview for 'marked' messages
[claws.git] / configure.ac
blobcf55d809bdcf2756688641f16ea7039b49d99a75
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(oauth2,
281                 [  --disable-oauth2                Do not build OAuth2 support],
282                     [enable_oauth2=$enableval], [enable_oauth2=yes])
284 AC_ARG_ENABLE(enchant,
285                 [  --disable-enchant               Do not build Enchant support for spell-checking],
286                 [enable_enchant=$enableval], [enable_enchant=yes])
288 AC_ARG_ENABLE(crash-dialog,
289                 [  --enable-crash-dialog           Build crash dialog],
290                 [enable_crash_dialog=$enableval], [enable_crash_dialog=no])
292 AC_ARG_ENABLE(generic-umpc,
293                 [  --enable-generic-umpc           Build generic UMPC code],
294                 [enable_generic_umpc=$enableval], [enable_generic_umpc=no])
296 AC_ARG_ENABLE(compface,
297                 [  --disable-compface              Do not build compface support for X-Face],
298                 [enable_compface=$enableval], [enable_compface=yes])
300 AC_ARG_ENABLE(pthread,
301                 [  --disable-pthread               Do not build pthread support],
302                 [enable_pthread=$enableval], [enable_pthread=yes])
304 AC_ARG_ENABLE(startup-notification,
305                 [  --disable-startup-notification  Do not startup notification support],
306                 [enable_startup_notification=$enableval], [enable_startup_notification=yes])
308 AC_ARG_ENABLE(dbus,
309                 [  --disable-dbus                  Do not build DBUS support],
310                 [enable_dbus=$enableval], [enable_dbus=yes])
312 AC_ARG_ENABLE(ldap,
313                 [  --disable-ldap                  Do not build LDAP support],
314                 [enable_ldap=$enableval], [enable_ldap=yes])
316 AC_ARG_ENABLE(jpilot,
317                 [  --disable-jpilot                Do not build JPilot support],
318                 [enable_jpilot=$enableval], [enable_jpilot=yes])
320 AC_ARG_ENABLE(networkmanager,
321                 [  --disable-networkmanager        Do not build NetworkManager support],
322                 [enable_networkmanager=$enableval], [enable_networkmanager=yes])
324 AC_ARG_ENABLE(libetpan,
325                 [  --disable-libetpan              Do not build libetpan support for IMAP4/NNTP],
326                 [enable_libetpan=$enableval], [enable_libetpan=yes])
328 AC_ARG_ENABLE(valgrind,
329                 [  --disable-valgrind              Do not build valgrind support for debugging],
330                 [enable_valgrind=$enableval], [enable_valgrind=yes])
332 AC_ARG_ENABLE(alternate-addressbook,
333                 [  --enable-alternate-addressbook  Build alternate external address book support],
334                 [enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
336 AC_ARG_ENABLE(svg,
337         [  --disable-svg                   Do not build SVG support],
338         [enable_svg=$enableval], [enable_svg=yes])
340 AC_ARG_ENABLE(tests,
341                                 [  --enable-tests                   Build unit tests],
342                                 [enable_tests=$enableval], [enable_tests=no])
344 manualdir='${docdir}/manual'
345 AC_ARG_WITH(manualdir,
346         [  --with-manualdir=DIR    Manual directory],
347         [manualdir="$withval"])
348 AC_SUBST(manualdir)
350 dnl ******************************
351 dnl ** Check for required tools **
352 dnl ** to build manuals         **
353 dnl ******************************
355 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
356 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
357 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
358 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
360 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
361 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
362 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
363 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
365 if test x"$enable_manual" = x"yes"; then
366     if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
367         -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
368             enable_manual=yes
369         else
370             enable_manual=no
371     fi
374 AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
376 dnl Set PACKAGE_DATA_DIR in config.h.
377 if test "x${datarootdir}" = 'x${prefix}/share'; then
378         if test "x${prefix}" = "xNONE"; then
379                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
380         else
381                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
382         fi
383 else
384         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
387 AC_CHECK_LIB(xpg4, setlocale)
389 SM_LIBS=""
390 dnl Check for LibSM
391 AC_MSG_CHECKING([whether to use LibSM])
392 if test x"$enable_libsm" = xyes; then
393         AC_MSG_RESULT(yes)
394         AC_CHECK_LIB(SM, SmcSaveYourselfDone,
395                 [SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
396                 $X_LIBS -lICE)
397         AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
398         if test x"$enable_libsm" = xyes; then
399                 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
400         else
401                 AC_MSG_RESULT(not found)
402                 AC_MSG_WARN([*** LibSM will not be supported ***])
403         fi
404 else
405         AC_MSG_RESULT(no)
407 AC_SUBST(SM_LIBS)
409 dnl Check for __VA_OPT__ macro
410 AC_CACHE_CHECK([for __VA_OPT__],
411         [ac_cv_va_opt],
412         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[#define va_opt_printf(format, ...) fprintf(stderr, format __VA_OPT__(,) __VA_ARGS__)
413                 va_opt_printf("success\n");]])],[ac_cv_va_opt=yes],[ac_cv_va_opt=no])]
415 if test "$ac_cv_va_opt" = yes; then
416         AC_DEFINE([HAVE_VA_OPT], [1], [Define if __VA_OPT__ macro works])
419 dnl Check for d_type member in struct dirent
420 AC_MSG_CHECKING([whether struct dirent has d_type member])
421 AC_CACHE_VAL(ac_cv_dirent_d_type,[
422         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])
424 AC_MSG_RESULT($ac_cv_dirent_d_type)
425 if test $ac_cv_dirent_d_type = yes; then
426         AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
427                   Define if `struct dirent' has `d_type' member.)
430 # Check whether mkdir does not take the permission argument.
431 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
433 dnl Checks for header files.
434 AC_HEADER_DIRENT
436 AC_HEADER_SYS_WAIT
437 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
438                  sys/param.h sys/utsname.h sys/select.h \
439                  wchar.h wctype.h locale.h netdb.h)
440 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
441 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
443 dnl Checks for typedefs, structures, and compiler characteristics.
444 AC_C_CONST
445 AC_TYPE_OFF_T
446 AC_TYPE_PID_T
447 AC_TYPE_SIZE_T
448 AC_STRUCT_TM
450 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
451 AC_CHECK_SIZEOF(unsigned short, 2)
452 AC_CHECK_SIZEOF(unsigned int, 4)
453 AC_CHECK_SIZEOF(unsigned long, 4)
455 dnl Checks for library functions.
456 AC_FUNC_ALLOCA
457 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr strcasestr \
458                uname flock lockf inet_aton inet_addr \
459                fchmod mkstemp truncate getuid regcomp)
461 AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
463 dnl *****************
464 dnl ** common code **
465 dnl *****************
467 dnl check for glib
468 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36 gmodule-2.0 >= 2.36 gobject-2.0 >= 2.36 gthread-2.0 >= 2.36])
470 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
471 AC_SUBST(GLIB_GENMARSHAL)
473 AC_SUBST(GLIB_CFLAGS)
474 AC_SUBST(GLIB_LIBS)
476 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
478 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
479 syl_save_LIBS=$LIBS
480 LIBS="$LIBS $GTK_LIBS"
481 AC_CHECK_FUNCS(bind_textdomain_codeset)
482 LIBS=$syl_save_LIBS
484 dnl check for IPv6 option
485 dnl automated checks for IPv6 support.
486 AC_MSG_CHECKING([whether to use IPv6])
487 if test x"$enable_ipv6" = xyes; then
488         AC_MSG_RESULT(yes)
489         AC_MSG_CHECKING([for IPv6 support])
490         if test x"$platform_win32" = xyes; then
491                 AC_CACHE_VAL(ac_cv_ipv6,[
492                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
493                                         #include <ws2tcpip.h>
494                                 ]], [[struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
495                 ])
496         else
497                 AC_CACHE_VAL(ac_cv_ipv6,[
498                         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
499                                         #define INET6
500                                         #include <sys/types.h>
501                                         #include <netinet/in.h>
502                                 ]], [[int x = IPPROTO_IPV6; struct in6_addr a;]])],[ac_cv_ipv6=yes],[ac_cv_ipv6=no])
503                 ])
504         fi
505         AC_MSG_RESULT($ac_cv_ipv6)
506         if test $ac_cv_ipv6 = yes; then
507                 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
508         else
509                 AC_MSG_WARN(*** IPv6 will not be supported ***)
510                 enable_ipv6=no
511         fi
512 else
513         AC_MSG_RESULT(no)
516 dnl GNUTLS
517 AC_MSG_CHECKING([whether to use GnuTLS])
518 AC_MSG_RESULT($enable_gnutls)
519 if test "x$enable_gnutls" != "xno"; then
520         PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
521         [
522                 AC_DEFINE(USE_GNUTLS, 1, gnutls)
523                 echo "Building with GnuTLS"
524                 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
525                 [
526                         dnl No linking against libgcrypt needed
527                 ],
528                 [
529                         dnl linking against libgcrypt *is* needed
530                         GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
531                 ])
532         ],
533         [
534                 echo "Building without GnuTLS"
535                 AC_MSG_RESULT([*** GnuTLS support is recommended ])
536                 AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
537                 AC_MSG_ERROR([GnuTLS not found])
538         ])
539         AC_SUBST(GNUTLS_LIBS)
540         AC_SUBST(GNUTLS_CFLAGS)
543 PKG_CHECK_MODULES(NETTLE, nettle)
544 AC_SUBST(NETTLE_LIBS)
546 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
547             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
548 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
550 dnl RC dir (will be default at a certain point in time)
551 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .claws-mail)],
552               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
554 dnl Set correct default value based on platform
555 if test x"$ac_cv_with_config_dir" = x""; then
556         if test x"$platform_win32" = xyes; then
557                 ac_cv_with_config_dir="Claws-mail"
558         else
559                 ac_cv_with_config_dir=".claws-mail"
560         fi
562 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
564 AC_ARG_WITH(password-encryption, [  --with-password-encryption=PROVIDER    Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
565                                                 pwd_crypto="$withval", pwd_crypto="default")
567 if test x"$pwd_crypto" = xdefault; then
568         if test x"$enable_gnutls" = xyes; then
569                 if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
570                         pwd_crypto="gnutls"
571                 fi
572         fi
574 if test x"$pwd_crypto" = xdefault; then
575         pwd_crypto="old"
578 case $pwd_crypto in
579         gnutls)
580                 if test x"$enable_gnutls" = xno; then
581                         AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
582                 fi
583                 if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
584                         AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
585                 fi
586                 AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
587                 ;;
588         old)
589                 AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
590                 ;;
591         *)
592                 AC_MSG_ERROR([Unknown password encryption provider requested.])
593                 ;;
594 esac
596 AC_MSG_CHECKING([whether GnuTLS support is present for OAuth2])
597 if test x"$enable_gnutls" = xyes; then
598         AC_MSG_RESULT([yes])
599         AC_MSG_CHECKING([whether to build OAuth2 support])
600         if test x"$enable_oauth2" = xyes; then
601                 AC_MSG_RESULT([yes])
602                 AC_DEFINE(USE_OAUTH2, 1, [Define if OAuth2 is to be activated.])
603         else
604                 AC_MSG_RESULT([no])
605                 enable_oauth2=no
606         fi
607 else
608         AC_MSG_RESULT([no])
609         enable_oauth2=no
612 dnl ************************
613 dnl ** GTK user interface **
614 dnl ************************
616 dnl Checks for GTK
617 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.20 cairo)
619 AC_ARG_ENABLE(deprecated,
620                 [  --disable-deprecated            Disable deprecated GTK functions],
621                 gtkdeprecated=$enableval)
622 AC_MSG_CHECKING([whether to use deprecated GTK functions])
623 if test x"$gtkdeprecated" != xno; then
624         AC_MSG_RESULT(yes)
625 else
626         GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
627         AC_MSG_RESULT(no)
630 dnl Make sure the code does not regress to using deprecated GTK stuff...
631 GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
633 AC_SUBST(GTK_CFLAGS)
634 AC_SUBST(GTK_LIBS)
636 dnl enchant is used for spell checking
637 AC_MSG_CHECKING([whether to use enchant])
638 AC_MSG_RESULT($enable_enchant)
639 if test $enable_enchant = yes; then
640         PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
641         [
642                 AC_DEFINE(USE_ENCHANT, 1, enchant)
643                 echo "Building with enchant"
644                 enable_enchant=yes
645         ],
646         [
647                 PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
648                 [
649                         AC_DEFINE(USE_ENCHANT, 1, enchant-2)
650                         echo "Building with enchant-2"
651                         enable_enchant=yes
652                 ],
653                 [
654                         echo "Building without enchant-notification"
655                         enable_enchant=no
656                 ])
657         ])
658         AC_SUBST(ENCHANT_CFLAGS)
659         AC_SUBST(ENCHANT_LIBS)
662 dnl want crash dialog
663 if test $enable_crash_dialog = yes; then
664 dnl check if GDB is somewhere
665         AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
666         AC_MSG_CHECKING([whether to use crash dialog])
667         if test $enable_crash_dialog = yes; then
668                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
669         fi
670         AC_MSG_RESULT($enable_crash_dialog)
673 dnl generic umpc
674 if test $enable_generic_umpc = yes; then
675         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
676         AC_MSG_RESULT($enable_generic_umpc)
679 dnl Check for X-Face support
680 AC_MSG_CHECKING([whether to use compface])
681 if test x"$enable_compface" = xyes; then
682         AC_MSG_RESULT(yes)
683         AC_CHECK_LIB(compface, uncompface,
684                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
685                 [enable_compface=no])
686         if test x"$enable_compface" = xyes; then
687                 COMPFACE_LIBS="-lcompface"
688         else
689                 COMPFACE_LIBS=""
690         fi
691         AC_SUBST(COMPFACE_LIBS)
692 else
693         AC_MSG_RESULT(no)
696 dnl check for pthread support
697 AC_MSG_CHECKING([whether to use pthread])
698 if test x$enable_pthread = xno; then
699         AC_MSG_RESULT(no)
700 else
701         AC_MSG_RESULT(yes)
703         # For W32 we need to use a special ptrhead lib. In this case we can't
704         # use AC_CHECK_LIB because it has no means of checking for a
705         # library installed under a different name.  Checking for the
706         # header is okay.
707         if test -n "${pthread_name}" ; then
708            enable_pthread=yes
709         else
710         AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
711         fi
712         AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
714         if test x$enable_pthread = xyes; then
715                 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
716                 if test -z "${pthread_name}" ; then
717                 PTHREAD_LIBS="-lpthread"
718         fi
719         fi
722 AC_SUBST(PTHREAD_LIBS)
725 dnl Check whether we need to pass -lresolv
726 dnl We know that we don't need it for W32.
728 if test x$os_win32 = xno; then
729   t_oldLibs="$LIBS"
730   LIBS="$LIBS"
731   ac_cv_var__res_options=no
732   AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
733              #include <sys/socket.h>
734              #include <netinet/in.h>
735              #include <arpa/nameser.h>
736              #include <resolv.h>]], [[_res.options = RES_INIT;]])],[ac_cv_var__res_options=yes],[]);
737   if test "$ac_cv_var__res_options" != "yes"; then
738         LIBRESOLV="-lresolv"
739   fi
740   LIBS="$t_oldLibs"
742   if test "x$LIBRESOLV" = "x"; then
743         AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
744         LIBS="$t_oldLibs"
745   fi
747 AC_SUBST(LIBRESOLV)
749 LIBS="$LIBS $LIBRESOLV"
751 dnl #######################################################################
752 dnl # Check for startup notification
753 dnl #######################################################################
754 if test "x$enable_startup_notification" = "xyes"; then
755         PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
756         [
757                 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
758                 echo "Building with libstartup-notification"
759                 enable_startup_notification=yes
760         ],
761         [
762                 echo "Building without libstartup-notification"
763                 enable_startup_notification=no
764         ])
766         AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
767         AC_SUBST(STARTUP_NOTIFICATION_LIBS)
770 dnl #######################################################################
771 dnl # Check for D-Bus support
772 dnl #######################################################################
773 if test "x$enable_dbus" = "xyes"; then
774         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
775         [
776                 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
777                 enable_dbus=yes
778         ],
779         [
780                 echo "D-Bus requirements not met. D-Bus support not activated."
781                 enable_dbus=no
782         ])
783         AC_SUBST(DBUS_CFLAGS)
784         AC_SUBST(DBUS_LIBS)
787 dnl #######################################################################
788 dnl # Configure address book support
789 dnl #######################################################################
791 dnl #######################################################################
792 dnl # Check for alternate address book support
793 dnl #######################################################################
794 AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
795 if test x"$enable_dbus" = xyes; then
796         AC_MSG_RESULT([yes])
797         AC_MSG_CHECKING([whether to enable alternate address book])
798         if test x"$enable_alternate_addressbook" = xyes; then
799                 AC_MSG_RESULT([yes])
800                 PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
801                 [
802                         AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
803                         enable_alternate_addressbook=yes
804                         AC_SUBST(CONTACTS_CFLAGS)
805                         AC_SUBST(CONTACTS_LIBS)
806                 ],
807                 [
808                         enable_alternate_addressbook=no
809                 ])
810         else
811                 AC_MSG_RESULT([no])
812                 enable_alternate_addressbook=no
813         fi
814 else
815         AC_MSG_RESULT([no])
816         enable_alternate_addressbook=no
819 dnl #######################################################################
820 dnl # Check for old address book support
821 dnl #######################################################################
822 if test x"$enable_alternate_addressbook" = xno; then
823         dnl for LDAP support in addressbook
824         dnl no check for libraries; dynamically loaded
825         AC_MSG_CHECKING([whether to use LDAP])
826         if test x"$enable_ldap" = xno; then
827                 AC_MSG_RESULT(no)
828         elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
829                 AC_MSG_RESULT(no - LDAP support needs pthread support)
831                 enable_ldap=no
832         elif test x"$platform_win32" = xyes; then
833                 AC_MSG_RESULT(yes)
834                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
835                 LDAP_LIBS="-lwldap32"
836                 AC_SUBST(LDAP_LIBS)
837         else
838                 AC_MSG_RESULT(yes)
840                 dnl check for available libraries, and pull them in
841                 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
842                 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
843                 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
844                 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
845                                  $LDAP_LIBS)
847                 AC_CHECK_HEADERS(ldap.h lber.h,
848                                  [ enable_ldap=yes ],
849                                  [ enable_ldap=no ])
851                 if test "$enable_ldap" = yes; then
852                         AC_CHECK_LIB(ldap, ldap_open,
853                                          [ enable_ldap=yes ],
854                                          [ enable_ldap=no ],
855                                          $LDAP_LIBS)
857                         AC_CHECK_LIB(ldap, ldap_start_tls_s,
858                                              [ ac_cv_have_tls=yes ],
859                                              [ ac_cv_have_tls=no ])
861                 fi
863                 AC_MSG_CHECKING([whether ldap library is available])
864                 AC_MSG_RESULT($enable_ldap)
866                 AC_MSG_CHECKING([whether TLS library is available])
867                 AC_MSG_RESULT($ac_cv_have_tls)
869                 if test "$enable_ldap" = yes; then
870                         AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
871                         LDAP_LIBS="$LDAP_LIBS -lldap"
872                         AC_SUBST(LDAP_LIBS)
873                         if test "$ac_cv_have_tls" = yes; then
874                                 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
875                         fi
876                         dnl As of OpenLDAP API version 3000 a number of functions has
877                         dnl been deprecated. As Claws-mail compiles and runs on many
878                         dnl platforms and many versions of OpenLDAP we need to be able
879                         dnl to switch between the old and new API because new API has
880                         dnl added new functions replacing old ones and at the same time
881                         dnl old functions has been changed.
882                         dnl If cross-compiling defaults to enable deprecated features
883                         dnl for maximum portability
884                         AC_MSG_CHECKING([The API version of OpenLDAP])
885                         AC_RUN_IFELSE(
886                                 [AC_LANG_PROGRAM(
887                                  [#include <ldap.h>],
888                                  [if (LDAP_API_VERSION >= 3000)
889                                                 return 1
890                                 ])],
891                                 [AC_MSG_RESULT([version < 3000])
892                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
893                                 [AC_MSG_RESULT([version >= 3000])
894                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
895                                 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
896                                  AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
897                                  AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
898                         )
899                 fi
900         fi
902         dnl for JPilot support in addressbook
903         dnl no check for libraries; these are dynamically loaded
904         AC_MSG_CHECKING([whether to use JPilot])
905         if test "$enable_jpilot" = yes; then
906                 AC_MSG_RESULT(yes)
907                 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
908                                  [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
909                                  [ enable_jpilot=no ])
910                 if test "$enable_jpilot" = no; then
911                         AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
912                                          [ enable_jpilot=yes
913                                            AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
914                 fi
916                 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
917                 if test x"$enable_jpilot" = xyes; then
918                         AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
919                 else
920                         AC_MSG_NOTICE([JPilot support not available])
921                 fi
922                 AC_SUBST(JPILOT_LIBS)
923         else
924                 AC_MSG_RESULT(no)
925         fi
928 AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
930 dnl #######################################################################
931 dnl # Check for NetworkManager support
932 dnl #######################################################################
933 if test x"$enable_dbus" = xyes; then
934         if test x"$enable_networkmanager" = xyes; then
935                 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
936                 [
937                         AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
938                         echo "Building with NetworkManager support"
939                         enable_networkmanager=yes
940                 ],
941                 [
942                         echo "NetworkManager not found."
943                         enable_networkmanager=no
944                 ])
945                 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
946         fi
947 else
948         echo "NetworkManager support deactivated as D-Bus requirements were not met."
949         enable_networkmanager=no
952 dnl Libetpan
953 AC_MSG_CHECKING([whether to use libetpan])
954 if test x"$enable_libetpan" = xyes; then
955     AC_MSG_RESULT(yes)
957     libetpan_config=no
958     libetpan_result=no
959     libetpan_versiontype=0
961     # since 1.9.4, libetpan uses pkg-config
962     PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
963     [
964         LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
965         libetpan_config=yes
966     ],
967     [
968         # before 1.9.4, libetpan uses its own libetpan-config script
969         AC_PATH_PROG(libetpanconfig, [libetpan-config])
970         if test "x$libetpanconfig" != "x"; then
971             LIBETPAN_CFLAGS="`$libetpanconfig --cflags`"
972             LIBETPAN_LIBS="`$libetpanconfig --libs`"
973             # support libetpan version like x.x and x.x.x
974             libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
975             if test $libetpan_versiontype -eq 1; then
976                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
977             else
978                 LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
979             fi
980             libetpan_config=yes
981         fi
982     ])
983     if test "x$libetpan_config" = "xyes"; then
984         AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
985         if test "x$libetpan_result" = "xyes"; then
986             AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
987             LIBS="$LIBS $LIBETPAN_LIBS"
988             AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libetpan/dbstorage.h>]], [[db_mailstorage_init(NULL, NULL);]])],[libetpan_result=yes],[libetpan_result=no])
989             AC_MSG_RESULT([$libetpan_result])
990         fi
991     fi
992     if test "x$libetpan_result" = "xyes"; then
993         if test $libetpan_versiontype -eq 1; then
994             if test "$LIBETPAN_VERSION" -lt "57"; then
995                 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
996                 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
997                 AC_MSG_ERROR([libetpan 0.57 not found])
998             fi
999         fi
1000         AC_SUBST(LIBETPAN_CFLAGS)
1001         AC_SUBST(LIBETPAN_LIBS)
1002         AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
1003     else
1004         AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
1005         AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1006         AC_MSG_ERROR([libetpan 0.57 not found])
1007     fi
1008 else
1009     AC_MSG_RESULT(no)
1011 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1013 dnl librsvg
1014 AC_MSG_CHECKING([whether to use librsvg])
1015 if test x"$enable_svg" = xyes; then
1016         AC_MSG_RESULT(yes)
1017     PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
1018     [
1019         AC_SUBST(SVG_CFLAGS)
1020         AC_SUBST(SVG_LIBS)
1021                 AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
1022                 enable_svg=yes
1023         ],
1024         [
1025                 AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
1026                 enable_svg=no
1027         ])
1028 else
1029         AC_MSG_RESULT(no)
1032 AC_MSG_CHECKING([whether to use valgrind])
1033 if test x$enable_valgrind = xyes; then
1034         AC_MSG_RESULT(yes)
1035         PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1036                           enable_valgrind=yes, enable_valgrind=no)
1037         if test x"$enable_valgrind" = xyes; then
1038                 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1039         else
1040                 AC_MSG_RESULT(not found)
1041         fi
1042 else
1043         AC_MSG_RESULT(no)
1045 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
1047 AC_MSG_CHECKING([whether to build unit tests])
1048 if test x$enable_tests = xyes; then
1049         AC_MSG_RESULT(yes)
1050 else
1051         AC_MSG_RESULT(no)
1053 AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
1055 dnl *************************
1056 dnl ** section for plugins **
1057 dnl *************************
1059 PLUGINS=""
1060 DISABLED_PLUGINS=""
1061 MISSING_DEPS_PLUGINS=""
1063 dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
1064 dnl or (auto-)disabled (no for both)
1066 dnl All plugins are auto-enabled except for Demo which is just there to help
1067 dnl potential plugins writers.
1069 AC_ARG_ENABLE(acpi_notifier-plugin,
1070                 [  --disable-acpi_notifier-plugin  Do not build acpi_notifier plugin],
1071                 [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
1073 AC_ARG_ENABLE(address_keeper-plugin,
1074                 [  --disable-address_keeper-plugin Do not build address_keeper plugin],
1075                 [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
1077 AC_ARG_ENABLE(archive-plugin,
1078                 [  --disable-archive-plugin        Do not build archive plugin],
1079                 [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
1081 AC_ARG_ENABLE(att_remover-plugin,
1082                 [  --disable-att_remover-plugin    Do not build att_remover plugin],
1083                 [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
1085 AC_ARG_ENABLE(attachwarner-plugin,
1086                 [  --disable-attachwarner-plugin   Do not build attachwarner plugin],
1087                 [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
1089 AC_ARG_ENABLE(bogofilter-plugin,
1090                 [  --disable-bogofilter-plugin     Do not build bogofilter plugin],
1091                 [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
1093 AC_ARG_ENABLE(bsfilter-plugin,
1094                 [  --disable-bsfilter-plugin       Do not build bsfilter plugin],
1095                 [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
1097 AC_ARG_ENABLE(clamd-plugin,
1098                 [  --disable-clamd-plugin          Do not build clamd plugin],
1099                 [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
1101 AC_ARG_ENABLE(dillo-plugin,
1102                 [  --disable-dillo-plugin          Do not build dillo plugin],
1103                 [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
1105 AC_ARG_ENABLE(fancy-plugin,
1106                 [  --disable-fancy-plugin          Do not build fancy plugin],
1107                 [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
1109 AC_ARG_ENABLE(fetchinfo-plugin,
1110                 [  --disable-fetchinfo-plugin      Do not build fetchinfo plugin],
1111                 [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
1113 AC_ARG_ENABLE(gdata-plugin,
1114                 [  --disable-gdata-plugin          Do not build gdata plugin],
1115                 [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
1117 AC_ARG_ENABLE(keyword_warner-plugin,
1118                 [  --disable-keyword_warner-plugin   Do not build keyword_warner plugin],
1119                 [enable_keyword_warner_plugin=$enableval], [enable_keyword_warner_plugin=auto])
1121 AC_ARG_ENABLE(libravatar-plugin,
1122                 [  --disable-libravatar-plugin     Do not build libravatar  plugin],
1123                 [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
1125 AC_ARG_ENABLE(litehtml_viewer-plugin,
1126                 [  --disable-litehtml_viewer-plugin       Do not build litehtml_viewer plugin],
1127                 [enable_litehtml_viewer_plugin=$enableval], [enable_litehtml_viewer_plugin=auto])
1129 AC_ARG_ENABLE(mailmbox-plugin,
1130                 [  --disable-mailmbox-plugin       Do not build mailmbox plugin],
1131                 [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
1133 AC_ARG_ENABLE(managesieve-plugin,
1134                 [  --disable-managesieve-plugin    Do not build managesieve plugin],
1135                 [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
1137 AC_ARG_ENABLE(newmail-plugin,
1138                 [  --disable-newmail-plugin        Do not build newmail plugin],
1139                 [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
1141 AC_ARG_ENABLE(notification-plugin,
1142                 [  --disable-notification-plugin   Do not build notification plugin],
1143                 [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
1145 AC_ARG_ENABLE(pdf_viewer-plugin,
1146                 [  --disable-pdf_viewer-plugin     Do not build pdf_viewer plugin],
1147                 [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
1149 AC_ARG_ENABLE(perl-plugin,
1150                 [  --disable-perl-plugin           Do not build perl plugin],
1151                 [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
1153 AC_ARG_ENABLE(python-plugin,
1154                 [  --disable-python-plugin         Do not build python plugin],
1155                 [enable_python_plugin=$enableval], [enable_python_plugin=auto])
1157 AC_ARG_ENABLE(pgpcore-plugin,
1158                 [  --disable-pgpcore-plugin        Do not build pgpcore plugin],
1159                 [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
1161 AC_ARG_ENABLE(pgpmime-plugin,
1162                 [  --disable-pgpmime-plugin        Do not build pgpmime plugin],
1163                 [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
1165 AC_ARG_ENABLE(pgpinline-plugin,
1166                 [  --disable-pgpinline-plugin      Do not build pgpinline plugin],
1167                 [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
1169 AC_ARG_ENABLE(rssyl-plugin,
1170                 [  --disable-rssyl-plugin          Do not build rssyl plugin],
1171                 [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
1173 AC_ARG_ENABLE(smime-plugin,
1174                 [  --disable-smime-plugin          Do not build smime plugin],
1175                 [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
1177 AC_ARG_ENABLE(spamassassin-plugin,
1178                 [  --disable-spamassassin-plugin   Do not build spamassassin plugin],
1179                 [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
1181 AC_ARG_ENABLE(spam_report-plugin,
1182                 [  --disable-spam_report-plugin    Do not build spam_report plugin],
1183                 [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
1185 AC_ARG_ENABLE(tnef_parse-plugin,
1186                 [  --disable-tnef_parse-plugin     Do not build tnef_parse plugin],
1187                 [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
1189 AC_ARG_ENABLE(vcalendar-plugin,
1190                 [  --disable-vcalendar-plugin      Do not build vcalendar plugin],
1191                 [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
1193 dnl disabled by default
1194 AC_ARG_ENABLE(demo-plugin,
1195                 [  --enable-demo-plugin            Build demo plugin],
1196                 [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
1199 dnl Then we check (unconditionnaly) for plugins dependencies
1200 dnl Some dependencies are optional, some mandatory. This is taken care of
1201 dnl later.
1203 dnl During this dependancy check we do the checks themselves, define HAVE_X to
1204 dnl either yes or no, and do the AC_SUBST calls.
1206 dnl Archive:            libarchive
1207 dnl Fancy:              Webkit, curl, optionally libsoup-gnome
1208 dnl Gdata:              libgdata
1209 dnl Litehtml            a C++ compiler, >=glib-2.36, cairo, fontconfig, gumbo, curl
1210 dnl Libravatar:         libcurl
1211 dnl Notification:       optionally libnotify  unity/messaging-menu
1212 dnl                                libcanberra_gtk3 hotkey
1213 dnl Pdf-Viewer:         libpoppler
1214 dnl Perl:               sed perl
1215 dnl PGP/Core:           libgpgme
1216 dnl PGP/Mime:           pgpcore libgpgme
1217 dnl PGP/Inline:         pgpcore libgpgme
1218 dnl S/Mime:             pgpcore libgpgme
1219 dnl Python:             Python
1220 dnl RSSyl:              expat libcurl
1221 dnl SpamReport:         libcurl
1222 dnl vCalendar:          libcurl, libical
1223 dnl tnef_parse:         libytnef
1225 dnl libcurl ********************************************************************
1226 PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
1227 AC_SUBST(CURL_LIBS)
1228 AC_SUBST(CURL_CFLAGS)
1230 dnl expat **********************************************************************
1231 PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
1233 if test x"$HAVE_EXPAT" = xno; then
1234         AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
1235         AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
1236         if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
1237                 HAVE_EXPAT=yes
1238                 EXPAT_CFLAGS=""
1239                 EXPAT_LIBS="-lexpat"
1240         fi
1243 AC_SUBST(EXPAT_CFLAGS)
1244 AC_SUBST(EXPAT_LIBS)
1246 dnl webkit *********************************************************************
1247 PKG_CHECK_MODULES(WEBKIT, webkit2gtk-4.0 >= 2.18.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
1248 AC_SUBST(WEBKIT_LIBS)
1249 AC_SUBST(WEBKIT_CFLAGS)
1251 dnl libsoup ********************************************************************
1252 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
1253 if test x"$HAVE_LIBSOUP" = xyes; then
1254         AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
1256 AC_SUBST(LIBSOUP_CFLAGS)
1257 AC_SUBST(LIBSOUP_LIBS)
1259 dnl libsoup-gnome **************************************************************
1260 PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
1261 if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
1262         AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
1264 AC_SUBST(LIBSOUP_GNOME_CFLAGS)
1265 AC_SUBST(LIBSOUP_GNOME_LIBS)
1267 dnl libarchive *****************************************************************
1268 PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
1269 AC_SUBST(ARCHIVE_LIBS)
1270 AC_SUBST(ARCHIVE_CFLAGS)
1271 AC_CHECK_LIB([archive], [archive_read_new],
1272                        ARCHIVE_LIBS=-larchive
1273                        HAVE_ARCHIVE=yes
1274                        AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
1275                        HAVE_ARCHIVE=no
1276                        )
1278 dnl libgdata *******************************************************************
1279 PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
1280 AC_SUBST(GDATA_CFLAGS)
1281 AC_SUBST(GDATA_LIBS)
1283 dnl cairo **********************************************************************
1284 PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
1285 AC_SUBST(CAIRO_CFLAGS)
1286 AC_SUBST(CAIRO_LIBS)
1288 dnl fontconfig *****************************************************************
1289 PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no)
1290 AC_SUBST(FONTCONFIG_CFLAGS)
1291 AC_SUBST(FONTCONFIG_LIBS)
1293 dnl gumbo **********************************************************************
1294 PKG_CHECK_MODULES(LIBGUMBO, gumbo >= 0.10, HAVE_LIBGUMBO=yes, HAVE_LIBGUMBO=no)
1295 AC_SUBST(LIBGUMBO_CFLAGS)
1296 AC_SUBST(LIBGUMBO_LIBS)
1298 dnl libical ********************************************************************
1299 PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
1300 AC_SUBST(LIBICAL_CFLAGS)
1301 AC_SUBST(LIBICAL_LIBS)
1303 dnl Poppler ********************************************************************
1304 PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
1305 AC_SUBST(POPPLER_LIBS)
1306 AC_SUBST(POPPLER_CFLAGS)
1308 dnl check for Poppler extra features that we conditionally support
1309 if test x"$HAVE_POPPLER" = xyes; then
1310         OLD_CFLAGS=$CFLAGS
1311         CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
1312         AC_CHECK_DECL(POPPLER_DEST_NAMED,
1313                 [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
1314                 ,[#include <poppler-action.h>])
1315         AC_CHECK_DECL(POPPLER_DEST_XYZ,
1316                 [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
1317                 ,[#include <poppler-action.h>])
1318         CFLAGS=$OLD_CFLAGS
1321 dnl perl ***********************************************************************
1322 AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
1323 if test x"$HAVE_PERL" = xyes; then
1324         AC_MSG_CHECKING(for perl >= 5.8.0)
1325         PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
1326         if test "$PERL_VER" = "yes"; then
1327                 AC_MSG_RESULT(yes)
1328         else
1329                 AC_MSG_RESULT(no)
1330                 HAVE_PERL=no
1331         fi
1333 if test x"$HAVE_PERL" = xyes; then
1334         AC_MSG_CHECKING(for Perl compile flags)
1335         PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
1336         PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
1337         PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
1338         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
1339         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
1340         PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
1341         AC_MSG_RESULT(ok)
1342         AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
1343         
1344         if test x"$HAVE_PERL" = xyes; then
1345                 AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)], 
1346                                              [ HAVE_LIBPERL=no ])
1347         fi
1348         if test x"$HAVE_LIBPERL" = xno; then
1349                 LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
1350                 LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
1351                 AC_MSG_CHECKING([for libperl.so])
1352                 if test -f "$LIBPERL_PREFIX/libperl.so"; then
1353                         AC_MSG_RESULT(yes)
1354                         HAVE_LIBPERL=yes
1355                 else
1356                         AC_MSG_RESULT(no)
1357                 fi      
1358         fi
1359         PERL="perl"
1360         AC_SUBST(PERL)
1361         AC_SUBST(PERL_CFLAGS)
1362         AC_SUBST(PERL_LDFLAGS)
1365 dnl Gpgme **********************************************************************
1366 AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
1367 if test x"$HAVE_GPGME" = xyes; then
1368         AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
1369         AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
1372 dnl Python *********************************************************************
1373 PKG_CHECK_MODULES(PYTHON, python3, HAVE_PYTHON=yes, HAVE_PYTHON=no)
1374 PKG_CHECK_MODULES(PYTHONEMBED, python3-embed, HAVE_PYTHONEMBED=yes, HAVE_PYTHONEMBED=no)
1375 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0, HAVE_PYGOBJ=yes, HAVE_PYGOBJ=no)
1377 AC_SUBST(PYTHON_SHARED_LIB)
1378 AC_SUBST(PYTHON_CFLAGS)
1379 AC_SUBST(PYTHON_LIBS)
1380 AC_SUBST(PYTHONEMBED_SHARED_LIB)
1381 AC_SUBST(PYTHONEMBED_CFLAGS)
1382 AC_SUBST(PYTHONEMBED_LIBS)
1383 AC_SUBST(PYGOBJECT_CFLAGS)
1384 AC_SUBST(PYGOBJECT_LIBS)
1386 dnl libnotify ******************************************************************
1387 PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
1388 if test x"$HAVE_LIBNOTIFY" = xyes; then
1389         AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
1391 AC_SUBST(libnotify_CFLAGS)
1392 AC_SUBST(libnotify_LIBS)
1394 dnl libcanberra-gtk3 ************************************************************
1395 PKG_CHECK_MODULES(libcanberra_gtk3, libcanberra-gtk3, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
1396 if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1397         AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk3 support is enabled])
1399 AC_SUBST(libcanberra_gtk3_CFLAGS)
1400 AC_SUBST(libcanberra_gtk3_LIBS)
1402 dnl unity/messaging-menu *******************************************************
1403 PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
1404 if test x"$HAVE_UNITY" = xyes; then
1405         AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
1407 AC_SUBST(unity_CFLAGS)
1408 AC_SUBST(unity_LIBS)
1410 dnl hotkeys ********************************************************************
1411 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)
1412 if test x"$HAVE_HOTKEYS" = xyes; then
1413         AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
1415 AC_SUBST(CM_NP_HOTKEY_CFLAGS)
1416 AC_SUBST(CM_NP_HOTKEY_LIBS)
1418 dnl libytnef *******************************************************************
1419 YTNEF_CFLAGS=""
1420 YTNEF_LIBS=""
1421 have_ytnef=0
1422 # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
1423 # accordingly
1424 AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
1425 if test $have_ytnef -eq 0; then
1426         AC_CHECK_HEADER(libytnef/ytnef.h,
1427                                                                         [have_ytnef=1;
1428                                                                          YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
1429                                                                         [have_ytnef=0])
1431 if test $have_ytnef -eq 1; then
1432         AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
1433         # Now we have to figure out which libytnef version we're using,
1434         # based on whether SwapDDWord takes one argument or two.
1435         if test "x${YTNEF_CFLAGS}" = "x"; then
1436                 ytnef_include="#include <ytnef.h>"
1437         else
1438                 ytnef_include="#include <libytnef/ytnef.h>"
1439         fi
1440         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
1441                                                                         ${ytnef_include}]], [[SwapDDWord(0, 0);]])],[have_ytnef=1],[have_ytnef=0])
1442         if test $have_ytnef -eq 0; then
1443                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
1444                                                                                 ${ytnef_include}]], [[SwapDDWord(0);]])],[have_ytnef=1;
1445                                                                                  YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],[have_ytnef=0])
1446         fi
1447         if test $have_ytnef -eq 1; then
1448                 YTNEF_LIBS="-lytnef"
1449                 AC_MSG_RESULT(ok)
1450         else
1451                 AC_MSG_RESULT(no idea, unsupported libytnef version?)
1452         fi
1454 AC_SUBST(YTNEF_CFLAGS)
1455 AC_SUBST(YTNEF_LIBS)
1457 dnl Third, we now cross the requested plugins and the available dependencies
1458 dnl If some dependencies are missing and the plugin was explicitely enabled,
1459 dnl we error out, else we only inform.
1461 AC_MSG_CHECKING([whether to build acpi_notifier plugin])
1462 if test x"$enable_acpi_notifier_plugin" != xno; then
1463         PLUGINS="$PLUGINS acpi_notifier"
1464         AC_MSG_RESULT(yes)
1465 else
1466         DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
1467         AC_MSG_RESULT(no)
1470 AC_MSG_CHECKING([whether to build address_keeper plugin])
1471 if test x"$enable_address_keeper_plugin" != xno; then
1472         PLUGINS="$PLUGINS address_keeper"
1473         AC_MSG_RESULT(yes)
1474 else
1475         DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
1476         AC_MSG_RESULT(no)
1479 AC_MSG_CHECKING([whether to build archive plugin])
1480 if test x"$enable_archive_plugin" != xno; then
1481         dependencies_missing=""
1483         if test x"$HAVE_ARCHIVE" = xno; then
1484                 dependencies_missing="libarchive $dependencies_missing"
1485         fi
1487         if test x"$dependencies_missing" = x; then
1488                 PLUGINS="$PLUGINS archive"
1489                 AC_MSG_RESULT(yes)
1490         elif test x"$enable_archive_plugin" = xauto; then
1491                 AC_MSG_RESULT(no)
1492                 AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
1493                 enable_archive_plugin=no
1494                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
1495         else
1496                 AC_MSG_RESULT(no)
1497                 AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
1498         fi
1499 else
1500         DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
1501         AC_MSG_RESULT(no)
1504 AC_MSG_CHECKING([whether to build att_remover plugin])
1505 if test x"$enable_att_remover_plugin" != xno; then
1506         PLUGINS="$PLUGINS att_remover"
1507         AC_MSG_RESULT(yes)
1508 else
1509         DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
1510         AC_MSG_RESULT(no)
1513 AC_MSG_CHECKING([whether to build attachwarner plugin])
1514 if test x"$enable_attachwarner_plugin" != xno; then
1515         PLUGINS="$PLUGINS attachwarner"
1516         AC_MSG_RESULT(yes)
1517 else
1518         DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
1519         AC_MSG_RESULT(no)
1522 AC_MSG_CHECKING([whether to build bogofilter plugin])
1523 if test x"$enable_bogofilter_plugin" != xno; then
1524         PLUGINS="$PLUGINS bogofilter"
1525         AC_MSG_RESULT(yes)
1526 else
1527         DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
1528         AC_MSG_RESULT(no)
1531 AC_MSG_CHECKING([whether to build bsfilter plugin])
1532 if test x"$enable_bsfilter_plugin" != xno; then
1533         PLUGINS="$PLUGINS bsfilter"
1534         AC_MSG_RESULT(yes)
1535 else
1536         DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
1537         AC_MSG_RESULT(no)
1540 AC_MSG_CHECKING([whether to build clamd plugin])
1541 if test x"$enable_clamd_plugin" != xno; then
1542         PLUGINS="$PLUGINS clamd"
1543         AC_MSG_RESULT(yes)
1544 else
1545         DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
1546         AC_MSG_RESULT(no)
1549 AC_MSG_CHECKING([whether to build demo plugin])
1550 if test x"$enable_demo_plugin" != xno; then
1551         PLUGINS="$PLUGINS demo"
1552         AC_MSG_RESULT(yes)
1553 else
1554         DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
1555         AC_MSG_RESULT(no)
1558 AC_MSG_CHECKING([whether to build Dillo plugin])
1559 if test x"$enable_dillo_plugin" != xno; then
1560         PLUGINS="$PLUGINS dillo"
1561         AC_MSG_RESULT(yes)
1562 else
1563         DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
1564         AC_MSG_RESULT(no)
1567 AC_MSG_CHECKING([whether to build fancy plugin])
1568 if test x"$enable_fancy_plugin" != xno; then
1569         dependencies_missing=""
1571         if test x"$HAVE_WEBKIT" = xno; then
1572                 dependencies_missing="libwebkit2gtk-4.0 $dependencies_missing"
1573         fi
1574         if test x"$HAVE_CURL" = xno; then
1575                 dependencies_missing="libcurl $dependencies_missing"
1576         fi
1578         if test x"$dependencies_missing" = x; then
1579                 PLUGINS="$PLUGINS fancy"
1580                 AC_MSG_RESULT(yes)
1581         elif test x"$enable_fancy_plugin" = xauto; then
1582                 AC_MSG_RESULT(no)
1583                 AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
1584                 enable_fancy_plugin=no
1585                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
1586         else
1587                 AC_MSG_RESULT(no)
1588                 AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
1589         fi
1590 else
1591         DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
1592         AC_MSG_RESULT(no)
1595 AC_MSG_CHECKING([whether to build fetchinfo plugin])
1596 if test x"$enable_fetchinfo_plugin" != xno; then
1597         PLUGINS="$PLUGINS fetchinfo"
1598         AC_MSG_RESULT(yes)
1599 else
1600         DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
1601         AC_MSG_RESULT(no)
1604 AC_MSG_CHECKING([whether to build gdata plugin])
1605 if test x"$enable_gdata_plugin" != xno; then
1606         dependencies_missing=""
1608         if test x"$HAVE_GDATA" = xno; then
1609                 dependencies_missing="libgdata $dependencies_missing"
1610         fi
1612         if test x"$dependencies_missing" = x; then
1613                 PLUGINS="$PLUGINS gdata"
1614                 AC_MSG_RESULT(yes)
1615         elif test x"$enable_gdata_plugin" = xauto; then
1616                 AC_MSG_RESULT(no)
1617                 AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
1618                 enable_gdata_plugin=no
1619                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
1620         else
1621                 AC_MSG_RESULT(no)
1622                 AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
1623         fi
1624 else
1625         DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
1626         AC_MSG_RESULT(no)
1629 AC_MSG_CHECKING([whether to build keyword_warner plugin])
1630 if test x"$enable_keyword_warner_plugin" != xno; then
1631         PLUGINS="$PLUGINS keyword_warner"
1632         AC_MSG_RESULT(yes)
1633 else
1634         DISABLED_PLUGINS="$DISABLED_PLUGINS keyword_warner"
1635         AC_MSG_RESULT(no)
1638 AC_MSG_CHECKING([whether to build libravatar plugin])
1639 if test x"$enable_libravatar_plugin" != xno; then
1640         dependencies_missing=""
1642         if test x"$HAVE_CURL" = xno; then
1643                 dependencies_missing="libcurl $dependencies_missing"
1644         fi
1646         if test x"$dependencies_missing" = x; then
1647                 PLUGINS="$PLUGINS libravatar"
1648                 AC_MSG_RESULT(yes)
1649         elif test x"$enable_libravatar_plugin" = xauto; then
1650                 AC_MSG_RESULT(no)
1651                 AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
1652                 enable_libravatar_plugin=no
1653                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
1654         else
1655                 AC_MSG_RESULT(no)
1656                 AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
1657         fi
1658 else
1659         DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
1660         AC_MSG_RESULT(no)
1663 AC_MSG_CHECKING([whether to build litehtml_viewer plugin])
1664 if test x"$enable_litehtml_viewer_plugin" != xno; then
1665         dependencies_missing=""
1667         if test x"$HAVE_CXX" = xno; then
1668                 dependencies_missing="C++ compiler $dependencies_missing"
1669         fi
1670         PKG_CHECK_EXISTS([glib-2.0 >= 2.36], [],
1671                 [dependencies_missing="glib-2.0 >= 2.36 $dependencies_missing"])
1672         if test x"$HAVE_CAIRO" = xno; then
1673                 dependencies_missing="cairo $dependencies_missing"
1674         fi
1675         if test x"$HAVE_FONTCONFIG" = xno; then
1676                 dependencies_missing="fontconfig $dependencies_missing"
1677         fi
1678         if test x"$HAVE_LIBGUMBO" = xno; then
1679                 dependencies_missing="libgumbo $dependencies_missing"
1680         fi
1681         if test x"$HAVE_CURL" = xno; then
1682                 dependencies_missing="libcurl $dependencies_missing"
1683         fi
1686         if test x"$dependencies_missing" = x; then
1687                 PLUGINS="$PLUGINS litehtml_viewer"
1688                 AC_MSG_RESULT(yes)
1689         elif test x"$enable_litehtml_viewer_plugin" = xauto; then
1690                 AC_MSG_RESULT(no)
1691                 AC_MSG_WARN("Plugin litehtml_viewer will not be built; missing $dependencies_missing")
1692                 enable_litehtml_viewer_plugin=no
1693                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS litehtml_viewer"
1694         else
1695                 AC_MSG_RESULT(no)
1696                 AC_MSG_ERROR("Plugin litehtml_viewer cannot be built; missing $dependencies_missing")
1697         fi
1698 else
1699         DISABLED_PLUGINS="$DISABLED_PLUGINS litehtml_viewer"
1700         AC_MSG_RESULT(no)
1703 AC_MSG_CHECKING([whether to build mailmbox plugin])
1704 if test x"$enable_mailmbox_plugin" != xno; then
1705         PLUGINS="$PLUGINS mailmbox"
1706         AC_MSG_RESULT(yes)
1707 else
1708         DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
1709         AC_MSG_RESULT(no)
1712 AC_MSG_CHECKING([whether to build managesieve plugin])
1713 if test x"$enable_managesieve_plugin" != xno; then
1714         PLUGINS="$PLUGINS managesieve"
1715         AC_MSG_RESULT(yes)
1716 else
1717         DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
1718         AC_MSG_RESULT(no)
1721 AC_MSG_CHECKING([whether to build newmail plugin])
1722 if test x"$enable_newmail_plugin" != xno; then
1723         PLUGINS="$PLUGINS newmail"
1724         AC_MSG_RESULT(yes)
1725 else
1726         DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
1727         AC_MSG_RESULT(no)
1730 AC_MSG_CHECKING([whether to build notification plugin])
1731 if test x"$enable_notification_plugin" != xno; then
1732         PLUGINS="$PLUGINS notification"
1733         AC_MSG_RESULT(yes)
1735         AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
1736         AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
1737         AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
1738         AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
1739         if test x"$platform_win32" = xno; then
1740                 AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
1741         fi
1743         notification_features="banner command"
1744         notification_missing_dependencies=""
1745         if test x"$HAVE_HOTKEYS" = xyes; then
1746                 notification_features="$notification_features hotkeys"
1747         else
1748                 notification_missing_dependencies="$notification_missing_dependencies hotkeys"
1749         fi
1750         notification_features="$notification_features lcdproc"
1751         if test x"$HAVE_UNITY" = xyes; then
1752                 notification_features="$notification_features unity/messaging-menu"
1753         else
1754                 notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
1755         fi
1756         if test x"$HAVE_LIBNOTIFY" = xyes; then
1757                 notification_features="$notification_features libnotify"
1758         else
1759                 notification_missing_dependencies="$notification_missing_dependencies libnotify"
1760         fi
1761         if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
1762                 notification_features="$notification_features libcanberra-gtk3"
1763         else
1764                 notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk3"
1765         fi
1766         notification_features="$notification_features popup trayicon"
1767 else
1768         DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
1769         AC_MSG_RESULT(no)
1772 AC_MSG_CHECKING([whether to build pdf_viewer plugin])
1773 if test x"$enable_pdf_viewer_plugin" != xno; then
1774         dependencies_missing=""
1776         if test x"$HAVE_POPPLER" = xno; then
1777                 dependencies_missing="libpoppler-glib $dependencies_missing"
1778         fi
1780         if test x"$dependencies_missing" = x; then
1781                 PLUGINS="$PLUGINS pdf_viewer"
1782                 AC_MSG_RESULT(yes)
1783         elif test x"$enable_pdf_viewer_plugin" = xauto; then
1784                 AC_MSG_RESULT(no)
1785                 AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
1786                 enable_pdf_viewer_plugin=no
1787                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
1788         else
1789                 AC_MSG_RESULT(no)
1790                 AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
1791         fi
1792 else
1793         DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
1794         AC_MSG_RESULT(no)
1797 AC_MSG_CHECKING([whether to build perl plugin])
1798 if test x"$enable_perl_plugin" != xno; then
1799         dependencies_missing=""
1801         if test x"$HAVE_LIBPERL" = xno; then
1802                 dependencies_missing="libperl $dependencies_missing"
1803         fi
1805         if test x"$dependencies_missing" = x; then
1806                 PLUGINS="$PLUGINS perl"
1807                 AC_MSG_RESULT(yes)
1808         elif test x"$enable_perl_plugin" = xauto; then
1809                 AC_MSG_RESULT(no)
1810                 AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
1811                 enable_perl_plugin=no
1812                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
1813         else
1814                 AC_MSG_RESULT(no)
1815                 AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
1816         fi
1817 else
1818         DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
1819         AC_MSG_RESULT(no)
1822 AC_MSG_CHECKING([whether to build python plugin])
1823 if test x"$enable_python_plugin" != xno; then
1824         dependencies_missing=""
1826         if test x"$HAVE_PYTHON" = xno; then
1827                 dependencies_missing="python3 $dependencies_missing"
1828         fi
1829         if test x"$HAVE_PYGOBJ" = xno; then
1830                 dependencies_missing="pygobject-3.0 $dependencies_missing"
1831         fi
1833         if test x"$dependencies_missing" = x; then
1834                 PLUGINS="$PLUGINS python"
1835                 AC_MSG_RESULT(yes)
1836         elif test x"$enable_python_plugin" = xauto; then
1837                 AC_MSG_RESULT(no)
1838                 AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
1839                 enable_python_plugin=no
1840                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
1841         else
1842                 AC_MSG_RESULT(no)
1843                 AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
1844         fi
1845 else
1846         DISABLED_PLUGINS="$DISABLED_PLUGINS python"
1847         AC_MSG_RESULT(no)
1850 AC_MSG_CHECKING([whether to build pgpcore plugin])
1851 if test x"$enable_pgpcore_plugin" != xno; then
1852         dependencies_missing=""
1854         if test x"$HAVE_GPGME" = xno; then
1855                 dependencies_missing="libgpgme $dependencies_missing"
1856         fi
1858         if test x"$dependencies_missing" = x; then
1859                 PLUGINS="$PLUGINS pgpcore"
1860                 AC_MSG_RESULT(yes)
1861         elif test x"$enable_pgpcore_plugin" = xauto; then
1862                 AC_MSG_RESULT(no)
1863                 AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
1864                 enable_pgpcore_plugin=no
1865                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
1866         else
1867                 AC_MSG_RESULT(no)
1868                 AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
1869         fi
1870 else
1871         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
1872         AC_MSG_RESULT(no)
1875 AC_MSG_CHECKING([whether to build pgpmime plugin])
1876 if test x"$enable_pgpmime_plugin" != xno; then
1877         dependencies_missing=""
1879         if test x"$HAVE_GPGME" = xno; then
1880                 dependencies_missing="libgpgme $dependencies_missing"
1881         fi
1882         if test x"$enable_pgpcore_plugin" = xno; then
1883                 dependencies_missing="pgpcore plugin $dependencies_missing"
1884         fi
1886         if test x"$dependencies_missing" = x; then
1887                 PLUGINS="$PLUGINS pgpmime"
1888                 AC_MSG_RESULT(yes)
1889         elif test x"$enable_pgpmime_plugin" = xauto; then
1890                 AC_MSG_RESULT(no)
1891                 AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
1892                 enable_pgpmime_plugin=no
1893                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
1894         else
1895                 AC_MSG_RESULT(no)
1896                 AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
1897         fi
1898 else
1899         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
1900         AC_MSG_RESULT(no)
1903 AC_MSG_CHECKING([whether to build pgpinline plugin])
1904 if test x"$enable_pgpinline_plugin" != xno; then
1905         dependencies_missing=""
1907         if test x"$HAVE_GPGME" = xno; then
1908                 dependencies_missing="libgpgme $dependencies_missing"
1909         fi
1910         if test x"$enable_pgpcore_plugin" = xno; then
1911                 dependencies_missing="pgpcore plugin $dependencies_missing"
1912         fi
1914         if test x"$dependencies_missing" = x; then
1915                 PLUGINS="$PLUGINS pgpinline"
1916                 AC_MSG_RESULT(yes)
1917         elif test x"$enable_pgpinline_plugin" = xauto; then
1918                 AC_MSG_RESULT(no)
1919                 AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
1920                 enable_pgpinline_plugin=no
1921                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
1922         else
1923                 AC_MSG_RESULT(no)
1924                 AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
1925         fi
1926 else
1927         DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
1928         AC_MSG_RESULT(no)
1931 AC_MSG_CHECKING([whether to build rssyl plugin])
1932 if test x"$enable_rssyl_plugin" != xno; then
1933         dependencies_missing=""
1935         if test x"$HAVE_EXPAT" = xno; then
1936                 dependencies_missing="expat $dependencies_missing"
1937         fi
1938         if test x"$HAVE_CURL" = xno; then
1939                 dependencies_missing="libcurl $dependencies_missing"
1940         fi
1942         if test x"$dependencies_missing" = x; then
1943                 PLUGINS="$PLUGINS rssyl"
1944                 AC_MSG_RESULT(yes)
1945         elif test x"$enable_rssyl_plugin" = xauto; then
1946                 AC_MSG_RESULT(no)
1947                 AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
1948                 enable_rssyl_plugin=no
1949                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
1950         else
1951                 AC_MSG_RESULT(no)
1952                 AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
1953         fi
1954 else
1955         DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
1956         AC_MSG_RESULT(no)
1959 AC_MSG_CHECKING([whether to build spamassassin plugin])
1960 if test x"$enable_spamassassin_plugin" != xno; then
1961         PLUGINS="$PLUGINS spamassassin"
1962         AC_MSG_RESULT(yes)
1963         AC_SPAMASSASSIN
1965         dnl check for zlib (optional)
1966         spamassassin_zlib=0
1967         SPAMASSASSIN_CFLAGS=""
1968         SPAMASSASSIN_LIBS=""
1969         AC_CHECK_HEADER([zlib.h],
1970                         [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
1971                         [spamassassin_zlib=1],
1972                         [spamassassin_zlib=0])
1973         if test $spamassassin_zlib -eq 1; then
1974                 AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
1975                 AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
1976                 if test $spamassassin_zlib -eq 1; then
1977                         AC_MSG_RESULT(yes)
1978                         SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
1979                         SPAMASSASSIN_LIBS="-lz"
1980                 else
1981                         AC_MSG_RESULT(no)
1982                 fi
1983         fi
1984         AC_SUBST(SPAMASSASSIN_CFLAGS)
1985         AC_SUBST(SPAMASSASSIN_LIBS)
1986 else
1987         DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
1988         AC_MSG_RESULT(no)
1991 AC_MSG_CHECKING([whether to build smime plugin])
1992 if test x"$enable_smime_plugin" != xno; then
1993         dependencies_missing=""
1995         if test x"$HAVE_GPGME" = xno; then
1996                 dependencies_missing="libgpgme $dependencies_missing"
1997         fi
1998         if test x"$enable_pgpcore_plugin" = xno; then
1999                 dependencies_missing="pgpcore plugin $dependencies_missing"
2000         fi
2002         if test x"$dependencies_missing" = x; then
2003                 PLUGINS="$PLUGINS smime"
2004                 AC_MSG_RESULT(yes)
2005         elif test x"$enable_smime_plugin" = xauto; then
2006                 AC_MSG_RESULT(no)
2007                 AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
2008                 enable_smime_plugin=no
2009                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
2010         else
2011                 AC_MSG_RESULT(no)
2012                 AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
2013         fi
2014 else
2015         DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
2016         AC_MSG_RESULT(no)
2019 AC_MSG_CHECKING([whether to build spam_report plugin])
2020 if test x"$enable_spam_report_plugin" != xno; then
2021         dependencies_missing=""
2023         if test x"$HAVE_CURL" = xno; then
2024                 dependencies_missing="libcurl $dependencies_missing"
2025         fi
2027         if test x"$dependencies_missing" = x; then
2028                 PLUGINS="$PLUGINS spam_report"
2029                 AC_MSG_RESULT(yes)
2030         elif test x"$enable_spam_report_plugin" = xauto; then
2031                 AC_MSG_RESULT(no)
2032                 AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
2033                 enable_spam_report_plugin=no
2034                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
2035         else
2036                 AC_MSG_RESULT(no)
2037                 AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
2038         fi
2039 else
2040         DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
2041         AC_MSG_RESULT(no)
2044 AC_MSG_CHECKING([whether to build tnef_parse plugin])
2045 if test x"$enable_tnef_parse_plugin" != xno; then
2046         dependencies_missing=""
2048         if test $have_ytnef -eq 0; then
2049                 dependencies_missing="libytnef"
2050         fi
2052         if test x"$dependencies_missing" = x; then
2053                 PLUGINS="$PLUGINS tnef_parse"
2054                 AC_MSG_RESULT(yes)
2055         elif test x"$enable_tnef_parse_plugin" = xauto; then
2056                 AC_MSG_RESULT(no)
2057                 AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
2058                 enable_tnef_parse_plugin=no
2059                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
2060         else
2061                 AC_MSG_RESULT(no)
2062                 AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
2063         fi
2064 else
2065         DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
2066         AC_MSG_RESULT(no)
2070 AC_MSG_CHECKING([whether to build vcalendar plugin])
2071 if test x"$enable_vcalendar_plugin" != xno; then
2072         dependencies_missing=""
2074         if test x"$HAVE_CURL" = xno; then
2075                 dependencies_missing="libcurl $dependencies_missing"
2076         fi
2078   if test x"$HAVE_LIBICAL" = xno; then
2079     dependencies_missing="libical $dependencies_missing"
2080   fi
2082         if test x"$HAVE_PERL" = xno; then
2083                 dependencies_missing="perl $dependencies_missing"
2084         fi
2086         if test x"$dependencies_missing" = x; then
2087                 PLUGINS="$PLUGINS vcalendar"
2088                 AC_MSG_RESULT(yes)
2089         elif test x"$enable_vcalendar_plugin" = xauto; then
2090                 AC_MSG_RESULT(no)
2091                 AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
2092                 enable_vcalendar_plugin=no
2093                 MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
2094         else
2095                 AC_MSG_RESULT(no)
2096                 AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
2097         fi
2098 else
2099         DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
2100         AC_MSG_RESULT(no)
2103 dnl And finally the automake conditionals.
2105 AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN,      test x"$enable_acpi_notifier_plugin" != xno)
2106 AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN,     test x"$enable_address_keeper_plugin" != xno)
2107 AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN,            test x"$enable_archive_plugin" != xno)
2108 AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN,        test x"$enable_att_remover_plugin" != xno)
2109 AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN,       test x"$enable_attachwarner_plugin" != xno)
2110 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN,         test x"$enable_bogofilter_plugin" != xno)
2111 AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN,           test x"$enable_bsfilter_plugin" != xno)
2112 AM_CONDITIONAL(BUILD_CLAMD_PLUGIN,              test x"$enable_clamd_plugin" != xno)
2113 AM_CONDITIONAL(BUILD_DEMO_PLUGIN,               test x"$enable_demo_plugin" != xno)
2114 AM_CONDITIONAL(BUILD_DILLO_PLUGIN,              test x"$enable_dillo_plugin" != xno)
2115 AM_CONDITIONAL(BUILD_FANCY_PLUGIN,              test x"$enable_fancy_plugin" != xno)
2116 AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN,          test x"$enable_fetchinfo_plugin" != xno)
2117 AM_CONDITIONAL(BUILD_GDATA_PLUGIN,              test x"$enable_gdata_plugin" != xno)
2118 AM_CONDITIONAL(BUILD_KEYWORD_WARNER_PLUGIN,     test x"$enable_keyword_warner_plugin" != xno)
2119 AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN,         test x"$enable_libravatar_plugin" != xno)
2120 AM_CONDITIONAL(BUILD_LITEHTML_VIEWER_PLUGIN,    test x"$enable_litehtml_viewer_plugin" != xno)
2121 AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN,           test x"$enable_mailmbox_plugin" != xno)
2122 AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN,        test x"$enable_managesieve_plugin" != xno)
2123 AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN,            test x"$enable_newmail_plugin" != xno)
2124 AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN,       test x"$enable_notification_plugin" != xno)
2125 AM_CONDITIONAL(BUILD_HOTKEYS,                   test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
2126 AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN,         test x"$enable_pdf_viewer_plugin" != xno)
2127 AM_CONDITIONAL(BUILD_PERL_PLUGIN,               test x"$enable_perl_plugin" != xno)
2128 AM_CONDITIONAL(BUILD_PYTHON_PLUGIN,             test x"$enable_python_plugin" != xno)
2129 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN,            test x"$enable_pgpcore_plugin" != xno)
2130 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN,            test x"$enable_pgpmime_plugin" != xno)
2131 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN,          test x"$enable_pgpinline_plugin" != xno)
2132 AM_CONDITIONAL(BUILD_RSSYL_PLUGIN,              test x"$enable_rssyl_plugin" != xno)
2133 AM_CONDITIONAL(BUILD_SMIME_PLUGIN,              test x"$enable_smime_plugin" != xno)
2134 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN,       test x"$enable_spamassassin_plugin" != xno)
2135 AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN,        test x"$enable_spam_report_plugin" != xno)
2136 AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN,         test x"$enable_tnef_parse_plugin" != xno)
2137 AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN,          test x"$enable_vcalendar_plugin" != xno)
2140 dnl ****************************
2141 dnl ** Final configure output **
2142 dnl ****************************
2144 AC_CONFIG_FILES([
2145 Makefile
2146 m4/Makefile
2147 po/Makefile.in
2148 src/common/version.h
2149 src/Makefile
2150 src/w32-resource.rc
2151 src/common/Makefile
2152 src/common/passcrypt.h
2153 src/common/tests/Makefile
2154 src/gtk/Makefile
2155 src/etpan/Makefile
2156 src/plugins/Makefile
2157 src/plugins/acpi_notifier/Makefile
2158 src/plugins/address_keeper/Makefile
2159 src/plugins/address_keeper/version.rc
2160 src/plugins/archive/Makefile
2161 src/plugins/att_remover/Makefile
2162 src/plugins/att_remover/version.rc
2163 src/plugins/attachwarner/Makefile
2164 src/plugins/attachwarner/version.rc
2165 src/plugins/bogofilter/Makefile
2166 src/plugins/bsfilter/Makefile
2167 src/plugins/bsfilter/version.rc
2168 src/plugins/clamd/Makefile
2169 src/plugins/clamd/libclamd/Makefile
2170 src/plugins/demo/Makefile
2171 src/plugins/dillo/Makefile
2172 src/plugins/fancy/Makefile
2173 src/plugins/fancy/version.rc
2174 src/plugins/fetchinfo/Makefile
2175 src/plugins/fetchinfo/version.rc
2176 src/plugins/gdata/Makefile
2177 src/plugins/keyword_warner/Makefile
2178 src/plugins/keyword_warner/version.rc
2179 src/plugins/litehtml_viewer/Makefile
2180 src/plugins/litehtml_viewer/version.rc
2181 src/plugins/litehtml_viewer/litehtml/Makefile
2182 src/plugins/libravatar/Makefile
2183 src/plugins/libravatar/version.rc
2184 src/plugins/mailmbox/Makefile
2185 src/plugins/mailmbox/version.rc
2186 src/plugins/managesieve/Makefile
2187 src/plugins/managesieve/version.rc
2188 src/plugins/newmail/Makefile
2189 src/plugins/notification/Makefile
2190 src/plugins/notification/version.rc
2191 src/plugins/notification/gtkhotkey/Makefile
2192 src/plugins/pdf_viewer/Makefile
2193 src/plugins/pdf_viewer/version.rc
2194 src/plugins/perl/Makefile
2195 src/plugins/perl/tools/Makefile
2196 src/plugins/python/Makefile
2197 src/plugins/python/examples/Makefile
2198 src/plugins/pgpcore/Makefile
2199 src/plugins/pgpcore/version.rc
2200 src/plugins/pgpmime/Makefile
2201 src/plugins/pgpmime/version.rc
2202 src/plugins/pgpinline/Makefile
2203 src/plugins/pgpinline/version.rc
2204 src/plugins/rssyl/Makefile
2205 src/plugins/rssyl/version.rc
2206 src/plugins/rssyl/tests/Makefile
2207 src/plugins/rssyl/libfeed/Makefile
2208 src/plugins/rssyl/libfeed/tests/Makefile
2209 src/plugins/smime/Makefile
2210 src/plugins/smime/version.rc
2211 src/plugins/spamassassin/Makefile
2212 src/plugins/spam_report/Makefile
2213 src/plugins/spam_report/version.rc
2214 src/plugins/tnef_parse/Makefile
2215 src/plugins/tnef_parse/version.rc
2216 src/plugins/vcalendar/Makefile
2217 src/plugins/vcalendar/version.rc
2218 src/tests/Makefile
2219 doc/Makefile
2220 doc/man/Makefile
2221 tools/Makefile
2222 config/Makefile
2223 manual/Makefile
2224 claws-mail.pc
2226 AC_OUTPUT
2228 dnl Output the configuration summary
2229 echo ""
2230 echo "$PACKAGE $VERSION"
2231 echo ""
2232 if test x"$enable_alternate_addressbook" = xyes; then
2233         echo "Using Address Book : Alternate experimental interface"
2234 else
2235         echo "Using Address Book : Original stable interface"
2236         echo "JPilot             : $enable_jpilot"
2237         echo "LDAP               : $enable_ldap"
2239 echo "gnuTLS             : $enable_gnutls"
2240 echo "OAuth2             : $enable_oauth2"
2241 echo "iconv              : $am_cv_func_iconv"
2242 echo "compface           : $enable_compface"
2243 echo "IPv6               : $enable_ipv6"
2244 echo "enchant            : $enable_enchant"
2245 echo "IMAP4              : $enable_libetpan"
2246 echo "NNTP               : $enable_libetpan"
2247 echo "Crash dialog       : $enable_crash_dialog"
2248 echo "LibSM              : $enable_libsm"
2249 echo "DBUS               : $enable_dbus"
2250 echo "NetworkManager     : $enable_networkmanager"
2251 echo "Manual             : $enable_manual"
2252 echo "Generic UMPC code  : $enable_generic_umpc"
2253 echo "SVG support        : $enable_svg"
2254 echo "Config dir         : $ac_cv_with_config_dir"
2255 echo "Password crypto    : $pwd_crypto"
2256 echo "Unit tests         : $enable_tests"
2258 echo "Plugins"
2259 echo "   Built:"
2260 for plugin in $PLUGINS; do
2261 echo "            - $plugin"
2262 if test x"$plugin" = xnotification; then
2263         echo "                Features:"
2264         for notif_feature in $notification_features; do
2265                 echo "                    $notif_feature"
2266         done;
2267         if test "x$notification_missing_dependencies" != x; then
2268                 echo "                Disabled due to missing dependencies:"
2269                 for notif_miss_dep in $notification_missing_dependencies; do
2270                         echo "                    $notif_miss_dep"
2271                 done;
2272         fi
2274 done;
2275 if test "x$DISABLED_PLUGINS" != x; then
2276 echo "   Disabled:"
2277 for plugin in $DISABLED_PLUGINS; do
2278 echo "            - $plugin"
2279 done;
2282 if test "x$MISSING_DEPS_PLUGINS" != x; then
2283 echo "   Disabled due to missing dependencies:"
2284 for plugin in $MISSING_DEPS_PLUGINS; do
2285 echo "            - $plugin"
2286 done;
2288 echo ""
2289 echo "The binary will be installed in $prefix/bin"
2290 echo ""
2291 echo "Configure finished, type 'make' to build."