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