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