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