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