2010-10-02 [colin] 3.7.6cvs46
[claws.git] / configure.ac
1
2 AC_PREREQ(2.60)
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=7
12 MICRO_VERSION=6
13 INTERFACE_AGE=0
14 BINARY_AGE=0
15 EXTRA_VERSION=46
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 dnl GNOME installed?
40 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
41 if test "$GNOME_CONFIG" != no; then
42         gnomedatadir="`gnome-config --datadir`"
43         gnomeprefix="`gnome-config --prefix`"
44         if test "${prefix}" = "NONE"; then
45                 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
46         else
47                 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
48         fi
49         AC_SUBST(gnomedatadir)
50 fi
51 AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
52
53 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
54 if test x$PKG_CONFIG = xno ; then
55   AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
56 fi
57
58 dnl GNOME 2.x installed?
59 PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
60 AM_CONDITIONAL(CLAWS_GNOME2, test x"$ac_enable_gnome2" = x"yes")
61
62 dnl libtool versioning
63 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
64 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
65 LT_REVISION=$INTERFACE_AGE
66 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
67 AC_SUBST(LT_RELEASE)
68 AC_SUBST(LT_CURRENT)
69 AC_SUBST(LT_REVISION)
70 AC_SUBST(LT_AGE)
71
72 dnl Specify a header configuration file
73 AC_CONFIG_HEADERS(config.h)
74
75 AM_MAINTAINER_MODE
76
77 dnl Checks for programs.
78 dnl AC_ARG_PROGRAM
79 AC_PROG_CC
80 AC_ISC_POSIX
81 AC_PROG_INSTALL
82 AC_PROG_LN_S
83 AC_PROG_MAKE_SET
84 AC_PROG_CPP
85 dnl AC_PROG_RANLIB
86 AM_PROG_LEX
87 AC_PROG_YACC
88 AC_LIB_PREFIX
89 AC_LIBTOOL_WIN32_DLL
90 LT_AC_PROG_RC
91 AC_LIBTOOL_RC
92 AC_PROG_LIBTOOL
93
94 AC_SYS_LARGEFILE
95
96 dnl ******************************
97 dnl Checks for host
98 dnl Not needed anymore because we 
99 dnl do AC_CANONICAL_SYSTEM above
100 dnl ******************************
101 dnl AC_CANONICAL_HOST
102
103 dnl Copied from the official gtk+-2 configure.in
104 AC_MSG_CHECKING([for some Win32 platform])
105 case "$host" in
106   *-*-mingw*|*-*-cygwin*)
107     platform_win32=yes
108     LDFLAGS="$LDFLAGS -mwindows"
109     ;;
110   *)
111     platform_win32=no
112     ;;
113 esac
114 AC_MSG_RESULT([$platform_win32])
115 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
116
117 AC_MSG_CHECKING([for native Win32])
118 case "$host" in
119   *-*-mingw*)
120     os_win32=yes
121     ;;
122   *)
123     os_win32=no
124     ;;
125 esac
126 AC_MSG_RESULT([$os_win32])
127 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
128
129 AC_MSG_CHECKING([for Cygwin])
130 case "$host" in
131   *-*-cygwin*)
132     env_cygwin=yes
133     ;;
134   *)
135     env_cygwin=no
136     ;;
137 esac
138 AC_MSG_RESULT([$env_cygwin])
139 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
140
141 if test "$GCC" = "yes"
142 then
143         CFLAGS="$CFLAGS -Wno-unused-function"
144 fi
145
146 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
147 _gcc_cflags_save=$CFLAGS
148 CFLAGS="-Wno-pointer-sign"
149 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
150 AC_MSG_RESULT($_gcc_psign)
151 CFLAGS=$_gcc_cflags_save;
152 if test x"$_gcc_psign" = xyes ; then
153         CFLAGS="$CFLAGS -Wno-pointer-sign"
154 fi
155
156 CFLAGS="$CFLAGS -Wall"
157
158 if test $USE_MAINTAINER_MODE = yes; then
159         CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
160 fi
161
162 pthread_name=
163 case "$target" in
164 *-darwin*)
165         CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
166         ;;
167 *-*-mingw*)
168         # Note that we need to link to pthreadGC2 in all cases. This
169         # is because some locking is used even when pthread support is
170         # disabled.
171         pthread_name=pthreadGC2
172         CFLAGS="$CFLAGS -mms-bitfields"
173         LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
174         ;;
175 *-*-solaris*)
176         CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
177         CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
178         ;;
179 esac
180   
181 dnl Checks for iconv
182 AM_ICONV
183
184 dnl
185 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
186 dnl
187 syl_save_LIBS=$LIBS
188 LIBS="$LIBS $GTK_LIBS"
189 AC_CHECK_FUNCS(bind_textdomain_codeset)
190 LIBS=$syl_save_LIBS
191
192 dnl for gettext
193 ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id it ja nl pl pt_BR pt_PT ru sk sv uk zh_CN"
194 GETTEXT_PACKAGE=claws-mail
195 AC_SUBST(GETTEXT_PACKAGE)
196 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
197
198 AM_GNU_GETTEXT_VERSION([0.15])
199 AM_GNU_GETTEXT([external])
200
201 manualdir='${docdir}/manual'
202 AC_ARG_WITH(manualdir,
203         [  --with-manualdir=DIR    Manual directory],
204         [manualdir="$withval"])
205 AC_SUBST(manualdir)
206
207 AC_ARG_ENABLE(manual,
208         [  --disable-manual           do not build manual],
209         [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
210
211 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
212
213 dnl Set PACKAGE_DATA_DIR in config.h.
214 if test "x${datarootdir}" = 'x${prefix}/share'; then
215         if test "x${prefix}" = "xNONE"; then
216                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
217         else
218                 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
219         fi
220 else
221         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
222 fi
223
224 AC_CHECK_LIB(xpg4, setlocale)
225
226 SM_LIBS=""
227 dnl Check for LibSM
228 AC_ARG_ENABLE(libsm,
229         [  --disable-libsm    disable libSM support for session management.],
230         [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
231 AC_MSG_CHECKING([whether to use LibSM])
232 if test x"$ac_cv_enable_libsm" = xyes; then
233         AC_MSG_RESULT(yes)
234         AC_CHECK_LIB(SM, SmcSaveYourselfDone,
235                 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
236                 $X_LIBS -lICE)
237         AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
238         if test x"$ac_cv_enable_libsm" = xyes; then
239                 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
240         else
241                 AC_MSG_RESULT(not found)
242                 AC_MSG_WARN([*** LibSM will not be supported ***])
243         fi
244 else
245         AC_MSG_RESULT(no)
246 fi
247 AC_SUBST(SM_LIBS)
248
249 dnl for GThread support (currently disabled)
250 dnl AC_ARG_ENABLE(threads,
251 dnl     [  --enable-threads        Enable multithread support [default=no]],
252 dnl     [use_threads=$enableval], [use_threads=no])
253
254 AC_MSG_CHECKING([whether to use threads])
255 if test x"$use_threads" = xyes ; then
256         AC_MSG_RESULT(yes)
257         if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
258                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
259                 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
260                 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
261         else
262                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
263         fi
264 else
265         AC_MSG_RESULT(no)
266 fi
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   OCPPFLAGS="$CPPFLAGS"
391   OLDFLAGS="$LDFLAGS"
392   GNUTLS_LIBS=""
393   PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.3,
394         [ac_cv_enable_gnutls=yes],
395         [ac_cv_enable_gnutls=no
396          echo "GnuTLS version >= 2.0.3 not found"])
397   if test "x$ac_cv_enable_gnutls" = "xyes"; then
398    AC_CHECK_HEADER(gpg-error.h,
399         [AC_CHECK_LIB(gpg-error, gpg_strerror,,
400                 [ac_cv_enable_gnutls=no])
401         ],[ac_cv_enable_gnutls=no])
402   fi
403   if test "x$ac_cv_enable_gnutls" = "xyes"; then
404    GCRYPT_LIBS="-lgpg-error"
405    AC_CHECK_HEADER(gcrypt.h,
406         [AC_CHECK_LIB(gcrypt, gcry_control,,
407                 [ac_cv_enable_gnutls=no])
408         ],[ac_cv_enable_gnutls=no])
409   fi
410   if test "x$ac_cv_enable_gnutls" = "xyes"; then
411         if test x"$platform_win32" = "xyes"; then
412                 GNUTLS_LIBS="-lgnutls -lgcrypt ${GCRYPT_LIBS}"
413         else
414                 GNUTLS_LIBS="-lgnutls -lgcrypt -lz ${GCRYPT_LIBS}"
415         fi
416   fi
417 else
418    CPPFLAGS="$OCPPFLAGS"
419    LDFLAGS="$OLDFLAGS"
420 fi
421
422 if test "x$ac_cv_enable_gnutls" = "xyes"; then
423   AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
424 else
425   GNUTLS_LIBS=""
426 fi
427 AC_SUBST(GNUTLS_LIBS)
428
429 dnl password encryption
430 OLDLIBS=$LIBS
431 LIBS=
432 case $host_os in
433         *dragonfly*)
434                 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
435         ;;
436         *)
437                 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
438         ;;
439 esac
440 CRYPT_LIBS=$LIBS
441 AC_SUBST(CRYPT_LIBS)
442 LIBS=$OLDLIBS
443
444 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
445             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
446 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
447
448 dnl RC dir (will be default at a certain point in time)
449 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .claws-mail)],
450               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
451 if test x"$ac_cv_with_config_dir" = x""; then
452         ac_cv_with_config_dir=".claws-mail"
453 fi 
454 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
455
456 dnl ************************
457 dnl ** GTK user interface **
458 dnl ************************
459
460 dnl Checks for GTK
461 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
462
463 dnl --disable-deprecated switch for GTK2 purification
464 AC_ARG_ENABLE(deprecated, [  --disable-deprecated  disable deprecated GTK functions. ],
465                           [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
466
467 AC_SUBST(GTK_CFLAGS)
468 AC_SUBST(GTK_LIBS)
469
470 dnl enchant is used for spell checking
471 AC_MSG_CHECKING([whether to use enchant])
472 AC_ARG_ENABLE(enchant,
473         [  --disable-enchant         disable enchant support],
474         [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
475 AC_MSG_RESULT($ac_cv_enable_enchant)
476 if test $ac_cv_enable_enchant = yes; then
477         PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
478         [
479                 AC_DEFINE(USE_ENCHANT, 1, enchant)
480                 echo "Building with enchant"
481                 ac_cv_enable_enchant=yes
482                 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
483         ],
484         [
485                 echo "Building without enchant-notification"
486                 ac_cv_enable_enchant=no
487         ])
488         AC_SUBST(ENCHANT_CFLAGS)
489         AC_SUBST(ENCHANT_LIBS)
490 fi
491
492 dnl want crash dialog
493 AC_ARG_ENABLE(crash-dialog,
494         [  --enable-crash-dialog   Enable crash dialog [default=no]],
495         [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
496 if test $ac_cv_enable_crash_dialog = yes; then
497 dnl check if GDB is somewhere
498         AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
499         AC_MSG_CHECKING([whether to use crash dialog])
500         if test $ac_cv_enable_crash_dialog = yes; then
501                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
502         fi
503         AC_MSG_RESULT($ac_cv_enable_crash_dialog)
504 fi
505
506 dnl generic umpc
507 AC_ARG_ENABLE(generic-umpc,
508         [  --enable-generic-umpc   Enable generic UMPC code [default=no]],
509         [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
510 if test $ac_cv_enable_generic_umpc = yes; then
511         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
512         AC_MSG_RESULT($ac_cv_enable_generic_umpc)
513 fi
514
515 dnl Maemo platform
516 AC_ARG_ENABLE(maemo,
517         [  --enable-maemo   build for the Maemo platform [default=no]],
518         [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
519 if test $ac_cv_enable_maemo = yes; then
520         PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
521                   ac_cv_enable_maemo=no)
522         AC_SUBST(MAEMO_CFLAGS)
523         AC_SUBST(MAEMO_LIBS)
524         if test $ac_cv_enable_maemo = no; then
525                 #test for chinook
526                 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
527                           ac_cv_enable_maemo=no)
528                 AC_SUBST(MAEMO_CFLAGS)
529                 AC_SUBST(MAEMO_LIBS)
530                 if test $ac_cv_enable_maemo = no; then
531                         AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
532                 else
533                         AC_DEFINE(MAEMO, 1, Build for maemo)
534                         AC_DEFINE(CHINOOK, 1, Maemo chinook)
535                         AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
536                         ac_cv_enable_generic_umpc=yes
537                 fi
538         else
539                 AC_DEFINE(MAEMO, 1, Build for maemo)
540                 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
541                 ac_cv_enable_generic_umpc=yes
542         fi
543 fi
544
545 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
546           ac_cv_enable_conic=no)
547 AC_SUBST(CONIC_CFLAGS)
548 AC_SUBST(CONIC_LIBS)
549 if test $ac_cv_enable_conic = yes; then
550         AC_DEFINE(CONIC, 1, Have conic lib)
551 fi
552
553 dnl Check for X-Face support
554 AC_ARG_ENABLE(compface,
555         [  --disable-compface      disable compface (X-Face) support],
556         [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
557 AC_MSG_CHECKING([whether to use compface])
558 if test x"$ac_cv_enable_compface" = xyes; then
559         AC_MSG_RESULT(yes)
560         AC_CHECK_LIB(compface, uncompface, 
561                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
562                 [ac_cv_enable_compface=no])
563         if test x"$ac_cv_enable_compface" = xyes; then
564                 COMPFACE_LIBS="-lcompface"
565         else
566                 COMPFACE_LIBS=""
567         fi
568         AC_SUBST(COMPFACE_LIBS)
569 else
570         AC_MSG_RESULT(no)
571 fi
572
573 dnl check for pthread support
574 AC_ARG_ENABLE(pthread,
575         [  --disable-pthread           disable pthread support],
576         [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
577 AC_MSG_CHECKING([whether to use pthread])
578 if test x$ac_cv_enable_pthread = xno; then
579         AC_MSG_RESULT(no)
580 else
581         AC_MSG_RESULT(yes)
582
583         # For W32 we need to use a special ptrhead lib. In this case we can't
584         # use AC_CHECK_LIB because it has no means of checking for a
585         # library installed under a different name.  Checking for the
586         # header is okay.
587         if test -n "${pthread_name}" ; then
588            ac_cv_enable_pthread=yes
589         else
590         AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
591         fi
592         AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
593
594         if test x$ac_cv_enable_pthread = xyes; then
595                 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
596                 if test -z "${pthread_name}" ; then
597                 PTHREAD_LIBS="-lpthread"
598         fi
599         fi
600
601 fi
602 AC_SUBST(PTHREAD_LIBS)
603
604 dnl
605 dnl Check whether we need to pass -lresolv
606 dnl We know that we don't need it for W32.
607 dnl
608 if test x$os_win32 = xno; then
609   t_oldLibs="$LIBS"
610   LIBS="$LIBS"
611   ac_cv_var__res_options=no
612   AC_TRY_LINK([#include <sys/types.h>
613              #include <sys/socket.h>
614              #include <netinet/in.h>
615              #include <arpa/nameser.h>
616              #include <resolv.h>],
617                 [_res.options = RES_INIT;],
618                 ac_cv_var__res_options=yes);
619   if test "$ac_cv_var__res_options" != "yes"; then
620         LIBRESOLV="-lresolv"
621   fi
622   LIBS="$t_oldLibs"
623
624   if test "x$LIBRESOLV" = "x"; then
625         AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
626         LIBS="$t_oldLibs"
627   fi
628 fi
629 AC_SUBST(LIBRESOLV)
630
631 LIBS="$LIBS $LIBRESOLV"
632                  
633 dnl for LDAP support in addressbook
634 dnl no check for libraries; dynamically loaded
635 AC_ARG_ENABLE(ldap,
636         [  --disable-ldap         disable LDAP support],
637         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
638 AC_MSG_CHECKING([whether to use LDAP])
639 if test x"$ac_cv_enable_ldap" = xno; then
640         AC_MSG_RESULT(no)
641 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
642         AC_MSG_RESULT(no - LDAP support needs pthread support)
643
644         ac_cv_enable_ldap=no
645 else
646         AC_MSG_RESULT(yes)
647
648         dnl check for available libraries, and pull them in
649         AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
650         AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
651         AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
652         AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
653                      $LDAP_LIBS)
654
655         AC_CHECK_HEADERS(ldap.h lber.h,
656                          [ ac_cv_enable_ldap=yes ],
657                          [ ac_cv_enable_ldap=no ])
658
659         if test "$ac_cv_enable_ldap" = yes; then
660                 AC_CHECK_LIB(ldap, ldap_open,
661                              [ ac_cv_enable_ldap=yes ],
662                              [ ac_cv_enable_ldap=no ],
663                              $LDAP_LIBS)
664
665                 AC_CHECK_LIB(ldap, ldap_start_tls_s,
666                              [ ac_cv_have_tls=yes ],
667                              [ ac_cv_have_tls=no ])
668
669         fi
670
671         AC_MSG_CHECKING([whether ldap library is available])
672         AC_MSG_RESULT($ac_cv_enable_ldap)
673
674         AC_MSG_CHECKING([whether TLS library is available])
675         AC_MSG_RESULT($ac_cv_have_tls)
676
677         if test "$ac_cv_enable_ldap" = yes; then
678                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
679                 LDAP_LIBS="$LDAP_LIBS -lldap"
680                 AC_SUBST(LDAP_LIBS)
681                 if test "$ac_cv_have_tls" = yes; then
682                         AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
683                 fi
684                 dnl As of OpenLDAP API version 3000 a number of functions has
685                 dnl been deprecated. As Claws-mail compiles and runs on many
686                 dnl platforms and many versions of OpenLDAP we need to be able
687                 dnl to switch between the old and new API because new API has
688                 dnl added new functions replacing old ones and at the same time
689                 dnl old functions has been changed.
690                 dnl If cross-compiling defaults to enable deprecated features
691                 dnl for maximum portability
692                 AC_MSG_CHECKING([The API version of OpenLDAP])
693                 AC_RUN_IFELSE(
694                         [AC_LANG_PROGRAM(
695                          [#include <ldap.h>],
696                          [if (LDAP_API_VERSION >= 3000)
697                                         return 1
698                         ])],
699                         [AC_MSG_RESULT([version < 3000])
700                          AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
701                         [AC_MSG_RESULT([version >= 3000])
702                          AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
703                         [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
704                          AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
705                          AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
706                 )
707         fi
708 fi
709
710 dnl for JPilot support in addressbook
711 dnl no check for libraries; these are dynamically loaded
712 AC_ARG_ENABLE(jpilot,
713         [  --disable-jpilot         disable JPilot support],
714         [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
715 AC_MSG_CHECKING([whether to use JPilot])
716 if test "$ac_cv_enable_jpilot" = yes; then
717         AC_MSG_RESULT(yes)
718         AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
719                          [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
720                          [ ac_cv_enable_jpilot=no ])
721         if test "$ac_cv_enable_jpilot" = no; then
722                 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
723                                  [ ac_cv_enable_jpilot=yes
724                                    AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
725         fi
726
727         AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
728         if test x"$ac_cv_enable_jpilot" = xyes; then
729                 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
730         else
731                 AC_MSG_NOTICE([JPilot support not available])
732         fi
733         AC_SUBST(JPILOT_LIBS)
734 else
735         AC_MSG_RESULT(no)
736 fi
737
738 dnl #######################################################################
739 dnl # Check for startup notification
740 dnl #######################################################################
741 AC_ARG_ENABLE(startup-notification, [  --disable-startup-notification    disable startup notification support],,enable_startup_notification=yes)
742
743 if test "x$enable_startup_notification" = "xyes"; then
744         PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
745         [
746                 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
747                 echo "Building with libstartup-notification"
748                 enable_startup_notification=yes
749         ],
750         [
751                 echo "Building without libstartup-notification"
752                 enable_startup_notification=no
753         ])
754
755         AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
756         AC_SUBST(STARTUP_NOTIFICATION_LIBS)
757 fi
758
759 dnl #######################################################################
760 dnl # Check for D-Bus support
761 dnl #######################################################################
762 AC_ARG_ENABLE(dbus, [  --disable-dbus    disable dbus support],,enable_dbus=yes)
763
764 if test "x$enable_dbus" = "xyes"; then
765         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
766         [
767                 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
768                 enable_dbus_glib=yes
769         ],
770         [
771                 echo "D-Bus requirements not met. D-Bus support not activated."
772                 enable_dbus_glib=no
773         ])
774         AC_SUBST(DBUS_CFLAGS)
775         AC_SUBST(DBUS_LIBS)
776 fi
777
778 dnl #######################################################################
779 dnl # Check for NetworkManager support
780 dnl #######################################################################
781 if test x"$enable_dbus_glib" = xyes; then
782         AC_ARG_ENABLE(networkmanager-support, [  --disable-networkmanager-support  disable NetworkManager support],,enable_networkmanager_support=yes)
783         if test x"$enable_networkmanager_support" = xyes; then
784                 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
785                 [
786                         AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
787                         echo "Building with NetworkManager support"
788                         enable_networkmanager_support=yes
789                 ],
790                 [
791                         echo "NetworkManager not found."
792                         enable_networkmanager_support=no
793                 ])
794                 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
795         fi
796 else
797         echo "NetworkManager support deactivated as D-Bus requirements were not met."
798         enable_networkmanager_support=no
799 fi
800
801 dnl *************************
802 dnl ** section for plugins **
803 dnl *************************
804
805 PLUGINS=""
806
807 dnl --- Trayicon ---
808 AC_MSG_CHECKING([whether to build Trayicon plugin])
809 AC_ARG_ENABLE(trayicon-plugin,
810         [  --disable-trayicon-plugin         do not build System Tray Icon plugin],
811         [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
812 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
813         AC_MSG_RESULT(yes)
814         PLUGINS="trayicon $PLUGINS"
815 else
816         AC_MSG_RESULT(no)
817 fi
818 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
819
820 dnl --- SpamAssassin ---
821 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
822 AC_ARG_ENABLE(spamassassin-plugin,
823         [  --disable-spamassassin-plugin      do not build SpamAssassin plugin],
824         [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
825 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
826         AC_MSG_RESULT(yes)
827         AC_SPAMASSASSIN
828         PLUGINS="spamassassin $PLUGINS"
829         AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
830 else
831         AC_MSG_RESULT(no)
832 fi
833 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
834
835 dnl --- Bogofilter ---
836 AC_MSG_CHECKING([whether to build Bogofilter plugin])
837 AC_ARG_ENABLE(bogofilter-plugin,
838         [  --disable-bogofilter-plugin      do not build bogofilter plugin],
839         [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
840 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
841         AC_MSG_RESULT(yes)
842         PLUGINS="bogofilter $PLUGINS"
843         AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
844 else
845         AC_MSG_RESULT(no)
846 fi
847 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
848
849 dnl --- PGP/CORE ---
850 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
851 AC_ARG_ENABLE(pgpcore-plugin,
852         [  --disable-pgpcore-plugin           do not build PGP/Core plugin],
853         [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
854 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
855         AC_MSG_RESULT(yes)
856         AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
857                       [ac_cv_enable_pgpcore_plugin=no])
858         if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
859                 PLUGINS="pgpcore $PLUGINS"
860                 AM_PATH_GPGME(1.1.1,
861                               AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
862                                         [Define if GPGME supports PKA.]))
863                 #needed to get GPGME_LIBS and al correctly
864                 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
865                           [ac_cv_enable_pgpcore_plugin=no])
866         else
867                 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
868         fi
869 else
870         AC_MSG_RESULT(no)
871 fi
872 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
873
874 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
875 AC_ARG_ENABLE(pgpmime-plugin,
876         [  --disable-pgpmime-plugin           do not build PGP/MIME plugin],
877         [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
878 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
879         AC_MSG_RESULT(yes)
880         if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
881                 PLUGINS="pgpmime $PLUGINS"
882         else
883                 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
884                 AC_MSG_WARN([*** without the PGP/CORE plugin     ***])
885         fi
886 else
887         AC_MSG_RESULT(no)
888 fi
889 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
890
891 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
892 AC_ARG_ENABLE(pgpinline-plugin,
893         [  --disable-pgpinline-plugin           do not build PGP/Inline plugin],
894         [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
895 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
896         AC_MSG_RESULT(yes)
897         if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
898                 PLUGINS="pgpinline $PLUGINS"
899         else
900                 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
901                 AC_MSG_WARN([*** without the PGP/CORE plugin     ***])
902         fi
903 else
904         AC_MSG_RESULT(no)
905 fi
906 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
907
908 AC_MSG_CHECKING([whether to build S/Mime plugin])
909 AC_ARG_ENABLE(smime-plugin,
910         [  --disable-smime-plugin           do not build S/Mime plugin],
911         [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
912 if test x"$ac_cv_enable_smime_plugin" = xyes; then
913         AC_MSG_RESULT(yes)
914         if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
915                 PLUGINS="smime $PLUGINS"
916         else
917                 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
918                 AC_MSG_WARN([*** without the PGP/CORE plugin     ***])
919         fi
920 else
921         AC_MSG_RESULT(no)
922 fi
923 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
924
925 dnl --- Dillo Viewer ---
926 AC_MSG_CHECKING([whether to build Dillo plugin])
927 AC_ARG_ENABLE(dillo-viewer-plugin,
928         [  --disable-dillo-viewer-plugin     do not build Dillo plugin for html mail rendering],
929         [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
930 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
931         AC_MSG_RESULT(yes)
932         PLUGINS="dillo-viewer $PLUGINS"
933 else
934         AC_MSG_RESULT(no)
935 fi
936 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
937
938 dnl --- Demo ---
939 AC_ARG_ENABLE(demo-plugin,
940         [  --enable-demo-plugin              build demo plugin],
941         [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
942 if test x"$ac_cv_enable_demo_plugin" = xyes; then
943         PLUGINS="demo $PLUGINS"
944 fi
945 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
946
947 dnl Libetpan
948 AC_MSG_CHECKING([whether to use libetpan])
949 AC_ARG_ENABLE(libetpan,
950         [  --disable-libetpan           disable IMAP4/NNTP (libetpan) support],
951         [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
952 if test x"$ac_cv_enable_libetpan" = xyes; then
953         AC_MSG_RESULT(yes)
954         libetpan_result=no
955         AC_PATH_PROG(libetpanconfig, [libetpan-config])
956         if test "x$libetpanconfig" != "x"; then
957           CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
958           AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
959           if test "x$libetpan_result" = "xyes"; then
960             AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
961             LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
962             AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
963             AC_MSG_RESULT([$libetpan_result])
964           fi
965         fi
966         if test "x$libetpan_result" = "xyes"; then
967            LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
968            LIBETPAN_LIBS="`$libetpanconfig --libs`"
969            LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
970            LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
971            if test x"$LIBETPAN_STABLE" != "x"; then
972                 LIBETPAN_VERSION="100"
973            fi
974            if test "$LIBETPAN_VERSION" -lt "057"; then
975                 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
976                 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
977                 AC_MSG_ERROR([libetpan 0.57 not found])
978            fi
979            AC_SUBST(LIBETPAN_FLAGS)
980            AC_SUBST(LIBETPAN_LIBS)
981            AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
982         else
983            AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
984            AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
985            AC_MSG_ERROR([libetpan 0.57 not found])
986         fi
987 else
988         AC_MSG_RESULT(no)
989 fi
990 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
991
992 AC_MSG_CHECKING([whether to use valgrind])
993 AC_ARG_ENABLE(valgrind,
994         [  --disable-valgrind           disable valgrind support for debugging],
995         [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
996 if test x$ac_cv_enable_valgrind = xyes; then
997         AC_MSG_RESULT(yes)
998         PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
999                           ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1000         if test x"$ac_cv_enable_valgrind" = xyes; then
1001                 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1002         else
1003                 AC_MSG_RESULT(not found)
1004         fi
1005 else
1006         AC_MSG_RESULT(no)
1007 fi
1008 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1009
1010 dnl ****************************
1011 dnl ** Final configure output **
1012 dnl ****************************
1013
1014 AC_OUTPUT([
1015 Makefile
1016 m4/Makefile
1017 po/Makefile.in
1018 src/common/version.h
1019 src/Makefile
1020 src/common/Makefile
1021 src/common/passcrypt.h
1022 src/gtk/Makefile
1023 src/etpan/Makefile
1024 src/plugins/Makefile
1025 src/plugins/demo/Makefile
1026 src/plugins/bogofilter/Makefile
1027 src/plugins/spamassassin/Makefile
1028 src/plugins/dillo_viewer/Makefile
1029 src/plugins/trayicon/Makefile
1030 src/plugins/pgpcore/Makefile
1031 src/plugins/pgpmime/Makefile
1032 src/plugins/pgpinline/Makefile
1033 src/plugins/smime/Makefile
1034 doc/Makefile
1035 doc/man/Makefile
1036 tools/Makefile
1037 config/Makefile
1038 manual/Makefile
1039 manual/dtd/Makefile
1040 manual/dist/Makefile
1041 manual/dist/pdf/Makefile
1042 manual/dist/ps/Makefile
1043 manual/dist/html/Makefile
1044 manual/dist/txt/Makefile
1045 manual/fr/Makefile
1046 manual/fr/dist/Makefile
1047 manual/fr/dist/pdf/Makefile
1048 manual/fr/dist/ps/Makefile
1049 manual/fr/dist/html/Makefile
1050 manual/fr/dist/txt/Makefile
1051 manual/pl/Makefile
1052 manual/pl/dist/Makefile
1053 manual/pl/dist/pdf/Makefile
1054 manual/pl/dist/ps/Makefile
1055 manual/pl/dist/html/Makefile
1056 manual/pl/dist/txt/Makefile
1057 manual/es/Makefile
1058 manual/es/dist/Makefile
1059 manual/es/dist/pdf/Makefile
1060 manual/es/dist/ps/Makefile
1061 manual/es/dist/html/Makefile
1062 manual/es/dist/txt/Makefile
1063 manual/de/Makefile
1064 manual/de/dist/Makefile
1065 manual/de/dist/pdf/Makefile
1066 manual/de/dist/ps/Makefile
1067 manual/de/dist/html/Makefile
1068 manual/de/dist/txt/Makefile
1069 claws-mail.pc
1070 ])
1071
1072 dnl Output the configuration summary
1073 echo ""
1074 echo "$PACKAGE $VERSION"
1075 echo ""
1076 echo "JPilot            : $ac_cv_enable_jpilot"
1077 echo "LDAP              : $ac_cv_enable_ldap"
1078 echo "gnuTLS            : $ac_cv_enable_gnutls"
1079 echo "iconv             : $am_cv_func_iconv"
1080 echo "compface          : $ac_cv_enable_compface"
1081 echo "IPv6              : $ac_cv_enable_ipv6"
1082 echo "enchant           : $ac_cv_enable_enchant"
1083 echo "IMAP4             : $ac_cv_enable_libetpan"
1084 echo "NNTP              : $ac_cv_enable_libetpan"
1085 echo "Crash dialog      : $ac_cv_enable_crash_dialog"
1086 echo "LibSM             : $ac_cv_enable_libsm"
1087 echo "DBUS              : $enable_dbus"
1088 echo "NetworkManager    : $enable_networkmanager_support"
1089 echo "Manual            : $ac_cv_enable_manual"
1090 echo "Plugins           : $PLUGINS"
1091 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1092 echo "Maemo  build      : $ac_cv_enable_maemo"
1093 echo "Config dir        : $ac_cv_with_config_dir"
1094 echo ""
1095 echo "The binary will be installed in $prefix/bin"
1096 echo ""
1097 echo "Configure finished, type 'make' to build."