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