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