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