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.
96 dnl ******************************
98 dnl Not needed anymore because we
99 dnl do AC_CANONICAL_SYSTEM above
100 dnl ******************************
101 dnl AC_CANONICAL_HOST
103 dnl Copied from the official gtk+-2 configure.in
104 AC_MSG_CHECKING([for some Win32 platform])
106 *-*-mingw*|*-*-cygwin*)
108 LDFLAGS="$LDFLAGS -mwindows"
114 AC_MSG_RESULT([$platform_win32])
115 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
117 AC_MSG_CHECKING([for native Win32])
126 AC_MSG_RESULT([$os_win32])
127 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
129 AC_MSG_CHECKING([for Cygwin])
138 AC_MSG_RESULT([$env_cygwin])
139 AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
141 if test "$GCC" = "yes"
143 CFLAGS="$CFLAGS -Wno-unused-function"
146 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
147 _gcc_cflags_save=$CFLAGS
148 CFLAGS="-Wno-pointer-sign"
149 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
150 AC_MSG_RESULT($_gcc_psign)
151 CFLAGS=$_gcc_cflags_save;
152 if test x"$_gcc_psign" = xyes ; then
153 CFLAGS="$CFLAGS -Wno-pointer-sign"
156 CFLAGS="$CFLAGS -Wall"
158 if test $USE_MAINTAINER_MODE = yes; then
159 CFLAGS="-g -Wall -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
165 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
168 # Note that we need to link to pthreadGC2 in all cases. This
169 # is because some locking is used even when pthread support is
171 pthread_name=pthreadGC2
172 CFLAGS="$CFLAGS -mms-bitfields"
173 LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
176 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
177 CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
185 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
188 LIBS="$LIBS $GTK_LIBS"
189 AC_CHECK_FUNCS(bind_textdomain_codeset)
193 ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id it ja nl pl pt_BR pt_PT ru sk sv uk zh_CN"
194 GETTEXT_PACKAGE=claws-mail
195 AC_SUBST(GETTEXT_PACKAGE)
196 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
198 AM_GNU_GETTEXT_VERSION([0.15])
199 AM_GNU_GETTEXT([external])
201 manualdir='${docdir}/manual'
202 AC_ARG_WITH(manualdir,
203 [ --with-manualdir=DIR Manual directory],
204 [manualdir="$withval"])
207 AC_ARG_ENABLE(manual,
208 [ --disable-manual do not build manual],
209 [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
211 dnl ******************************
212 dnl ** Check for required tools **
213 dnl ** to build manuals **
214 dnl ******************************
215 SAXON=`which saxon 2> /dev/null`
216 if test $? -ne 0; then
219 if test -z "$SAXON"; then
220 SAXONJAR='/usr/share/java/saxon.jar'
221 if test ! -f "$SAXONJAR"; then
222 SAXONJAR='/usr/local/share/java/saxon.jar'
223 if test ! -f "$SAXONJAR"; then
228 AM_CONDITIONAL(MANUAL_PDF, test -n "$SAXON" -o -n "$SAXONJAR")
230 DOCBOOK2TXT=`which docbook2txt 2> /dev/null`
231 if test $? -ne 0; then
234 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
236 DOCBOOK2HTML=`which docbook2html 2> /dev/null`
237 if test $? -ne 0; then
240 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
242 DOCBOOK2PS=`which docbook2ps 2> /dev/null`
243 if test $? -ne 0; then
246 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
248 if test x"$ac_cv_enable_manual" = x"yes"; then
249 if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
250 -o -n "$DOCBOOK2PS" -o -n "$SAXON" -o -n "$SAXONJAR"; then
251 ac_cv_enable_manual=yes
253 ac_cv_enable_manual=no
257 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
259 dnl Set PACKAGE_DATA_DIR in config.h.
260 if test "x${datarootdir}" = 'x${prefix}/share'; then
261 if test "x${prefix}" = "xNONE"; then
262 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
264 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
267 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
270 AC_CHECK_LIB(xpg4, setlocale)
275 [ --disable-libsm disable libSM support for session management.],
276 [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
277 AC_MSG_CHECKING([whether to use LibSM])
278 if test x"$ac_cv_enable_libsm" = xyes; then
280 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
281 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
283 AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
284 if test x"$ac_cv_enable_libsm" = xyes; then
285 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
287 AC_MSG_RESULT(not found)
288 AC_MSG_WARN([*** LibSM will not be supported ***])
295 dnl for GThread support (currently disabled)
296 dnl AC_ARG_ENABLE(threads,
297 dnl [ --enable-threads Enable multithread support [default=no]],
298 dnl [use_threads=$enableval], [use_threads=no])
300 AC_MSG_CHECKING([whether to use threads])
301 if test x"$use_threads" = xyes ; then
303 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
304 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
305 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
306 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
308 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
314 dnl Check for d_type member in struct dirent
315 AC_MSG_CHECKING([whether struct dirent has d_type member])
316 AC_CACHE_VAL(ac_cv_dirent_d_type,[
317 AC_TRY_COMPILE([#include <dirent.h>],
318 [struct dirent d; d.d_type = DT_REG;],
319 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
321 AC_MSG_RESULT($ac_cv_dirent_d_type)
322 if test $ac_cv_dirent_d_type = yes; then
323 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
324 Define if `struct dirent' has `d_type' member.)
327 # Check whether mkdir does not take the permission argument.
328 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
330 dnl Checks for header files.
334 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
335 sys/param.h sys/utsname.h sys/select.h \
336 wchar.h wctype.h locale.h netdb.h)
337 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
338 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
340 dnl alf - Check for apache installation f*ck up. apache may also install an
341 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
342 AC_TRY_COMPILE([#include <stdlib.h>
343 #include <fnmatch.h>],
344 [int x = USE_HSREGEX;],
345 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
346 if test $ac_cv_have_apache_fnmatch = yes; then
347 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
349 AC_MSG_CHECKING([whether to use Apache regex header kludge])
350 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
352 dnl Checks for typedefs, structures, and compiler characteristics.
359 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
360 dnl may be defined only in wchar.h (this happens with gcc-2.96).
361 dnl So we need to use this extended macro.
362 CLAWS_CHECK_TYPE(wint_t, unsigned int,
367 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
369 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
370 AC_CHECK_SIZEOF(unsigned short, 2)
371 AC_CHECK_SIZEOF(unsigned int, 4)
372 AC_CHECK_SIZEOF(unsigned long, 4)
374 dnl Checks for library functions.
376 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
377 uname flock lockf inet_aton inet_addr \
378 fchmod mkstemp truncate getuid regcomp)
380 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
382 dnl *****************
383 dnl ** common code **
384 dnl *****************
387 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
389 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
390 AC_SUBST(GLIB_GENMARSHAL)
392 AC_SUBST(GLIB_CFLAGS)
395 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
397 LIBS="$LIBS $GTK_LIBS"
398 AC_CHECK_FUNCS(bind_textdomain_codeset)
401 dnl check for IPv6 option
403 [ --disable-ipv6 disable build IPv6 support],
404 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
406 dnl automated checks for IPv6 support.
407 AC_MSG_CHECKING([whether to use IPv6])
408 if test x"$ac_cv_enable_ipv6" = xyes; then
410 AC_MSG_CHECKING([for IPv6 support])
411 AC_CACHE_VAL(ac_cv_ipv6,[
412 AC_TRY_COMPILE([#define INET6
413 #include <sys/types.h>
414 #include <netinet/in.h>],
415 [int x = IPPROTO_IPV6; struct in6_addr a;],
416 ac_cv_ipv6=yes, ac_cv_ipv6=no)
418 AC_MSG_RESULT($ac_cv_ipv6)
419 if test $ac_cv_ipv6 = yes; then
420 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
422 AC_MSG_WARN(*** IPv6 will not be supported ***)
430 AC_MSG_CHECKING([whether to use GnuTLS])
431 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
432 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
434 AC_MSG_RESULT($ac_cv_enable_gnutls)
435 if test "x$ac_cv_enable_gnutls" != "xno"; then
436 OCPPFLAGS="$CPPFLAGS"
439 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.3,
440 [ac_cv_enable_gnutls=yes],
441 [ac_cv_enable_gnutls=no
442 echo "GnuTLS version >= 2.0.3 not found"])
443 if test "x$ac_cv_enable_gnutls" = "xyes"; then
444 AC_CHECK_HEADER(gpg-error.h,
445 [AC_CHECK_LIB(gpg-error, gpg_strerror,,
446 [ac_cv_enable_gnutls=no])
447 ],[ac_cv_enable_gnutls=no])
449 if test "x$ac_cv_enable_gnutls" = "xyes"; then
450 GCRYPT_LIBS="-lgpg-error"
451 AC_CHECK_HEADER(gcrypt.h,
452 [AC_CHECK_LIB(gcrypt, gcry_control,,
453 [ac_cv_enable_gnutls=no])
454 ],[ac_cv_enable_gnutls=no])
456 if test "x$ac_cv_enable_gnutls" = "xyes"; then
457 if test x"$platform_win32" = "xyes"; then
458 GNUTLS_LIBS="-lgnutls -lgcrypt ${GCRYPT_LIBS}"
460 GNUTLS_LIBS="-lgnutls -lgcrypt -lz ${GCRYPT_LIBS}"
464 CPPFLAGS="$OCPPFLAGS"
468 if test "x$ac_cv_enable_gnutls" = "xyes"; then
469 AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
473 AC_SUBST(GNUTLS_LIBS)
475 dnl password encryption
480 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
483 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
490 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
491 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
492 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
494 dnl RC dir (will be default at a certain point in time)
495 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
496 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
497 if test x"$ac_cv_with_config_dir" = x""; then
498 ac_cv_with_config_dir=".claws-mail"
500 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
502 dnl ************************
503 dnl ** GTK user interface **
504 dnl ************************
507 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
509 dnl --disable-deprecated switch for GTK2 purification
510 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
511 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
516 dnl enchant is used for spell checking
517 AC_MSG_CHECKING([whether to use enchant])
518 AC_ARG_ENABLE(enchant,
519 [ --disable-enchant disable enchant support],
520 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
521 AC_MSG_RESULT($ac_cv_enable_enchant)
522 if test $ac_cv_enable_enchant = yes; then
523 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
525 AC_DEFINE(USE_ENCHANT, 1, enchant)
526 echo "Building with enchant"
527 ac_cv_enable_enchant=yes
528 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
531 echo "Building without enchant-notification"
532 ac_cv_enable_enchant=no
534 AC_SUBST(ENCHANT_CFLAGS)
535 AC_SUBST(ENCHANT_LIBS)
538 dnl want crash dialog
539 AC_ARG_ENABLE(crash-dialog,
540 [ --enable-crash-dialog Enable crash dialog [default=no]],
541 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
542 if test $ac_cv_enable_crash_dialog = yes; then
543 dnl check if GDB is somewhere
544 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
545 AC_MSG_CHECKING([whether to use crash dialog])
546 if test $ac_cv_enable_crash_dialog = yes; then
547 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
549 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
553 AC_ARG_ENABLE(generic-umpc,
554 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
555 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
556 if test $ac_cv_enable_generic_umpc = yes; then
557 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
558 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
563 [ --enable-maemo build for the Maemo platform [default=no]],
564 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
565 if test $ac_cv_enable_maemo = yes; then
566 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
567 ac_cv_enable_maemo=no)
568 AC_SUBST(MAEMO_CFLAGS)
570 if test $ac_cv_enable_maemo = no; then
572 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
573 ac_cv_enable_maemo=no)
574 AC_SUBST(MAEMO_CFLAGS)
576 if test $ac_cv_enable_maemo = no; then
577 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
579 AC_DEFINE(MAEMO, 1, Build for maemo)
580 AC_DEFINE(CHINOOK, 1, Maemo chinook)
581 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
582 ac_cv_enable_generic_umpc=yes
585 AC_DEFINE(MAEMO, 1, Build for maemo)
586 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
587 ac_cv_enable_generic_umpc=yes
591 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
592 ac_cv_enable_conic=no)
593 AC_SUBST(CONIC_CFLAGS)
595 if test $ac_cv_enable_conic = yes; then
596 AC_DEFINE(CONIC, 1, Have conic lib)
599 dnl Check for X-Face support
600 AC_ARG_ENABLE(compface,
601 [ --disable-compface disable compface (X-Face) support],
602 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
603 AC_MSG_CHECKING([whether to use compface])
604 if test x"$ac_cv_enable_compface" = xyes; then
606 AC_CHECK_LIB(compface, uncompface,
607 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
608 [ac_cv_enable_compface=no])
609 if test x"$ac_cv_enable_compface" = xyes; then
610 COMPFACE_LIBS="-lcompface"
614 AC_SUBST(COMPFACE_LIBS)
619 dnl check for pthread support
620 AC_ARG_ENABLE(pthread,
621 [ --disable-pthread disable pthread support],
622 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
623 AC_MSG_CHECKING([whether to use pthread])
624 if test x$ac_cv_enable_pthread = xno; then
629 # For W32 we need to use a special ptrhead lib. In this case we can't
630 # use AC_CHECK_LIB because it has no means of checking for a
631 # library installed under a different name. Checking for the
633 if test -n "${pthread_name}" ; then
634 ac_cv_enable_pthread=yes
636 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
638 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
640 if test x$ac_cv_enable_pthread = xyes; then
641 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
642 if test -z "${pthread_name}" ; then
643 PTHREAD_LIBS="-lpthread"
648 AC_SUBST(PTHREAD_LIBS)
651 dnl Check whether we need to pass -lresolv
652 dnl We know that we don't need it for W32.
654 if test x$os_win32 = xno; then
657 ac_cv_var__res_options=no
658 AC_TRY_LINK([#include <sys/types.h>
659 #include <sys/socket.h>
660 #include <netinet/in.h>
661 #include <arpa/nameser.h>
662 #include <resolv.h>],
663 [_res.options = RES_INIT;],
664 ac_cv_var__res_options=yes);
665 if test "$ac_cv_var__res_options" != "yes"; then
670 if test "x$LIBRESOLV" = "x"; then
671 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
677 LIBS="$LIBS $LIBRESOLV"
679 dnl for LDAP support in addressbook
680 dnl no check for libraries; dynamically loaded
682 [ --disable-ldap disable LDAP support],
683 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
684 AC_MSG_CHECKING([whether to use LDAP])
685 if test x"$ac_cv_enable_ldap" = xno; then
687 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
688 AC_MSG_RESULT(no - LDAP support needs pthread support)
694 dnl check for available libraries, and pull them in
695 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
696 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
697 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
698 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
701 AC_CHECK_HEADERS(ldap.h lber.h,
702 [ ac_cv_enable_ldap=yes ],
703 [ ac_cv_enable_ldap=no ])
705 if test "$ac_cv_enable_ldap" = yes; then
706 AC_CHECK_LIB(ldap, ldap_open,
707 [ ac_cv_enable_ldap=yes ],
708 [ ac_cv_enable_ldap=no ],
711 AC_CHECK_LIB(ldap, ldap_start_tls_s,
712 [ ac_cv_have_tls=yes ],
713 [ ac_cv_have_tls=no ])
717 AC_MSG_CHECKING([whether ldap library is available])
718 AC_MSG_RESULT($ac_cv_enable_ldap)
720 AC_MSG_CHECKING([whether TLS library is available])
721 AC_MSG_RESULT($ac_cv_have_tls)
723 if test "$ac_cv_enable_ldap" = yes; then
724 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
725 LDAP_LIBS="$LDAP_LIBS -lldap"
727 if test "$ac_cv_have_tls" = yes; then
728 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
730 dnl As of OpenLDAP API version 3000 a number of functions has
731 dnl been deprecated. As Claws-mail compiles and runs on many
732 dnl platforms and many versions of OpenLDAP we need to be able
733 dnl to switch between the old and new API because new API has
734 dnl added new functions replacing old ones and at the same time
735 dnl old functions has been changed.
736 dnl If cross-compiling defaults to enable deprecated features
737 dnl for maximum portability
738 AC_MSG_CHECKING([The API version of OpenLDAP])
742 [if (LDAP_API_VERSION >= 3000)
745 [AC_MSG_RESULT([version < 3000])
746 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
747 [AC_MSG_RESULT([version >= 3000])
748 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
749 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
750 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
751 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
756 dnl for JPilot support in addressbook
757 dnl no check for libraries; these are dynamically loaded
758 AC_ARG_ENABLE(jpilot,
759 [ --disable-jpilot disable JPilot support],
760 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
761 AC_MSG_CHECKING([whether to use JPilot])
762 if test "$ac_cv_enable_jpilot" = yes; then
764 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
765 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
766 [ ac_cv_enable_jpilot=no ])
767 if test "$ac_cv_enable_jpilot" = no; then
768 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
769 [ ac_cv_enable_jpilot=yes
770 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
773 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
774 if test x"$ac_cv_enable_jpilot" = xyes; then
775 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
777 AC_MSG_NOTICE([JPilot support not available])
779 AC_SUBST(JPILOT_LIBS)
784 dnl #######################################################################
785 dnl # Check for startup notification
786 dnl #######################################################################
787 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
789 if test "x$enable_startup_notification" = "xyes"; then
790 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
792 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
793 echo "Building with libstartup-notification"
794 enable_startup_notification=yes
797 echo "Building without libstartup-notification"
798 enable_startup_notification=no
801 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
802 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
805 dnl #######################################################################
806 dnl # Check for D-Bus support
807 dnl #######################################################################
808 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
810 if test "x$enable_dbus" = "xyes"; then
811 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
813 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
817 echo "D-Bus requirements not met. D-Bus support not activated."
820 AC_SUBST(DBUS_CFLAGS)
824 dnl #######################################################################
825 dnl # Check for NetworkManager support
826 dnl #######################################################################
827 if test x"$enable_dbus_glib" = xyes; then
828 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
829 if test x"$enable_networkmanager_support" = xyes; then
830 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
832 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
833 echo "Building with NetworkManager support"
834 enable_networkmanager_support=yes
837 echo "NetworkManager not found."
838 enable_networkmanager_support=no
840 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
843 echo "NetworkManager support deactivated as D-Bus requirements were not met."
844 enable_networkmanager_support=no
847 dnl *************************
848 dnl ** section for plugins **
849 dnl *************************
854 AC_MSG_CHECKING([whether to build Trayicon plugin])
855 AC_ARG_ENABLE(trayicon-plugin,
856 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
857 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
858 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
860 PLUGINS="trayicon $PLUGINS"
864 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
866 dnl --- SpamAssassin ---
867 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
868 AC_ARG_ENABLE(spamassassin-plugin,
869 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
870 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
871 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
874 PLUGINS="spamassassin $PLUGINS"
875 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
879 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
881 dnl --- Bogofilter ---
882 AC_MSG_CHECKING([whether to build Bogofilter plugin])
883 AC_ARG_ENABLE(bogofilter-plugin,
884 [ --disable-bogofilter-plugin do not build bogofilter plugin],
885 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
886 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
888 PLUGINS="bogofilter $PLUGINS"
889 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
893 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
896 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
897 AC_ARG_ENABLE(pgpcore-plugin,
898 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
899 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
900 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
902 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
903 [ac_cv_enable_pgpcore_plugin=no])
904 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
905 PLUGINS="pgpcore $PLUGINS"
907 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
908 [Define if GPGME supports PKA.]))
909 #needed to get GPGME_LIBS and al correctly
910 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
911 [ac_cv_enable_pgpcore_plugin=no])
913 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
918 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
920 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
921 AC_ARG_ENABLE(pgpmime-plugin,
922 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
923 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
924 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
926 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
927 PLUGINS="pgpmime $PLUGINS"
929 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
930 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
935 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
937 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
938 AC_ARG_ENABLE(pgpinline-plugin,
939 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
940 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
941 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
943 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
944 PLUGINS="pgpinline $PLUGINS"
946 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
947 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
952 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
954 AC_MSG_CHECKING([whether to build S/Mime plugin])
955 AC_ARG_ENABLE(smime-plugin,
956 [ --disable-smime-plugin do not build S/Mime plugin],
957 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
958 if test x"$ac_cv_enable_smime_plugin" = xyes; then
960 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
961 PLUGINS="smime $PLUGINS"
963 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
964 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
969 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
971 dnl --- Dillo Viewer ---
972 AC_MSG_CHECKING([whether to build Dillo plugin])
973 AC_ARG_ENABLE(dillo-viewer-plugin,
974 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
975 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
976 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
978 PLUGINS="dillo-viewer $PLUGINS"
982 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
985 AC_ARG_ENABLE(demo-plugin,
986 [ --enable-demo-plugin build demo plugin],
987 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
988 if test x"$ac_cv_enable_demo_plugin" = xyes; then
989 PLUGINS="demo $PLUGINS"
991 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
994 AC_MSG_CHECKING([whether to use libetpan])
995 AC_ARG_ENABLE(libetpan,
996 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
997 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
998 if test x"$ac_cv_enable_libetpan" = xyes; then
1001 AC_PATH_PROG(libetpanconfig, [libetpan-config])
1002 if test "x$libetpanconfig" != "x"; then
1003 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
1004 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
1005 if test "x$libetpan_result" = "xyes"; then
1006 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
1007 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
1008 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
1009 AC_MSG_RESULT([$libetpan_result])
1012 if test "x$libetpan_result" = "xyes"; then
1013 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
1014 LIBETPAN_LIBS="`$libetpanconfig --libs`"
1015 LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
1016 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
1017 if test x"$LIBETPAN_STABLE" != "x"; then
1018 LIBETPAN_VERSION="100"
1020 if test "$LIBETPAN_VERSION" -lt "057"; then
1021 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
1022 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1023 AC_MSG_ERROR([libetpan 0.57 not found])
1025 AC_SUBST(LIBETPAN_FLAGS)
1026 AC_SUBST(LIBETPAN_LIBS)
1027 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
1029 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
1030 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1031 AC_MSG_ERROR([libetpan 0.57 not found])
1036 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1038 AC_MSG_CHECKING([whether to use valgrind])
1039 AC_ARG_ENABLE(valgrind,
1040 [ --disable-valgrind disable valgrind support for debugging],
1041 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1042 if test x$ac_cv_enable_valgrind = xyes; then
1044 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1045 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1046 if test x"$ac_cv_enable_valgrind" = xyes; then
1047 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1049 AC_MSG_RESULT(not found)
1054 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1056 dnl ****************************
1057 dnl ** Final configure output **
1058 dnl ****************************
1064 src/common/version.h
1067 src/common/passcrypt.h
1070 src/plugins/Makefile
1071 src/plugins/demo/Makefile
1072 src/plugins/bogofilter/Makefile
1073 src/plugins/spamassassin/Makefile
1074 src/plugins/dillo_viewer/Makefile
1075 src/plugins/trayicon/Makefile
1076 src/plugins/pgpcore/Makefile
1077 src/plugins/pgpmime/Makefile
1078 src/plugins/pgpinline/Makefile
1079 src/plugins/smime/Makefile
1086 manual/dist/Makefile
1087 manual/dist/pdf/Makefile
1088 manual/dist/ps/Makefile
1089 manual/dist/html/Makefile
1090 manual/dist/txt/Makefile
1092 manual/fr/dist/Makefile
1093 manual/fr/dist/pdf/Makefile
1094 manual/fr/dist/ps/Makefile
1095 manual/fr/dist/html/Makefile
1096 manual/fr/dist/txt/Makefile
1098 manual/pl/dist/Makefile
1099 manual/pl/dist/pdf/Makefile
1100 manual/pl/dist/ps/Makefile
1101 manual/pl/dist/html/Makefile
1102 manual/pl/dist/txt/Makefile
1104 manual/es/dist/Makefile
1105 manual/es/dist/pdf/Makefile
1106 manual/es/dist/ps/Makefile
1107 manual/es/dist/html/Makefile
1108 manual/es/dist/txt/Makefile
1110 manual/de/dist/Makefile
1111 manual/de/dist/pdf/Makefile
1112 manual/de/dist/ps/Makefile
1113 manual/de/dist/html/Makefile
1114 manual/de/dist/txt/Makefile
1118 dnl Output the configuration summary
1120 echo "$PACKAGE $VERSION"
1122 echo "JPilot : $ac_cv_enable_jpilot"
1123 echo "LDAP : $ac_cv_enable_ldap"
1124 echo "gnuTLS : $ac_cv_enable_gnutls"
1125 echo "iconv : $am_cv_func_iconv"
1126 echo "compface : $ac_cv_enable_compface"
1127 echo "IPv6 : $ac_cv_enable_ipv6"
1128 echo "enchant : $ac_cv_enable_enchant"
1129 echo "IMAP4 : $ac_cv_enable_libetpan"
1130 echo "NNTP : $ac_cv_enable_libetpan"
1131 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1132 echo "LibSM : $ac_cv_enable_libsm"
1133 echo "DBUS : $enable_dbus"
1134 echo "NetworkManager : $enable_networkmanager_support"
1135 echo "Manual : $ac_cv_enable_manual"
1136 echo "Plugins : $PLUGINS"
1137 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1138 echo "Maemo build : $ac_cv_enable_maemo"
1139 echo "Config dir : $ac_cv_with_config_dir"
1141 echo "The binary will be installed in $prefix/bin"
1143 echo "Configure finished, type 'make' to build."