4 AC_CONFIG_AUX_DIR(config)
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}
21 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
28 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
29 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
30 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
33 AC_SUBST(MAJOR_VERSION)
34 AC_SUBST(MINOR_VERSION)
35 AC_SUBST(MICRO_VERSION)
36 AC_SUBST(EXTRA_VERSION)
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}}"
46 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
48 AC_SUBST(gnomedatadir)
50 AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
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/])
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")
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`
71 dnl Specify a header configuration file
72 AC_CONFIG_HEADERS(config.h)
76 dnl Checks for programs.
92 CLAWS_ACLOCAL_INCLUDE(m4)
94 dnl ******************************
96 dnl Not needed anymore because we
97 dnl do AC_CANONICAL_SYSTEM above
98 dnl ******************************
101 dnl Copied from the official gtk+-2 configure.in
102 AC_MSG_CHECKING([for some Win32 platform])
104 *-*-mingw*|*-*-cygwin*)
106 LDFLAGS="$LDFLAGS -mwindows"
112 AC_MSG_RESULT([$platform_win32])
113 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
115 AC_MSG_CHECKING([for native Win32])
124 AC_MSG_RESULT([$os_win32])
125 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
127 AC_MSG_CHECKING([for Cygwin])
136 AC_MSG_RESULT([$env_cygwin])
137 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
139 if test "$GCC" = "yes"
141 CFLAGS="$CFLAGS -Wno-unused-function"
144 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
145 _gcc_cflags_save=$CFLAGS
146 CFLAGS="-Wno-pointer-sign"
147 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
148 AC_MSG_RESULT($_gcc_psign)
149 CFLAGS=$_gcc_cflags_save;
150 if test x"$_gcc_psign" = xyes ; then
151 CFLAGS="$CFLAGS -Wno-pointer-sign"
154 CFLAGS="$CFLAGS -Wall"
156 if test $USE_MAINTAINER_MODE = yes; then
157 CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
163 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
166 # Note that we need to link to pthreadGC2 in all cases. This
167 # is because some locking is used even when pthread support is
169 pthread_name=pthreadGC2
170 CFLAGS="$CFLAGS -mms-bitfields"
171 LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
174 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
175 CFLAGS="$CFLAGS -DSOLARIS"
183 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
186 LIBS="$LIBS $GTK_LIBS"
187 AC_CHECK_FUNCS(bind_textdomain_codeset)
191 ALL_LINGUAS="bg ca de en_GB es fi fr hu it nl pl pt_BR ru sk sr sv zh_CN"
192 GETTEXT_PACKAGE=claws-mail
193 AC_SUBST(GETTEXT_PACKAGE)
194 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
196 AM_GNU_GETTEXT_VERSION([0.15])
197 AM_GNU_GETTEXT([external])
199 manualdir='${docdir}/manual'
200 AC_ARG_WITH(manualdir,
201 [ --with-manualdir=DIR Manual directory],
202 [manualdir="$withval"])
205 AC_ARG_ENABLE(manual,
206 [ --disable-manual do not build manual],
207 [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
209 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
211 dnl Set PACKAGE_DATA_DIR in config.h.
212 if test "x${datarootdir}" = 'x${prefix}/share'; then
213 if test "x${prefix}" = "xNONE"; then
214 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
216 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
219 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
222 AC_CHECK_LIB(xpg4, setlocale)
227 [ --disable-libsm disable libSM support for session management.],
228 [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
229 AC_MSG_CHECKING([whether to use LibSM])
230 if test x"$ac_cv_enable_libsm" = xyes; then
232 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
233 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
235 AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
236 if test x"$ac_cv_enable_libsm" = xyes; then
237 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
239 AC_MSG_RESULT(not found)
240 AC_MSG_WARN([*** LibSM will not be supported ***])
247 dnl for GThread support (currently disabled)
248 dnl AC_ARG_ENABLE(threads,
249 dnl [ --enable-threads Enable multithread support [default=no]],
250 dnl [use_threads=$enableval], [use_threads=no])
252 AC_MSG_CHECKING([whether to use threads])
253 if test x"$use_threads" = xyes ; then
255 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
256 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
257 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
258 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
260 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
266 dnl Check for d_type member in struct dirent
267 AC_MSG_CHECKING([whether struct dirent has d_type member])
268 AC_CACHE_VAL(ac_cv_dirent_d_type,[
269 AC_TRY_COMPILE([#include <dirent.h>],
270 [struct dirent d; d.d_type = DT_REG;],
271 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
273 AC_MSG_RESULT($ac_cv_dirent_d_type)
274 if test $ac_cv_dirent_d_type = yes; then
275 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
276 Define if `struct dirent' has `d_type' member.)
279 # Check whether mkdir does not take the permission argument.
280 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
282 dnl Checks for header files.
286 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
287 sys/param.h sys/utsname.h sys/select.h \
288 wchar.h wctype.h locale.h netdb.h)
290 dnl alf - Check for apache installation f*ck up. apache may also install an
291 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
292 AC_TRY_COMPILE([#include <stdlib.h>
293 #include <fnmatch.h>],
294 [int x = USE_HSREGEX;],
295 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
296 if test $ac_cv_have_apache_fnmatch = yes; then
297 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
299 AC_MSG_CHECKING([whether to use Apache regex header kludge])
300 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
302 dnl Checks for typedefs, structures, and compiler characteristics.
309 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
310 dnl may be defined only in wchar.h (this happens with gcc-2.96).
311 dnl So we need to use this extended macro.
312 CLAWS_CHECK_TYPE(wint_t, unsigned int,
317 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
319 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
320 AC_CHECK_SIZEOF(unsigned short, 2)
321 AC_CHECK_SIZEOF(unsigned int, 4)
322 AC_CHECK_SIZEOF(unsigned long, 4)
324 dnl Checks for library functions.
326 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
327 uname flock lockf inet_aton inet_addr \
328 fchmod mkstemp truncate getuid regcomp)
330 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
332 dnl *****************
333 dnl ** common code **
334 dnl *****************
337 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
339 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
340 AC_SUBST(GLIB_GENMARSHAL)
342 AC_SUBST(GLIB_CFLAGS)
345 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
347 LIBS="$LIBS $GTK_LIBS"
348 AC_CHECK_FUNCS(bind_textdomain_codeset)
351 dnl check for IPv6 option
353 [ --disable-ipv6 disable build IPv6 support],
354 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
356 dnl automated checks for IPv6 support.
357 AC_MSG_CHECKING([whether to use IPv6])
358 if test x"$ac_cv_enable_ipv6" = xyes; then
360 AC_MSG_CHECKING([for IPv6 support])
361 AC_CACHE_VAL(ac_cv_ipv6,[
362 AC_TRY_COMPILE([#define INET6
363 #include <sys/types.h>
364 #include <netinet/in.h>],
365 [int x = IPPROTO_IPV6; struct in6_addr a;],
366 ac_cv_ipv6=yes, ac_cv_ipv6=no)
368 AC_MSG_RESULT($ac_cv_ipv6)
369 if test $ac_cv_ipv6 = yes; then
370 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
372 AC_MSG_WARN(*** IPv6 will not be supported ***)
380 AC_MSG_CHECKING([whether to use GnuTLS])
381 AC_ARG_ENABLE(openssl, [ --enable-openssl enable GnuTLS support],
382 [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
383 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
384 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
386 if test "x$ac_cv_enable_gnutls" != "xyes"; then
387 if test "x$ac_cv_enable_openssl" = "xyes"; then
388 AC_MSG_ERROR(*** Use GnuTLS instead of OpenSSL due to licensing ***)
391 AC_MSG_RESULT($ac_cv_enable_gnutls)
392 if test "x$ac_cv_enable_gnutls" != "xno"; then
393 OCPPFLAGS="$CPPFLAGS"
396 AC_CHECK_HEADER(gnutls/gnutls.h, [
397 AC_CHECK_LIB(gnutls, gnutls_global_deinit,,
398 [ac_cv_enable_gnutls=no])
399 ],[ac_cv_enable_gnutls=no])
400 if test "x$ac_cv_enable_gnutls" = "xyes"; then
401 AC_CHECK_HEADER(gpg-error.h,
402 [AC_CHECK_LIB(gpg-error, gpg_strerror,,
403 [ac_cv_enable_gnutls=no])
404 ],[ac_cv_enable_gnutls=no])
406 if test "x$ac_cv_enable_gnutls" = "xyes"; then
407 GCRYPT_LIBS="-lgpg-error"
408 AC_CHECK_HEADER(gcrypt.h,
409 [AC_CHECK_LIB(gcrypt, gcry_control,,
410 [ac_cv_enable_gnutls=no])
411 ],[ac_cv_enable_gnutls=no])
413 if test "x$ac_cv_enable_gnutls" = "xyes"; then
414 GNUTLS_LIBS="-lgnutls -lgcrypt -lz ${GCRYPT_LIBS}"
417 CPPFLAGS="$OCPPFLAGS"
421 if test "x$ac_cv_enable_gnutls" = "xyes"; then
422 AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
426 AC_SUBST(GNUTLS_LIBS)
428 dnl password encryption
433 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
436 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
443 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
444 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
445 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
447 dnl RC dir (will be default at a certain point in time)
448 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
449 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
450 if test x"$ac_cv_with_config_dir" = x""; then
451 ac_cv_with_config_dir=".claws-mail"
453 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
455 dnl ************************
456 dnl ** GTK user interface **
457 dnl ************************
460 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
462 dnl --disable-deprecated switch for GTK2 purification
463 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
464 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
469 dnl enchant is used for spell checking
470 AC_MSG_CHECKING([whether to use enchant])
471 AC_ARG_ENABLE(enchant,
472 [ --disable-enchant disable enchant support],
473 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
474 AC_MSG_RESULT($ac_cv_enable_enchant)
475 if test $ac_cv_enable_enchant = yes; then
476 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
478 AC_DEFINE(USE_ENCHANT, 1, enchant)
479 echo "Building with enchant"
480 ac_cv_enable_enchant=yes
483 echo "Building without enchant-notification"
484 ac_cv_enable_enchant=no
486 AC_SUBST(ENCHANT_CFLAGS)
487 AC_SUBST(ENCHANT_LIBS)
490 dnl want crash dialog
491 AC_ARG_ENABLE(crash-dialog,
492 [ --enable-crash-dialog Enable crash dialog [default=no]],
493 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
494 if test $ac_cv_enable_crash_dialog = yes; then
495 dnl check if GDB is somewhere
496 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
497 AC_MSG_CHECKING([whether to use crash dialog])
498 if test $ac_cv_enable_crash_dialog = yes; then
499 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
501 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
505 AC_ARG_ENABLE(generic-umpc,
506 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
507 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
508 if test $ac_cv_enable_generic_umpc = yes; then
509 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
510 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
515 [ --enable-maemo build for the Maemo platform [default=no]],
516 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
517 if test $ac_cv_enable_maemo = yes; then
518 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
519 ac_cv_enable_maemo=no)
520 AC_SUBST(MAEMO_CFLAGS)
522 if test $ac_cv_enable_maemo = no; then
524 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
525 ac_cv_enable_maemo=no)
526 AC_SUBST(MAEMO_CFLAGS)
528 if test $ac_cv_enable_maemo = no; then
529 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
531 AC_DEFINE(MAEMO, 1, Build for maemo)
532 AC_DEFINE(CHINOOK, 1, Maemo chinook)
533 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
534 ac_cv_enable_generic_umpc=yes
537 AC_DEFINE(MAEMO, 1, Build for maemo)
538 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
539 ac_cv_enable_generic_umpc=yes
543 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
544 ac_cv_enable_conic=no)
545 AC_SUBST(CONIC_CFLAGS)
547 if test $ac_cv_enable_conic = yes; then
548 AC_DEFINE(CONIC, 1, Have conic lib)
551 dnl Check for X-Face support
552 AC_ARG_ENABLE(compface,
553 [ --disable-compface disable compface (X-Face) support],
554 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
555 AC_MSG_CHECKING([whether to use compface])
556 if test x"$ac_cv_enable_compface" = xyes; then
558 AC_CHECK_LIB(compface, uncompface,
559 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
560 [ac_cv_enable_compface=no])
561 if test x"$ac_cv_enable_compface" = xyes; then
562 COMPFACE_LIBS="-lcompface"
566 AC_SUBST(COMPFACE_LIBS)
571 dnl check for pthread support
572 AC_ARG_ENABLE(pthread,
573 [ --disable-pthread disable pthread support],
574 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
575 AC_MSG_CHECKING([whether to use pthread])
576 if test x$ac_cv_enable_pthread = xno; then
581 # For W32 we need to use a special ptrhead lib. In this case we can't
582 # use AC_CHECK_LIB because it has no means of checking for a
583 # library installed under a different name. Checking for the
585 if test -n "${pthread_name}" ; then
586 ac_cv_enable_pthread=yes
588 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
590 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
592 if test x$ac_cv_enable_pthread = xyes; then
593 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
594 if test -z "${pthread_name}" ; then
595 PTHREAD_LIBS="-lpthread"
600 AC_SUBST(PTHREAD_LIBS)
603 dnl Check whether we need to pass -lresolv
604 dnl We know that we don't need it for W32.
606 if test x$os_win32 = xno; then
609 ac_cv_var__res_options=no
610 AC_TRY_LINK([#include <sys/types.h>
611 #include <sys/socket.h>
612 #include <netinet/in.h>
613 #include <arpa/nameser.h>
614 #include <resolv.h>],
615 [_res.options = RES_INIT;],
616 ac_cv_var__res_options=yes);
617 if test "$ac_cv_var__res_options" != "yes"; then
622 if test "x$LIBRESOLV" = "x"; then
623 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
629 LIBS="$LIBS $LIBRESOLV"
631 dnl for LDAP support in addressbook
632 dnl no check for libraries; dynamically loaded
634 [ --disable-ldap disable LDAP support],
635 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
636 AC_MSG_CHECKING([whether to use LDAP])
637 if test x"$ac_cv_enable_ldap" = xno; then
639 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
640 AC_MSG_RESULT(no - LDAP support needs pthread support)
646 dnl check for available libraries, and pull them in
647 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
648 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
649 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
650 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
653 AC_CHECK_HEADERS(ldap.h lber.h,
654 [ ac_cv_enable_ldap=yes ],
655 [ ac_cv_enable_ldap=no ])
657 if test "$ac_cv_enable_ldap" = yes; then
658 AC_CHECK_LIB(ldap, ldap_open,
659 [ ac_cv_enable_ldap=yes ],
660 [ ac_cv_enable_ldap=no ],
663 AC_CHECK_LIB(ldap, ldap_start_tls_s,
664 [ ac_cv_have_tls=yes ],
665 [ ac_cv_have_tls=no ])
669 AC_MSG_CHECKING([whether ldap library is available])
670 AC_MSG_RESULT($ac_cv_enable_ldap)
672 AC_MSG_CHECKING([whether TLS library is available])
673 AC_MSG_RESULT($ac_cv_have_tls)
675 if test "$ac_cv_enable_ldap" = yes; then
676 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
677 LDAP_LIBS="$LDAP_LIBS -lldap"
679 if test "$ac_cv_have_tls" = yes; then
680 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
682 dnl As of OpenLDAP API version 3000 a number of functions has
683 dnl been deprecated. As Claws-mail compiles and runs on many
684 dnl platforms and many versions of OpenLDAP we need to be able
685 dnl to switch between the old and new API because new API has
686 dnl added new functions replacing old ones and at the same time
687 dnl old functions has been changed.
688 dnl If cross-compiling defaults to enable deprecated features
689 dnl for maximum portability
690 AC_MSG_CHECKING([The API version of OpenLDAP])
694 [if (LDAP_API_VERSION >= 3000)
697 [AC_MSG_RESULT([version < 3000])
698 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
699 [AC_MSG_RESULT([version >= 3000])
700 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
701 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
702 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
703 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
708 dnl for JPilot support in addressbook
709 dnl no check for libraries; these are dynamically loaded
710 AC_ARG_ENABLE(jpilot,
711 [ --disable-jpilot disable JPilot support],
712 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
713 AC_MSG_CHECKING([whether to use JPilot])
714 if test "$ac_cv_enable_jpilot" = yes; then
716 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
717 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
718 [ ac_cv_enable_jpilot=no ])
719 if test "$ac_cv_enable_jpilot" = no; then
720 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
721 [ ac_cv_enable_jpilot=yes
722 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
725 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
726 if test x"$ac_cv_enable_jpilot" = xyes; then
727 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
729 AC_MSG_NOTICE([JPilot support not available])
731 AC_SUBST(JPILOT_LIBS)
736 dnl #######################################################################
737 dnl # Check for startup notification
738 dnl #######################################################################
739 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
741 if test "x$enable_startup_notification" = "xyes"; then
742 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
744 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
745 echo "Building with libstartup-notification"
746 enable_startup_notification=yes
749 echo "Building without libstartup-notification"
750 enable_startup_notification=no
753 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
754 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
757 dnl #######################################################################
758 dnl # Check for D-Bus support
759 dnl #######################################################################
760 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
762 if test "x$enable_dbus" = "xyes"; then
763 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
765 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
769 echo "D-Bus requirements not met. D-Bus support not activated."
772 AC_SUBST(DBUS_CFLAGS)
776 dnl #######################################################################
777 dnl # Check for NetworkManager support
778 dnl #######################################################################
779 if test x"$enable_dbus_glib" = xyes; then
780 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
781 if test x"$enable_networkmanager_support" = xyes; then
782 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
784 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
785 echo "Building with NetworkManager support"
786 enable_networkmanager_support=yes
789 echo "NetworkManager not found."
790 enable_networkmanager_support=no
792 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
795 echo "NetworkManager support deactivated as D-Bus requirements were not met."
796 enable_networkmanager_support=no
799 dnl *************************
800 dnl ** section for plugins **
801 dnl *************************
806 AC_MSG_CHECKING([whether to build Trayicon plugin])
807 AC_ARG_ENABLE(trayicon-plugin,
808 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
809 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
810 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
812 PLUGINS="trayicon $PLUGINS"
816 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
818 dnl --- SpamAssassin ---
819 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
820 AC_ARG_ENABLE(spamassassin-plugin,
821 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
822 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
823 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
826 PLUGINS="spamassassin $PLUGINS"
827 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
831 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
833 dnl --- Bogofilter ---
834 AC_MSG_CHECKING([whether to build Bogofilter plugin])
835 AC_ARG_ENABLE(bogofilter-plugin,
836 [ --disable-bogofilter-plugin do not build bogofilter plugin],
837 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
838 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
840 PLUGINS="bogofilter $PLUGINS"
841 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
845 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
848 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
849 AC_ARG_ENABLE(pgpcore-plugin,
850 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
851 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
852 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
854 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
855 [ac_cv_enable_pgpcore_plugin=no])
856 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
857 PLUGINS="pgpcore $PLUGINS"
859 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
860 [Define if GPGME supports PKA.]))
861 #needed to get GPGME_LIBS and al correctly
862 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
863 [ac_cv_enable_pgpcore_plugin=no])
865 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
870 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
872 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
873 AC_ARG_ENABLE(pgpmime-plugin,
874 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
875 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
876 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
878 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
879 PLUGINS="pgpmime $PLUGINS"
881 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
882 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
887 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
889 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
890 AC_ARG_ENABLE(pgpinline-plugin,
891 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
892 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
893 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
895 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
896 PLUGINS="pgpinline $PLUGINS"
898 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
899 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
904 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
906 AC_MSG_CHECKING([whether to build S/Mime plugin])
907 AC_ARG_ENABLE(smime-plugin,
908 [ --disable-smime-plugin do not build S/Mime plugin],
909 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
910 if test x"$ac_cv_enable_smime_plugin" = xyes; then
912 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
913 PLUGINS="smime $PLUGINS"
915 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
916 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
921 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
923 dnl --- Dillo Viewer ---
924 AC_MSG_CHECKING([whether to build Dillo plugin])
925 AC_ARG_ENABLE(dillo-viewer-plugin,
926 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
927 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
928 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
930 PLUGINS="dillo-viewer $PLUGINS"
934 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
937 AC_ARG_ENABLE(demo-plugin,
938 [ --enable-demo-plugin build demo plugin],
939 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
940 if test x"$ac_cv_enable_demo_plugin" = xyes; then
941 PLUGINS="demo $PLUGINS"
943 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
946 AC_MSG_CHECKING([whether to use libetpan])
947 AC_ARG_ENABLE(libetpan,
948 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
949 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
950 if test x"$ac_cv_enable_libetpan" = xyes; then
953 AC_PATH_PROG(libetpanconfig, [libetpan-config])
954 if test "x$libetpanconfig" != "x"; then
955 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
956 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
957 if test "x$libetpan_result" = "xyes"; then
958 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
959 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
960 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
961 AC_MSG_RESULT([$libetpan_result])
964 if test "x$libetpan_result" = "xyes"; then
965 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
966 LIBETPAN_LIBS="`$libetpanconfig --libs`"
967 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
968 if test "$LIBETPAN_VERSION" -lt "057"; then
969 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
970 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
971 AC_MSG_ERROR([libetpan 0.57 not found])
973 AC_SUBST(LIBETPAN_FLAGS)
974 AC_SUBST(LIBETPAN_LIBS)
975 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
977 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
978 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
979 AC_MSG_ERROR([libetpan 0.57 not found])
984 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
987 dnl Printing support.
988 PKG_CHECK_MODULES(GTK210, gtk+-2.0 >= 2.10, ac_cv_have_gtk210=yes, ac_cv_have_gtk210=no)
990 AC_MSG_CHECKING([whether to use libgnomeprint])
991 AC_ARG_ENABLE(gnomeprint,
992 [ --disable-gnomeprint disable libgnomeprint support],
993 [ac_cv_enable_gnomeprint=$enableval], [ac_cv_enable_gnomeprint=auto])
995 if test x$ac_cv_have_gtk210 = xyes; then
996 ac_cv_enable_gnomeprint="no"
999 if test x$ac_cv_enable_gnomeprint = xyes \
1000 -o \( x$ac_cv_enable_gnomeprint = xauto \
1001 -a x$ac_cv_have_gtk210 = xno \); then
1003 PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
1004 ac_cv_enable_gnomeprint=yes, ac_cv_enable_gnomeprint=no)
1005 if test x"$ac_cv_enable_gnomeprint" = xyes; then
1006 AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
1008 AC_MSG_RESULT(not found)
1009 AC_MSG_WARN([*** libgnomeprintui wasn't found ***])
1010 AC_MSG_WARN([*** using built-in printing support ***])
1013 ac_cv_enable_gnomeprint=no
1016 AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes")
1018 AC_MSG_CHECKING([whether to use valgrind])
1019 AC_ARG_ENABLE(valgrind,
1020 [ --disable-valgrind disable valgrind support for debugging],
1021 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1022 if test x$ac_cv_enable_valgrind = xyes; then
1024 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1025 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1026 if test x"$ac_cv_enable_valgrind" = xyes; then
1027 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1029 AC_MSG_RESULT(not found)
1034 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1036 dnl ****************************
1037 dnl ** Final configure output **
1038 dnl ****************************
1044 src/common/version.h
1047 src/common/passcrypt.h
1050 src/plugins/Makefile
1051 src/plugins/demo/Makefile
1052 src/plugins/bogofilter/Makefile
1053 src/plugins/spamassassin/Makefile
1054 src/plugins/dillo_viewer/Makefile
1055 src/plugins/trayicon/Makefile
1056 src/plugins/trayicon/libeggtrayicon/Makefile
1057 src/plugins/pgpcore/Makefile
1058 src/plugins/pgpmime/Makefile
1059 src/plugins/pgpinline/Makefile
1060 src/plugins/smime/Makefile
1067 manual/dist/Makefile
1068 manual/dist/pdf/Makefile
1069 manual/dist/ps/Makefile
1070 manual/dist/html/Makefile
1071 manual/dist/txt/Makefile
1073 manual/fr/dist/Makefile
1074 manual/fr/dist/pdf/Makefile
1075 manual/fr/dist/ps/Makefile
1076 manual/fr/dist/html/Makefile
1077 manual/fr/dist/txt/Makefile
1079 manual/pl/dist/Makefile
1080 manual/pl/dist/pdf/Makefile
1081 manual/pl/dist/ps/Makefile
1082 manual/pl/dist/html/Makefile
1083 manual/pl/dist/txt/Makefile
1085 manual/es/dist/Makefile
1086 manual/es/dist/pdf/Makefile
1087 manual/es/dist/ps/Makefile
1088 manual/es/dist/html/Makefile
1089 manual/es/dist/txt/Makefile
1093 dnl Output the configuration summary
1095 echo "$PACKAGE $VERSION"
1097 echo "JPilot : $ac_cv_enable_jpilot"
1098 echo "LDAP : $ac_cv_enable_ldap"
1099 echo "gnuTLS : $ac_cv_enable_gnutls"
1100 echo "iconv : $am_cv_func_iconv"
1101 echo "compface : $ac_cv_enable_compface"
1102 echo "IPv6 : $ac_cv_enable_ipv6"
1103 echo "enchant : $ac_cv_enable_enchant"
1104 echo "IMAP4 : $ac_cv_enable_libetpan"
1105 echo "NNTP : $ac_cv_enable_libetpan"
1106 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1107 echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
1108 echo "GTK+ print support: $ac_cv_have_gtk210"
1109 echo "LibSM : $ac_cv_enable_libsm"
1110 echo "DBUS : $enable_dbus"
1111 echo "NetworkManager : $enable_networkmanager_support"
1112 echo "Manual : $ac_cv_enable_manual"
1113 echo "Plugins : $PLUGINS"
1114 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1115 echo "Maemo build : $ac_cv_enable_maemo"
1116 echo "Config dir : $ac_cv_with_config_dir"
1118 echo "The binary will be installed in $prefix/bin"
1120 echo "Configure finished, type 'make' to build."