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