4 AC_CONFIG_AUX_DIR(config)
5 AC_CONFIG_MACRO_DIR([m4])
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}
22 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
29 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
30 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
31 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
34 AC_SUBST(MAJOR_VERSION)
35 AC_SUBST(MINOR_VERSION)
36 AC_SUBST(MICRO_VERSION)
37 AC_SUBST(EXTRA_VERSION)
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}}"
47 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
49 AC_SUBST(gnomedatadir)
51 AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
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/])
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")
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`
72 dnl Specify a header configuration file
73 AC_CONFIG_HEADERS(config.h)
77 dnl Checks for programs.
97 dnl ******************************
99 dnl Not needed anymore because we
100 dnl do AC_CANONICAL_SYSTEM above
101 dnl ******************************
102 dnl AC_CANONICAL_HOST
104 dnl Copied from the official gtk+-2 configure.in
105 AC_MSG_CHECKING([for some Win32 platform])
107 *-*-mingw*|*-*-cygwin*)
109 LDFLAGS="$LDFLAGS -mwindows"
115 AC_MSG_RESULT([$platform_win32])
116 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
118 AC_MSG_CHECKING([for native Win32])
127 AC_MSG_RESULT([$os_win32])
128 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
130 AC_MSG_CHECKING([for Cygwin])
139 AC_MSG_RESULT([$env_cygwin])
140 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
142 if test "$GCC" = "yes"
144 CFLAGS="$CFLAGS -Wno-unused-function"
145 #CFLAGS="-g -Wall -Wno-unused-function"
148 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
149 _gcc_cflags_save=$CFLAGS
150 CFLAGS="-Wno-pointer-sign"
151 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
152 AC_MSG_RESULT($_gcc_psign)
153 CFLAGS=$_gcc_cflags_save;
154 if test x"$_gcc_psign" = xyes ; then
155 CFLAGS="$CFLAGS -Wno-pointer-sign"
158 CFLAGS="$CFLAGS -Wall"
160 #if test $USE_MAINTAINER_MODE = yes; then
161 # 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"
167 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
170 # Note that we need to link to pthreadGC2 in all cases. This
171 # is because some locking is used even when pthread support is
173 pthread_name=pthreadGC2
174 CFLAGS="$CFLAGS -mms-bitfields"
175 LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
178 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
179 CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
186 dnl floor and ceil are in -lm
190 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
193 LIBS="$LIBS $GTK_LIBS"
194 AC_CHECK_FUNCS(bind_textdomain_codeset)
198 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"
199 GETTEXT_PACKAGE=claws-mail
200 AC_SUBST(GETTEXT_PACKAGE)
201 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
203 AM_GNU_GETTEXT_VERSION([0.15])
204 AM_GNU_GETTEXT([external])
206 manualdir='${docdir}/manual'
207 AC_ARG_WITH(manualdir,
208 [ --with-manualdir=DIR Manual directory],
209 [manualdir="$withval"])
212 AC_ARG_ENABLE(manual,
213 [ --disable-manual do not build manual],
214 [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
216 dnl ******************************
217 dnl ** Check for required tools **
218 dnl ** to build manuals **
219 dnl ******************************
221 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
222 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
223 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
224 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
226 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
227 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
228 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
229 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
231 if test x"$ac_cv_enable_manual" = x"yes"; then
232 if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
233 -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
234 ac_cv_enable_manual=yes
236 ac_cv_enable_manual=no
240 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
242 dnl Set PACKAGE_DATA_DIR in config.h.
243 if test "x${datarootdir}" = 'x${prefix}/share'; then
244 if test "x${prefix}" = "xNONE"; then
245 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
247 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
250 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
253 AC_CHECK_LIB(xpg4, setlocale)
258 [ --disable-libsm disable libSM support for session management.],
259 [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
260 AC_MSG_CHECKING([whether to use LibSM])
261 if test x"$ac_cv_enable_libsm" = xyes; then
263 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
264 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
266 AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
267 if test x"$ac_cv_enable_libsm" = xyes; then
268 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
270 AC_MSG_RESULT(not found)
271 AC_MSG_WARN([*** LibSM will not be supported ***])
278 dnl for GThread support (currently disabled)
279 dnl AC_ARG_ENABLE(threads,
280 dnl [ --enable-threads Enable multithread support [default=no]],
281 dnl [use_threads=$enableval], [use_threads=no])
283 AC_MSG_CHECKING([whether to use threads])
284 if test x"$use_threads" = xyes ; then
286 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
287 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
288 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
289 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
291 AC_MSG_ERROR([Claws Mail requires GThread from GLib to use threading.])
297 dnl Check for d_type member in struct dirent
298 AC_MSG_CHECKING([whether struct dirent has d_type member])
299 AC_CACHE_VAL(ac_cv_dirent_d_type,[
300 AC_TRY_COMPILE([#include <dirent.h>],
301 [struct dirent d; d.d_type = DT_REG;],
302 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
304 AC_MSG_RESULT($ac_cv_dirent_d_type)
305 if test $ac_cv_dirent_d_type = yes; then
306 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
307 Define if `struct dirent' has `d_type' member.)
310 # Check whether mkdir does not take the permission argument.
311 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
313 dnl Checks for header files.
317 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
318 sys/param.h sys/utsname.h sys/select.h \
319 wchar.h wctype.h locale.h netdb.h)
320 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
321 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
323 dnl alf - Check for apache installation f*ck up. apache may also install an
324 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
325 AC_TRY_COMPILE([#include <stdlib.h>
326 #include <fnmatch.h>],
327 [int x = USE_HSREGEX;],
328 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
329 if test $ac_cv_have_apache_fnmatch = yes; then
330 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
332 AC_MSG_CHECKING([whether to use Apache regex header kludge])
333 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
335 dnl Checks for typedefs, structures, and compiler characteristics.
342 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
343 dnl may be defined only in wchar.h (this happens with gcc-2.96).
344 dnl So we need to use this extended macro.
345 CLAWS_CHECK_TYPE(wint_t, unsigned int,
350 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
352 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
353 AC_CHECK_SIZEOF(unsigned short, 2)
354 AC_CHECK_SIZEOF(unsigned int, 4)
355 AC_CHECK_SIZEOF(unsigned long, 4)
357 dnl Checks for library functions.
359 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
360 uname flock lockf inet_aton inet_addr \
361 fchmod mkstemp truncate getuid regcomp)
363 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
365 dnl *****************
366 dnl ** common code **
367 dnl *****************
370 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
372 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
373 AC_SUBST(GLIB_GENMARSHAL)
375 AC_SUBST(GLIB_CFLAGS)
378 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
380 LIBS="$LIBS $GTK_LIBS"
381 AC_CHECK_FUNCS(bind_textdomain_codeset)
384 dnl check for IPv6 option
386 [ --disable-ipv6 disable build IPv6 support],
387 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
389 dnl automated checks for IPv6 support.
390 AC_MSG_CHECKING([whether to use IPv6])
391 if test x"$ac_cv_enable_ipv6" = xyes; then
393 AC_MSG_CHECKING([for IPv6 support])
394 AC_CACHE_VAL(ac_cv_ipv6,[
395 AC_TRY_COMPILE([#define INET6
396 #include <sys/types.h>
397 #include <netinet/in.h>],
398 [int x = IPPROTO_IPV6; struct in6_addr a;],
399 ac_cv_ipv6=yes, ac_cv_ipv6=no)
401 AC_MSG_RESULT($ac_cv_ipv6)
402 if test $ac_cv_ipv6 = yes; then
403 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
405 AC_MSG_WARN(*** IPv6 will not be supported ***)
413 AC_MSG_CHECKING([whether to use GnuTLS])
414 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
415 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
417 AC_MSG_RESULT($ac_cv_enable_gnutls)
418 if test "x$ac_cv_enable_gnutls" != "xno"; then
419 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
421 AC_DEFINE(USE_GNUTLS, 1, gnutls)
422 echo "Building with GnuTLS"
425 echo "Building without gnutls"
427 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
429 dnl No linking against libgcrypt needed
432 dnl linking against libgcrypt *is* needed
433 GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
435 AC_SUBST(GNUTLS_LIBS)
436 AC_SUBST(GNUTLS_CFLAGS)
439 dnl password encryption
444 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
447 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
454 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
455 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
456 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
458 dnl RC dir (will be default at a certain point in time)
459 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
460 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
461 if test x"$ac_cv_with_config_dir" = x""; then
462 ac_cv_with_config_dir=".claws-mail"
464 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
466 dnl ************************
467 dnl ** GTK user interface **
468 dnl ************************
472 AS_HELP_STRING([--enable-gtk3],
473 [Determines whether to use Gtk+ 3.0.]),
474 [ac_cv_enable_gtk3=$enableval],[ac_cv_enable_gtk3=no])
475 AM_CONDITIONAL(GTK3, false)
476 AM_CONDITIONAL(GTK2, true)
477 if test x"$ac_cv_enable_gtk3" = x"yes"; then
478 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 cairo)
479 AM_CONDITIONAL(GTK3, true)
480 AM_CONDITIONAL(GTK2, false)
482 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
484 dnl --disable-deprecated switch for GTK2 purification
485 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
486 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
491 dnl enchant is used for spell checking
492 AC_MSG_CHECKING([whether to use enchant])
493 AC_ARG_ENABLE(enchant,
494 [ --disable-enchant disable enchant support],
495 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
496 AC_MSG_RESULT($ac_cv_enable_enchant)
497 if test $ac_cv_enable_enchant = yes; then
498 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
500 AC_DEFINE(USE_ENCHANT, 1, enchant)
501 echo "Building with enchant"
502 ac_cv_enable_enchant=yes
503 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
506 echo "Building without enchant-notification"
507 ac_cv_enable_enchant=no
509 AC_SUBST(ENCHANT_CFLAGS)
510 AC_SUBST(ENCHANT_LIBS)
513 dnl want crash dialog
514 AC_ARG_ENABLE(crash-dialog,
515 [ --enable-crash-dialog Enable crash dialog [default=no]],
516 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
517 if test $ac_cv_enable_crash_dialog = yes; then
518 dnl check if GDB is somewhere
519 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
520 AC_MSG_CHECKING([whether to use crash dialog])
521 if test $ac_cv_enable_crash_dialog = yes; then
522 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
524 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
528 AC_ARG_ENABLE(generic-umpc,
529 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
530 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
531 if test $ac_cv_enable_generic_umpc = yes; then
532 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
533 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
538 [ --enable-maemo build for the Maemo platform [default=no]],
539 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
540 if test $ac_cv_enable_maemo = yes; then
541 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
542 ac_cv_enable_maemo=no)
543 AC_SUBST(MAEMO_CFLAGS)
545 if test $ac_cv_enable_maemo = no; then
547 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
548 ac_cv_enable_maemo=no)
549 AC_SUBST(MAEMO_CFLAGS)
551 if test $ac_cv_enable_maemo = no; then
552 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
554 AC_DEFINE(MAEMO, 1, Build for maemo)
555 AC_DEFINE(CHINOOK, 1, Maemo chinook)
556 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
557 ac_cv_enable_generic_umpc=yes
560 AC_DEFINE(MAEMO, 1, Build for maemo)
561 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
562 ac_cv_enable_generic_umpc=yes
566 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
567 ac_cv_enable_conic=no)
568 AC_SUBST(CONIC_CFLAGS)
570 if test $ac_cv_enable_conic = yes; then
571 AC_DEFINE(CONIC, 1, Have conic lib)
574 dnl Check for X-Face support
575 AC_ARG_ENABLE(compface,
576 [ --disable-compface disable compface (X-Face) support],
577 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
578 AC_MSG_CHECKING([whether to use compface])
579 if test x"$ac_cv_enable_compface" = xyes; then
581 AC_CHECK_LIB(compface, uncompface,
582 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
583 [ac_cv_enable_compface=no])
584 if test x"$ac_cv_enable_compface" = xyes; then
585 COMPFACE_LIBS="-lcompface"
589 AC_SUBST(COMPFACE_LIBS)
594 dnl check for pthread support
595 AC_ARG_ENABLE(pthread,
596 [ --disable-pthread disable pthread support],
597 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
598 AC_MSG_CHECKING([whether to use pthread])
599 if test x$ac_cv_enable_pthread = xno; then
604 # For W32 we need to use a special ptrhead lib. In this case we can't
605 # use AC_CHECK_LIB because it has no means of checking for a
606 # library installed under a different name. Checking for the
608 if test -n "${pthread_name}" ; then
609 ac_cv_enable_pthread=yes
611 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
613 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
615 if test x$ac_cv_enable_pthread = xyes; then
616 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
617 if test -z "${pthread_name}" ; then
618 PTHREAD_LIBS="-lpthread"
623 AC_SUBST(PTHREAD_LIBS)
626 dnl Check whether we need to pass -lresolv
627 dnl We know that we don't need it for W32.
629 if test x$os_win32 = xno; then
632 ac_cv_var__res_options=no
633 AC_TRY_LINK([#include <sys/types.h>
634 #include <sys/socket.h>
635 #include <netinet/in.h>
636 #include <arpa/nameser.h>
637 #include <resolv.h>],
638 [_res.options = RES_INIT;],
639 ac_cv_var__res_options=yes);
640 if test "$ac_cv_var__res_options" != "yes"; then
645 if test "x$LIBRESOLV" = "x"; then
646 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
652 LIBS="$LIBS $LIBRESOLV"
654 dnl #######################################################################
655 dnl # Check for startup notification
656 dnl #######################################################################
657 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
659 if test "x$enable_startup_notification" = "xyes"; then
660 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
662 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
663 echo "Building with libstartup-notification"
664 enable_startup_notification=yes
667 echo "Building without libstartup-notification"
668 enable_startup_notification=no
671 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
672 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
675 dnl #######################################################################
676 dnl # Check for D-Bus support
677 dnl #######################################################################
678 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
680 if test "x$enable_dbus" = "xyes"; then
681 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
683 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
687 echo "D-Bus requirements not met. D-Bus support not activated."
690 AC_SUBST(DBUS_CFLAGS)
694 dnl #######################################################################
695 dnl # Configure address book support
696 dnl #######################################################################
698 dnl #######################################################################
699 dnl # Check for new address book support
700 dnl #######################################################################
701 AC_MSG_CHECKING([whether DBUS support for new address book is present])
702 if test x"$enable_dbus_glib" = xyes; then
704 AC_MSG_CHECKING([whether to enable new address book])
705 AC_ARG_ENABLE(new-addrbook, [ --enable-new-addrbook enable new address book],,enable_new_addrbook=no)
706 if test x"$enable_new_addrbook" = xyes; then
708 PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
710 AC_DEFINE(USE_NEW_ADDRBOOK, 1, [Define if new address book is to be activated.])
711 enable_new_addrbook=yes
712 AC_SUBST(CONTACTS_CFLAGS)
713 AC_SUBST(CONTACTS_LIBS)
716 enable_new_addrbook=no
720 enable_new_addrbook=no
724 enable_new_addrbook=no
727 dnl #######################################################################
728 dnl # Check for old address book support
729 dnl #######################################################################
730 if test x"$enable_new_addrbook" = xno; then
731 dnl for LDAP support in addressbook
732 dnl no check for libraries; dynamically loaded
734 [ --disable-ldap disable LDAP support],
735 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
736 AC_MSG_CHECKING([whether to use LDAP])
737 if test x"$ac_cv_enable_ldap" = xno; then
739 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
740 AC_MSG_RESULT(no - LDAP support needs pthread support)
743 elif test x"$platform_win32" = xyes; then
745 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
746 LDAP_LIBS="-lwldap32"
751 dnl check for available libraries, and pull them in
752 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
753 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
754 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
755 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
758 AC_CHECK_HEADERS(ldap.h lber.h,
759 [ ac_cv_enable_ldap=yes ],
760 [ ac_cv_enable_ldap=no ])
762 if test "$ac_cv_enable_ldap" = yes; then
763 AC_CHECK_LIB(ldap, ldap_open,
764 [ ac_cv_enable_ldap=yes ],
765 [ ac_cv_enable_ldap=no ],
768 AC_CHECK_LIB(ldap, ldap_start_tls_s,
769 [ ac_cv_have_tls=yes ],
770 [ ac_cv_have_tls=no ])
774 AC_MSG_CHECKING([whether ldap library is available])
775 AC_MSG_RESULT($ac_cv_enable_ldap)
777 AC_MSG_CHECKING([whether TLS library is available])
778 AC_MSG_RESULT($ac_cv_have_tls)
780 if test "$ac_cv_enable_ldap" = yes; then
781 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
782 LDAP_LIBS="$LDAP_LIBS -lldap"
784 if test "$ac_cv_have_tls" = yes; then
785 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
787 dnl As of OpenLDAP API version 3000 a number of functions has
788 dnl been deprecated. As Claws-mail compiles and runs on many
789 dnl platforms and many versions of OpenLDAP we need to be able
790 dnl to switch between the old and new API because new API has
791 dnl added new functions replacing old ones and at the same time
792 dnl old functions has been changed.
793 dnl If cross-compiling defaults to enable deprecated features
794 dnl for maximum portability
795 AC_MSG_CHECKING([The API version of OpenLDAP])
799 [if (LDAP_API_VERSION >= 3000)
802 [AC_MSG_RESULT([version < 3000])
803 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
804 [AC_MSG_RESULT([version >= 3000])
805 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
806 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
807 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
808 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
813 dnl for JPilot support in addressbook
814 dnl no check for libraries; these are dynamically loaded
815 AC_ARG_ENABLE(jpilot,
816 [ --disable-jpilot disable JPilot support],
817 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
818 AC_MSG_CHECKING([whether to use JPilot])
819 if test "$ac_cv_enable_jpilot" = yes; then
821 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
822 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
823 [ ac_cv_enable_jpilot=no ])
824 if test "$ac_cv_enable_jpilot" = no; then
825 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
826 [ ac_cv_enable_jpilot=yes
827 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
830 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
831 if test x"$ac_cv_enable_jpilot" = xyes; then
832 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
834 AC_MSG_NOTICE([JPilot support not available])
836 AC_SUBST(JPILOT_LIBS)
842 AM_CONDITIONAL(BUILD_NEWADDRBOOK, test x"$enable_new_addrbook" = x"yes")
844 dnl #######################################################################
845 dnl # Check for NetworkManager support
846 dnl #######################################################################
847 if test x"$enable_dbus_glib" = xyes; then
848 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
849 if test x"$enable_networkmanager_support" = xyes; then
850 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
852 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
853 echo "Building with NetworkManager support"
854 enable_networkmanager_support=yes
857 echo "NetworkManager not found."
858 enable_networkmanager_support=no
860 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
863 echo "NetworkManager support deactivated as D-Bus requirements were not met."
864 enable_networkmanager_support=no
867 dnl *************************
868 dnl ** section for plugins **
869 dnl *************************
874 AC_MSG_CHECKING([whether to build Trayicon plugin])
875 AC_ARG_ENABLE(trayicon-plugin,
876 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
877 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
878 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
880 PLUGINS="trayicon $PLUGINS"
884 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
886 dnl --- SpamAssassin ---
887 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
888 AC_ARG_ENABLE(spamassassin-plugin,
889 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
890 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
891 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
894 PLUGINS="spamassassin $PLUGINS"
895 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
899 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
901 dnl --- Bogofilter ---
902 AC_MSG_CHECKING([whether to build Bogofilter plugin])
903 AC_ARG_ENABLE(bogofilter-plugin,
904 [ --disable-bogofilter-plugin do not build bogofilter plugin],
905 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
906 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
908 PLUGINS="bogofilter $PLUGINS"
909 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
913 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
916 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
917 AC_ARG_ENABLE(pgpcore-plugin,
918 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
919 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
920 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
922 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
923 [ac_cv_enable_pgpcore_plugin=no])
924 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
925 PLUGINS="pgpcore $PLUGINS"
927 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
928 [Define if GPGME supports PKA.]))
929 #needed to get GPGME_LIBS and al correctly
930 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
931 [ac_cv_enable_pgpcore_plugin=no])
933 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
938 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
940 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
941 AC_ARG_ENABLE(pgpmime-plugin,
942 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
943 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
944 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
946 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
947 PLUGINS="pgpmime $PLUGINS"
949 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
950 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
955 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
957 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
958 AC_ARG_ENABLE(pgpinline-plugin,
959 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
960 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
961 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
963 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
964 PLUGINS="pgpinline $PLUGINS"
966 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
967 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
972 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
974 AC_MSG_CHECKING([whether to build S/Mime plugin])
975 AC_ARG_ENABLE(smime-plugin,
976 [ --disable-smime-plugin do not build S/Mime plugin],
977 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
978 if test x"$ac_cv_enable_smime_plugin" = xyes; then
980 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
981 PLUGINS="smime $PLUGINS"
983 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
984 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
989 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
991 dnl --- Dillo Viewer ---
992 AC_MSG_CHECKING([whether to build Dillo plugin])
993 AC_ARG_ENABLE(dillo-viewer-plugin,
994 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
995 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
996 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
998 PLUGINS="dillo-viewer $PLUGINS"
1002 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
1005 AC_ARG_ENABLE(demo-plugin,
1006 [ --enable-demo-plugin build demo plugin],
1007 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
1008 if test x"$ac_cv_enable_demo_plugin" = xyes; then
1009 PLUGINS="demo $PLUGINS"
1011 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
1014 AC_MSG_CHECKING([whether to use libetpan])
1015 AC_ARG_ENABLE(libetpan,
1016 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
1017 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
1018 if test x"$ac_cv_enable_libetpan" = xyes; then
1021 AC_PATH_PROG(libetpanconfig, [libetpan-config])
1022 if test "x$libetpanconfig" != "x"; then
1023 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
1024 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
1025 if test "x$libetpan_result" = "xyes"; then
1026 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
1027 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
1028 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
1029 AC_MSG_RESULT([$libetpan_result])
1032 if test "x$libetpan_result" = "xyes"; then
1033 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
1034 LIBETPAN_LIBS="`$libetpanconfig --libs`"
1035 LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
1036 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
1037 if test x"$LIBETPAN_STABLE" != "x"; then
1038 LIBETPAN_VERSION="100"
1040 if test "$LIBETPAN_VERSION" -lt "057"; then
1041 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
1042 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1043 AC_MSG_ERROR([libetpan 0.57 not found])
1045 AC_SUBST(LIBETPAN_FLAGS)
1046 AC_SUBST(LIBETPAN_LIBS)
1047 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
1049 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
1050 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1051 AC_MSG_ERROR([libetpan 0.57 not found])
1056 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1058 AC_MSG_CHECKING([whether to use valgrind])
1059 AC_ARG_ENABLE(valgrind,
1060 [ --disable-valgrind disable valgrind support for debugging],
1061 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1062 if test x$ac_cv_enable_valgrind = xyes; then
1064 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1065 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1066 if test x"$ac_cv_enable_valgrind" = xyes; then
1067 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1069 AC_MSG_RESULT(not found)
1074 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1076 dnl ****************************
1077 dnl ** Final configure output **
1078 dnl ****************************
1084 src/common/version.h
1087 src/common/passcrypt.h
1090 src/plugins/Makefile
1091 src/plugins/demo/Makefile
1092 src/plugins/bogofilter/Makefile
1093 src/plugins/spamassassin/Makefile
1094 src/plugins/dillo_viewer/Makefile
1095 src/plugins/trayicon/Makefile
1096 src/plugins/pgpcore/Makefile
1097 src/plugins/pgpmime/Makefile
1098 src/plugins/pgpinline/Makefile
1099 src/plugins/smime/Makefile
1106 manual/dist/Makefile
1107 manual/dist/pdf/Makefile
1108 manual/dist/ps/Makefile
1109 manual/dist/html/Makefile
1110 manual/dist/txt/Makefile
1112 manual/fr/dist/Makefile
1113 manual/fr/dist/pdf/Makefile
1114 manual/fr/dist/ps/Makefile
1115 manual/fr/dist/html/Makefile
1116 manual/fr/dist/txt/Makefile
1118 manual/pl/dist/Makefile
1119 manual/pl/dist/pdf/Makefile
1120 manual/pl/dist/ps/Makefile
1121 manual/pl/dist/html/Makefile
1122 manual/pl/dist/txt/Makefile
1124 manual/es/dist/Makefile
1125 manual/es/dist/pdf/Makefile
1126 manual/es/dist/ps/Makefile
1127 manual/es/dist/html/Makefile
1128 manual/es/dist/txt/Makefile
1130 manual/de/dist/Makefile
1131 manual/de/dist/pdf/Makefile
1132 manual/de/dist/ps/Makefile
1133 manual/de/dist/html/Makefile
1134 manual/de/dist/txt/Makefile
1138 dnl Output the configuration summary
1140 echo "$PACKAGE $VERSION"
1142 if test x"$enable_new_addrbook" = xyes; then
1143 echo "Using Address Book : New experimental interface"
1145 echo "Using Address Book : Old stable interface"
1146 echo "JPilot : $ac_cv_enable_jpilot"
1147 echo "LDAP : $ac_cv_enable_ldap"
1149 echo "gnuTLS : $ac_cv_enable_gnutls"
1150 echo "iconv : $am_cv_func_iconv"
1151 echo "compface : $ac_cv_enable_compface"
1152 echo "IPv6 : $ac_cv_enable_ipv6"
1153 echo "enchant : $ac_cv_enable_enchant"
1154 echo "IMAP4 : $ac_cv_enable_libetpan"
1155 echo "NNTP : $ac_cv_enable_libetpan"
1156 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1157 echo "LibSM : $ac_cv_enable_libsm"
1158 echo "DBUS : $enable_dbus"
1159 echo "NetworkManager : $enable_networkmanager_support"
1160 echo "Manual : $ac_cv_enable_manual"
1161 echo "Plugins : $PLUGINS"
1162 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1163 echo "Maemo build : $ac_cv_enable_maemo"
1164 echo "Config dir : $ac_cv_with_config_dir"
1166 echo "The binary will be installed in $prefix/bin"
1168 echo "Configure finished, type 'make' to build."