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