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 CFLAGS="$CFLAGS -Wall"
146 if test $USE_MAINTAINER_MODE = yes; then
147 CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
153 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
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
159 pthread_name=pthreadGC2
160 CFLAGS="$CFLAGS -mms-bitfields"
161 LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
164 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
165 CFLAGS="$CFLAGS -DSOLARIS"
173 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
176 LIBS="$LIBS $GTK_LIBS"
177 AC_CHECK_FUNCS(bind_textdomain_codeset)
181 ALL_LINGUAS="ca de en_GB es fi fr hu it pl pt_BR sk sr zh_CN"
182 GETTEXT_PACKAGE=claws-mail
183 AC_SUBST(GETTEXT_PACKAGE)
184 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
186 AM_GNU_GETTEXT_VERSION([0.15])
187 AM_GNU_GETTEXT([external])
189 manualdir='${docdir}/manual'
190 AC_ARG_WITH(manualdir,
191 [ --with-manualdir=DIR Manual directory],
192 [manualdir="$withval"])
195 AC_ARG_ENABLE(manual,
196 [ --disable-manual do not build manual],
197 [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
199 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
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])
206 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
209 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
212 AC_CHECK_LIB(xpg4, setlocale)
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
222 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
223 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
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])
229 AC_MSG_RESULT(not found)
230 AC_MSG_WARN([*** LibSM will not be supported ***])
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])
242 AC_MSG_CHECKING([whether to use threads])
243 if test x"$use_threads" = xyes ; then
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)
250 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
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)
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.)
269 # Check whether mkdir does not take the permission argument.
270 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
272 dnl Checks for header files.
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)
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!)
289 AC_MSG_CHECKING([whether to use Apache regex header kludge])
290 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
292 dnl Checks for typedefs, structures, and compiler characteristics.
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,
307 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
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)
314 dnl Checks for library functions.
316 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
317 uname flock lockf inet_aton inet_addr \
318 fchmod mkstemp truncate getuid regcomp)
320 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
322 dnl *****************
323 dnl ** common code **
324 dnl *****************
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)
329 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
330 AC_SUBST(GLIB_GENMARSHAL)
332 AC_SUBST(GLIB_CFLAGS)
335 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
337 LIBS="$LIBS $GTK_LIBS"
338 AC_CHECK_FUNCS(bind_textdomain_codeset)
341 dnl check for IPv6 option
343 [ --disable-ipv6 disable build IPv6 support],
344 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
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
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)
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.)
362 AC_MSG_WARN(*** IPv6 will not be supported ***)
369 dnl Check for OpenSSL
370 AC_ARG_ENABLE(openssl,
371 [ --disable-openssl disable OpenSSL support.],
372 [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=yes])
374 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
375 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=no])
376 if test x$ac_cv_enable_openssl = xyes && test x$ac_cv_enable_gnutls != xyes; then
377 ac_cv_enable_gnutls="no"
379 if test x$ac_cv_enable_gnutls = xyes; then
380 ac_cv_enable_openssl="no"
383 AC_MSG_CHECKING([whether to use OpenSSL])
384 if test x"$ac_cv_enable_openssl" = xyes; then
386 PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7, :, ac_cv_enable_openssl=no)
387 if test x$ac_cv_enable_openssl = xyes; then
388 AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support)
390 AC_MSG_RESULT(not found)
391 AC_MSG_WARN([*** OpenSSL will not be supported ***])
396 AC_SUBST(OPENSSL_CFLAGS)
397 AC_SUBST(OPENSSL_LIBS)
399 AC_MSG_CHECKING([whether to use GnuTLS])
400 if test "x$ac_cv_enable_gnutls" != "xno"; then
401 OCPPFLAGS="$CPPFLAGS"
404 AC_CHECK_HEADER(gnutls/gnutls.h, [
405 AC_CHECK_LIB(gnutls, gnutls_global_deinit,
406 [AC_DEFINE(USE_GNUTLS, 1, Define to use GnuTLS.)],
407 [ac_cv_enable_gnutls=no])
408 ],[ac_cv_enable_gnutls=no])
409 if test "x$ac_cv_enable_gnutls" != "xyes"; then
410 CPPFLAGS="$OCPPFLAGS"
414 if test "x$ac_cv_enable_gnutls" = "xyes"; then
415 AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
416 GNUTLS_LIBS="-lgnutls"
420 AC_SUBST(GNUTLS_LIBS)
422 dnl password encryption
427 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
430 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
437 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
438 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
439 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
441 dnl RC dir (will be default at a certain point in time)
442 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
443 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
444 if test x"$ac_cv_with_config_dir" = x""; then
445 ac_cv_with_config_dir=".claws-mail"
447 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
449 dnl ************************
450 dnl ** GTK user interface **
451 dnl ************************
454 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
456 dnl --disable-deprecated switch for GTK2 purification
457 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
458 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
463 dnl enchant is used for spell checking
464 AC_ARG_ENABLE(enchant,
465 [ --disable-enchant disable enchant support],
466 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
467 AC_MSG_CHECKING([whether to use enchant])
468 if test $ac_cv_enable_enchant = yes; then
469 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
471 AC_DEFINE(USE_ENCHANT, 1, enchant)
472 echo "Building with enchant"
473 ac_cv_enable_enchant=yes
476 echo "Building without enchant-notification"
477 ac_cv_enable_enchant=no
479 AC_SUBST(ENCHANT_CFLAGS)
480 AC_SUBST(ENCHANT_LIBS)
483 dnl want crash dialog
484 AC_ARG_ENABLE(crash-dialog,
485 [ --enable-crash-dialog Enable crash dialog [default=no]],
486 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
487 if test $ac_cv_enable_crash_dialog = yes; then
488 dnl check if GDB is somewhere
489 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
490 AC_MSG_CHECKING([whether to use crash dialog])
491 if test $ac_cv_enable_crash_dialog = yes; then
492 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
494 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
498 AC_ARG_ENABLE(generic-umpc,
499 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
500 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
501 if test $ac_cv_enable_generic_umpc = yes; then
502 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
503 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
508 [ --enable-maemo build for the Maemo platform [default=no]],
509 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
510 if test $ac_cv_enable_maemo = yes; then
511 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
512 ac_cv_enable_maemo=no)
513 AC_SUBST(MAEMO_CFLAGS)
515 if test $ac_cv_enable_maemo = no; then
517 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
518 ac_cv_enable_maemo=no)
519 AC_SUBST(MAEMO_CFLAGS)
521 if test $ac_cv_enable_maemo = no; then
522 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
524 AC_DEFINE(MAEMO, 1, Build for maemo)
525 AC_DEFINE(CHINOOK, 1, Maemo chinook)
526 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
527 ac_cv_enable_generic_umpc=yes
530 AC_DEFINE(MAEMO, 1, Build for maemo)
531 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
532 ac_cv_enable_generic_umpc=yes
536 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
537 ac_cv_enable_conic=no)
538 AC_SUBST(CONIC_CFLAGS)
540 if test $ac_cv_enable_conic = yes; then
541 AC_DEFINE(CONIC, 1, Have conic lib)
544 dnl Check for X-Face support
545 AC_ARG_ENABLE(compface,
546 [ --disable-compface disable compface (X-Face) support],
547 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
548 AC_MSG_CHECKING([whether to use compface])
549 if test x"$ac_cv_enable_compface" = xyes; then
551 AC_CHECK_LIB(compface, uncompface,
552 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
553 [ac_cv_enable_compface=no])
554 if test x"$ac_cv_enable_compface" = xyes; then
555 COMPFACE_LIBS="-lcompface"
559 AC_SUBST(COMPFACE_LIBS)
564 dnl check for pthread support
565 AC_ARG_ENABLE(pthread,
566 [ --disable-pthread disable pthread support],
567 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
568 AC_MSG_CHECKING([whether to use pthread])
569 if test x$ac_cv_enable_pthread = xno; then
574 # For W32 we need to use a special ptrhead lib. In this case we can't
575 # use AC_CHECK_LIB because it has no means of checking for a
576 # library installed under a different name. Checking for the
578 if test -n "${pthread_name}" ; then
579 ac_cv_enable_pthread=yes
581 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
583 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
585 if test x$ac_cv_enable_pthread = xyes; then
586 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
587 if test -z "${pthread_name}" ; then
588 PTHREAD_LIBS="-lpthread"
593 AC_SUBST(PTHREAD_LIBS)
596 dnl Check whether we need to pass -lresolv
597 dnl We know that we don't need it for W32.
599 if test x$os_win32 = xno; then
602 ac_cv_var__res_options=no
603 AC_TRY_LINK([#include <sys/types.h>
604 #include <sys/socket.h>
605 #include <netinet/in.h>
606 #include <arpa/nameser.h>
607 #include <resolv.h>],
608 [_res.options = RES_INIT;],
609 ac_cv_var__res_options=yes);
610 if test "$ac_cv_var__res_options" != "yes"; then
615 if test "x$LIBRESOLV" = "x"; then
616 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
622 LIBS="$LIBS $LIBRESOLV"
624 dnl for LDAP support in addressbook
625 dnl no check for libraries; dynamically loaded
627 [ --disable-ldap disable LDAP support],
628 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
629 AC_MSG_CHECKING([whether to use LDAP])
630 if test x"$ac_cv_enable_ldap" = xno; then
632 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
633 AC_MSG_RESULT(no - LDAP support needs pthread support)
639 dnl check for available libraries, and pull them in
640 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
641 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
642 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
643 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
646 AC_CHECK_HEADERS(ldap.h lber.h,
647 [ ac_cv_enable_ldap=yes ],
648 [ ac_cv_enable_ldap=no ])
650 if test "$ac_cv_enable_ldap" = yes; then
651 AC_CHECK_LIB(ldap, ldap_open,
652 [ ac_cv_enable_ldap=yes ],
653 [ ac_cv_enable_ldap=no ],
656 AC_CHECK_LIB(ldap, ldap_start_tls_s,
657 [ ac_cv_have_tls=yes ],
658 [ ac_cv_have_tls=no ])
662 AC_MSG_CHECKING([whether ldap library is available])
663 AC_MSG_RESULT($ac_cv_enable_ldap)
665 AC_MSG_CHECKING([whether TLS library is available])
666 AC_MSG_RESULT($ac_cv_have_tls)
668 if test "$ac_cv_enable_ldap" = yes; then
669 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
670 LDAP_LIBS="$LDAP_LIBS -lldap"
672 if test "$ac_cv_have_tls" = yes; then
673 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
675 dnl As of OpenLDAP API version 3000 a number of functions has
676 dnl been deprecated. As Claws-mail compiles and runs on many
677 dnl platforms and many versions of OpenLDAP we need to be able
678 dnl to switch between the old and new API because new API has
679 dnl added new functions replacing old ones and at the same time
680 dnl old functions has been changed.
681 dnl If cross-compiling defaults to enable deprecated features
682 dnl for maximum portability
683 AC_MSG_CHECKING([The API version of OpenLDAP])
687 [if (LDAP_API_VERSION >= 3000)
690 [AC_MSG_RESULT([version < 3000])
691 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
692 [AC_MSG_RESULT([version >= 3000])
693 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
694 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
695 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
696 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
701 dnl for JPilot support in addressbook
702 dnl no check for libraries; these are dynamically loaded
703 AC_ARG_ENABLE(jpilot,
704 [ --disable-jpilot disable JPilot support],
705 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
706 AC_MSG_CHECKING([whether to use JPilot])
707 if test "$ac_cv_enable_jpilot" = yes; then
709 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
710 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
711 [ ac_cv_enable_jpilot=no ])
712 if test "$ac_cv_enable_jpilot" = no; then
713 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
714 [ ac_cv_enable_jpilot=yes
715 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
718 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
719 if test x"$ac_cv_enable_jpilot" = xyes; then
720 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
722 AC_MSG_NOTICE([JPilot support not available])
724 AC_SUBST(JPILOT_LIBS)
729 dnl #######################################################################
730 dnl # Check for startup notification
731 dnl #######################################################################
732 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
734 if test "x$enable_startup_notification" = "xyes"; then
735 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
737 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
738 echo "Building with libstartup-notification"
739 enable_startup_notification=yes
742 echo "Building without libstartup-notification"
743 enable_startup_notification=no
746 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
747 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
750 dnl #######################################################################
751 dnl # Check for D-Bus support
752 dnl #######################################################################
753 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
755 if test "x$enable_dbus" = "xyes"; then
756 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
758 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
762 echo "D-Bus requirements not met. D-Bus support not activated."
765 AC_SUBST(DBUS_CFLAGS)
769 dnl #######################################################################
770 dnl # Check for NetworkManager support
771 dnl #######################################################################
772 if test x"$enable_dbus_glib" = xyes; then
773 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
774 if test x"$enable_networkmanager_support" = xyes; then
775 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
777 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
778 echo "Building with NetworkManager support"
779 enable_networkmanager_support=yes
782 echo "NetworkManager not found."
783 enable_networkmanager_support=no
785 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
788 echo "NetworkManager support deactivated as D-Bus requirements were not met."
789 enable_networkmanager_support=no
792 dnl *************************
793 dnl ** section for plugins **
794 dnl *************************
799 AC_MSG_CHECKING([whether to build Trayicon plugin])
800 AC_ARG_ENABLE(trayicon-plugin,
801 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
802 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
803 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
805 PLUGINS="trayicon $PLUGINS"
809 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
811 dnl --- SpamAssassin ---
812 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
813 AC_ARG_ENABLE(spamassassin-plugin,
814 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
815 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
816 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
819 PLUGINS="spamassassin $PLUGINS"
820 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
824 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
826 dnl --- Bogofilter ---
827 AC_MSG_CHECKING([whether to build Bogofilter plugin])
828 AC_ARG_ENABLE(bogofilter-plugin,
829 [ --disable-bogofilter-plugin do not build bogofilter plugin],
830 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
831 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
833 PLUGINS="bogofilter $PLUGINS"
834 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
838 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
841 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
842 AC_ARG_ENABLE(pgpcore-plugin,
843 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
844 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
845 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
847 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
848 [ac_cv_enable_pgpcore_plugin=no])
849 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
850 PLUGINS="pgpcore $PLUGINS"
852 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
853 [Define if GPGME supports PKA.]))
854 #needed to get GPGME_LIBS and al correctly
855 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
856 [ac_cv_enable_pgpcore_plugin=no])
858 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
863 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
865 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
866 AC_ARG_ENABLE(pgpmime-plugin,
867 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
868 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
869 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
871 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
872 PLUGINS="pgpmime $PLUGINS"
874 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
875 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
880 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
882 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
883 AC_ARG_ENABLE(pgpinline-plugin,
884 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
885 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
886 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
888 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
889 PLUGINS="pgpinline $PLUGINS"
891 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
892 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
897 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
899 AC_MSG_CHECKING([whether to build S/Mime plugin])
900 AC_ARG_ENABLE(smime-plugin,
901 [ --disable-smime-plugin do not build S/Mime plugin],
902 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
903 if test x"$ac_cv_enable_smime_plugin" = xyes; then
905 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
906 PLUGINS="smime $PLUGINS"
908 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
909 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
914 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
916 dnl --- Dillo Viewer ---
917 AC_MSG_CHECKING([whether to build Dillo plugin])
918 AC_ARG_ENABLE(dillo-viewer-plugin,
919 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
920 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
921 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
923 PLUGINS="dillo-viewer $PLUGINS"
927 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
930 AC_ARG_ENABLE(demo-plugin,
931 [ --enable-demo-plugin build demo plugin],
932 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
933 if test x"$ac_cv_enable_demo_plugin" = xyes; then
934 PLUGINS="demo $PLUGINS"
936 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
939 AC_MSG_CHECKING([whether to use libetpan])
940 AC_ARG_ENABLE(libetpan,
941 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
942 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
943 if test x"$ac_cv_enable_libetpan" = xyes; then
946 AC_PATH_PROG(libetpanconfig, [libetpan-config])
947 if test "x$libetpanconfig" != "x"; then
948 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
949 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
950 if test "x$libetpan_result" = "xyes"; then
951 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
952 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
953 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
954 AC_MSG_RESULT([$libetpan_result])
957 if test "x$libetpan_result" = "xyes"; then
958 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
959 LIBETPAN_LIBS="`$libetpanconfig --libs`"
960 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
961 if test "$LIBETPAN_VERSION" -lt "056"; then
962 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.56 or newer. See http://www.etpan.org/])
963 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
964 AC_MSG_ERROR([libetpan 0.56 not found])
966 AC_SUBST(LIBETPAN_FLAGS)
967 AC_SUBST(LIBETPAN_LIBS)
968 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
970 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.56 or newer. See http://www.etpan.org/ ])
971 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
972 AC_MSG_ERROR([libetpan 0.56 not found])
977 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
980 dnl Printing support.
981 PKG_CHECK_MODULES(GTK210, gtk+-2.0 >= 2.10, ac_cv_have_gtk210=yes, ac_cv_have_gtk210=no)
983 AC_MSG_CHECKING([whether to use libgnomeprint])
984 AC_ARG_ENABLE(gnomeprint,
985 [ --disable-gnomeprint disable libgnomeprint support],
986 [ac_cv_enable_gnomeprint=$enableval], [ac_cv_enable_gnomeprint=auto])
988 if test x$ac_cv_have_gtk210 = xyes; then
989 ac_cv_enable_gnomeprint="no"
992 if test x$ac_cv_enable_gnomeprint = xyes \
993 -o \( x$ac_cv_enable_gnomeprint = xauto \
994 -a x$ac_cv_have_gtk210 = xno \); then
996 PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
997 ac_cv_enable_gnomeprint=yes, ac_cv_enable_gnomeprint=no)
998 if test x"$ac_cv_enable_gnomeprint" = xyes; then
999 AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
1001 AC_MSG_RESULT(not found)
1002 AC_MSG_WARN([*** libgnomeprintui wasn't found ***])
1003 AC_MSG_WARN([*** using built-in printing support ***])
1006 ac_cv_enable_gnomeprint=no
1009 AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes")
1011 AC_MSG_CHECKING([whether to use valgrind])
1012 AC_ARG_ENABLE(valgrind,
1013 [ --disable-valgrind disable valgrind support for debugging],
1014 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1015 if test x$ac_cv_enable_valgrind = xyes; then
1017 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1018 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1019 if test x"$ac_cv_enable_valgrind" = xyes; then
1020 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1022 AC_MSG_RESULT(not found)
1027 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1029 dnl ****************************
1030 dnl ** Final configure output **
1031 dnl ****************************
1037 src/common/version.h
1040 src/common/passcrypt.h
1043 src/plugins/Makefile
1044 src/plugins/demo/Makefile
1045 src/plugins/bogofilter/Makefile
1046 src/plugins/spamassassin/Makefile
1047 src/plugins/dillo_viewer/Makefile
1048 src/plugins/trayicon/Makefile
1049 src/plugins/trayicon/libeggtrayicon/Makefile
1050 src/plugins/pgpcore/Makefile
1051 src/plugins/pgpmime/Makefile
1052 src/plugins/pgpinline/Makefile
1053 src/plugins/smime/Makefile
1060 manual/dist/Makefile
1061 manual/dist/pdf/Makefile
1062 manual/dist/ps/Makefile
1063 manual/dist/html/Makefile
1064 manual/dist/txt/Makefile
1066 manual/fr/dist/Makefile
1067 manual/fr/dist/pdf/Makefile
1068 manual/fr/dist/ps/Makefile
1069 manual/fr/dist/html/Makefile
1070 manual/fr/dist/txt/Makefile
1072 manual/pl/dist/Makefile
1073 manual/pl/dist/pdf/Makefile
1074 manual/pl/dist/ps/Makefile
1075 manual/pl/dist/html/Makefile
1076 manual/pl/dist/txt/Makefile
1078 manual/es/dist/Makefile
1079 manual/es/dist/pdf/Makefile
1080 manual/es/dist/ps/Makefile
1081 manual/es/dist/html/Makefile
1082 manual/es/dist/txt/Makefile
1086 dnl Output the configuration summary
1088 echo "$PACKAGE $VERSION"
1090 echo "JPilot : $ac_cv_enable_jpilot"
1091 echo "LDAP : $ac_cv_enable_ldap"
1092 echo "OpenSSL : $ac_cv_enable_openssl"
1093 echo "gnuTLS : $ac_cv_enable_gnutls"
1094 echo "iconv : $am_cv_func_iconv"
1095 echo "compface : $ac_cv_enable_compface"
1096 echo "IPv6 : $ac_cv_enable_ipv6"
1097 echo "enchant : $ac_cv_enable_enchant"
1098 echo "IMAP4 : $ac_cv_enable_libetpan"
1099 echo "NNTP : $ac_cv_enable_libetpan"
1100 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1101 echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
1102 echo "GTK+ print support: $ac_cv_have_gtk210"
1103 echo "LibSM : $ac_cv_enable_libsm"
1104 echo "DBUS : $enable_dbus"
1105 echo "NetworkManager : $enable_networkmanager_support"
1106 echo "Manual : $ac_cv_enable_manual"
1107 echo "Plugins : $PLUGINS"
1108 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1109 echo "Maemo build : $ac_cv_enable_maemo"
1110 echo "Config dir : $ac_cv_with_config_dir"
1112 echo "The binary will be installed in $prefix/bin"
1114 echo "Configure finished, type 'make' to build."