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="$CFLAGS -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 -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 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 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
213 dnl Set PACKAGE_DATA_DIR in config.h.
214 if test "x${datarootdir}" = 'x${prefix}/share'; then
215 if test "x${prefix}" = "xNONE"; then
216 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
218 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
221 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
224 AC_CHECK_LIB(xpg4, setlocale)
229 [ --disable-libsm disable libSM support for session management.],
230 [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
231 AC_MSG_CHECKING([whether to use LibSM])
232 if test x"$ac_cv_enable_libsm" = xyes; then
234 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
235 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
237 AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
238 if test x"$ac_cv_enable_libsm" = xyes; then
239 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
241 AC_MSG_RESULT(not found)
242 AC_MSG_WARN([*** LibSM will not be supported ***])
249 dnl for GThread support (currently disabled)
250 dnl AC_ARG_ENABLE(threads,
251 dnl [ --enable-threads Enable multithread support [default=no]],
252 dnl [use_threads=$enableval], [use_threads=no])
254 AC_MSG_CHECKING([whether to use threads])
255 if test x"$use_threads" = xyes ; then
257 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
258 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
259 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
260 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
262 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
268 dnl Check for d_type member in struct dirent
269 AC_MSG_CHECKING([whether struct dirent has d_type member])
270 AC_CACHE_VAL(ac_cv_dirent_d_type,[
271 AC_TRY_COMPILE([#include <dirent.h>],
272 [struct dirent d; d.d_type = DT_REG;],
273 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
275 AC_MSG_RESULT($ac_cv_dirent_d_type)
276 if test $ac_cv_dirent_d_type = yes; then
277 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
278 Define if `struct dirent' has `d_type' member.)
281 # Check whether mkdir does not take the permission argument.
282 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
284 dnl Checks for header files.
288 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
289 sys/param.h sys/utsname.h sys/select.h \
290 wchar.h wctype.h locale.h netdb.h)
291 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
292 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
294 dnl alf - Check for apache installation f*ck up. apache may also install an
295 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
296 AC_TRY_COMPILE([#include <stdlib.h>
297 #include <fnmatch.h>],
298 [int x = USE_HSREGEX;],
299 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
300 if test $ac_cv_have_apache_fnmatch = yes; then
301 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
303 AC_MSG_CHECKING([whether to use Apache regex header kludge])
304 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
306 dnl Checks for typedefs, structures, and compiler characteristics.
313 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
314 dnl may be defined only in wchar.h (this happens with gcc-2.96).
315 dnl So we need to use this extended macro.
316 CLAWS_CHECK_TYPE(wint_t, unsigned int,
321 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
323 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
324 AC_CHECK_SIZEOF(unsigned short, 2)
325 AC_CHECK_SIZEOF(unsigned int, 4)
326 AC_CHECK_SIZEOF(unsigned long, 4)
328 dnl Checks for library functions.
330 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
331 uname flock lockf inet_aton inet_addr \
332 fchmod mkstemp truncate getuid regcomp)
334 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
336 dnl *****************
337 dnl ** common code **
338 dnl *****************
341 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
343 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
344 AC_SUBST(GLIB_GENMARSHAL)
346 AC_SUBST(GLIB_CFLAGS)
349 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
351 LIBS="$LIBS $GTK_LIBS"
352 AC_CHECK_FUNCS(bind_textdomain_codeset)
355 dnl check for IPv6 option
357 [ --disable-ipv6 disable build IPv6 support],
358 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
360 dnl automated checks for IPv6 support.
361 AC_MSG_CHECKING([whether to use IPv6])
362 if test x"$ac_cv_enable_ipv6" = xyes; then
364 AC_MSG_CHECKING([for IPv6 support])
365 AC_CACHE_VAL(ac_cv_ipv6,[
366 AC_TRY_COMPILE([#define INET6
367 #include <sys/types.h>
368 #include <netinet/in.h>],
369 [int x = IPPROTO_IPV6; struct in6_addr a;],
370 ac_cv_ipv6=yes, ac_cv_ipv6=no)
372 AC_MSG_RESULT($ac_cv_ipv6)
373 if test $ac_cv_ipv6 = yes; then
374 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
376 AC_MSG_WARN(*** IPv6 will not be supported ***)
384 AC_MSG_CHECKING([whether to use GnuTLS])
385 AC_ARG_ENABLE(openssl, [ --enable-openssl enable GnuTLS support],
386 [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
387 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
388 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
390 if test "x$ac_cv_enable_gnutls" != "xyes"; then
391 if test "x$ac_cv_enable_openssl" = "xyes"; then
392 AC_MSG_ERROR(*** Use GnuTLS instead of OpenSSL due to licensing ***)
395 AC_MSG_RESULT($ac_cv_enable_gnutls)
396 if test "x$ac_cv_enable_gnutls" != "xno"; then
397 OCPPFLAGS="$CPPFLAGS"
400 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.3,
401 [ac_cv_enable_gnutls=yes],
402 [ac_cv_enable_gnutls=no
403 echo "GnuTLS version >= 2.0.3 not found"])
404 if test "x$ac_cv_enable_gnutls" = "xyes"; then
405 AC_CHECK_HEADER(gpg-error.h,
406 [AC_CHECK_LIB(gpg-error, gpg_strerror,,
407 [ac_cv_enable_gnutls=no])
408 ],[ac_cv_enable_gnutls=no])
410 if test "x$ac_cv_enable_gnutls" = "xyes"; then
411 GCRYPT_LIBS="-lgpg-error"
412 AC_CHECK_HEADER(gcrypt.h,
413 [AC_CHECK_LIB(gcrypt, gcry_control,,
414 [ac_cv_enable_gnutls=no])
415 ],[ac_cv_enable_gnutls=no])
417 if test "x$ac_cv_enable_gnutls" = "xyes"; then
418 if test x"$platform_win32" = "xyes"; then
419 GNUTLS_LIBS="-lgnutls -lgcrypt ${GCRYPT_LIBS}"
421 GNUTLS_LIBS="-lgnutls -lgcrypt -lz ${GCRYPT_LIBS}"
425 CPPFLAGS="$OCPPFLAGS"
429 if test "x$ac_cv_enable_gnutls" = "xyes"; then
430 AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
434 AC_SUBST(GNUTLS_LIBS)
436 dnl password encryption
441 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
444 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
451 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
452 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
453 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
455 dnl RC dir (will be default at a certain point in time)
456 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
457 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
458 if test x"$ac_cv_with_config_dir" = x""; then
459 ac_cv_with_config_dir=".claws-mail"
461 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
463 dnl ************************
464 dnl ** GTK user interface **
465 dnl ************************
468 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
470 dnl --disable-deprecated switch for GTK2 purification
471 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
472 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
477 dnl enchant is used for spell checking
478 AC_MSG_CHECKING([whether to use enchant])
479 AC_ARG_ENABLE(enchant,
480 [ --disable-enchant disable enchant support],
481 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
482 AC_MSG_RESULT($ac_cv_enable_enchant)
483 if test $ac_cv_enable_enchant = yes; then
484 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
486 AC_DEFINE(USE_ENCHANT, 1, enchant)
487 echo "Building with enchant"
488 ac_cv_enable_enchant=yes
489 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
492 echo "Building without enchant-notification"
493 ac_cv_enable_enchant=no
495 AC_SUBST(ENCHANT_CFLAGS)
496 AC_SUBST(ENCHANT_LIBS)
499 dnl want crash dialog
500 AC_ARG_ENABLE(crash-dialog,
501 [ --enable-crash-dialog Enable crash dialog [default=no]],
502 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
503 if test $ac_cv_enable_crash_dialog = yes; then
504 dnl check if GDB is somewhere
505 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
506 AC_MSG_CHECKING([whether to use crash dialog])
507 if test $ac_cv_enable_crash_dialog = yes; then
508 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
510 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
514 AC_ARG_ENABLE(generic-umpc,
515 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
516 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
517 if test $ac_cv_enable_generic_umpc = yes; then
518 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
519 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
524 [ --enable-maemo build for the Maemo platform [default=no]],
525 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
526 if test $ac_cv_enable_maemo = yes; then
527 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
528 ac_cv_enable_maemo=no)
529 AC_SUBST(MAEMO_CFLAGS)
531 if test $ac_cv_enable_maemo = no; then
533 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
534 ac_cv_enable_maemo=no)
535 AC_SUBST(MAEMO_CFLAGS)
537 if test $ac_cv_enable_maemo = no; then
538 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
540 AC_DEFINE(MAEMO, 1, Build for maemo)
541 AC_DEFINE(CHINOOK, 1, Maemo chinook)
542 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
543 ac_cv_enable_generic_umpc=yes
546 AC_DEFINE(MAEMO, 1, Build for maemo)
547 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
548 ac_cv_enable_generic_umpc=yes
552 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
553 ac_cv_enable_conic=no)
554 AC_SUBST(CONIC_CFLAGS)
556 if test $ac_cv_enable_conic = yes; then
557 AC_DEFINE(CONIC, 1, Have conic lib)
560 dnl Check for X-Face support
561 AC_ARG_ENABLE(compface,
562 [ --disable-compface disable compface (X-Face) support],
563 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
564 AC_MSG_CHECKING([whether to use compface])
565 if test x"$ac_cv_enable_compface" = xyes; then
567 AC_CHECK_LIB(compface, uncompface,
568 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
569 [ac_cv_enable_compface=no])
570 if test x"$ac_cv_enable_compface" = xyes; then
571 COMPFACE_LIBS="-lcompface"
575 AC_SUBST(COMPFACE_LIBS)
580 dnl check for pthread support
581 AC_ARG_ENABLE(pthread,
582 [ --disable-pthread disable pthread support],
583 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
584 AC_MSG_CHECKING([whether to use pthread])
585 if test x$ac_cv_enable_pthread = xno; then
590 # For W32 we need to use a special ptrhead lib. In this case we can't
591 # use AC_CHECK_LIB because it has no means of checking for a
592 # library installed under a different name. Checking for the
594 if test -n "${pthread_name}" ; then
595 ac_cv_enable_pthread=yes
597 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
599 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
601 if test x$ac_cv_enable_pthread = xyes; then
602 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
603 if test -z "${pthread_name}" ; then
604 PTHREAD_LIBS="-lpthread"
609 AC_SUBST(PTHREAD_LIBS)
612 dnl Check whether we need to pass -lresolv
613 dnl We know that we don't need it for W32.
615 if test x$os_win32 = xno; then
618 ac_cv_var__res_options=no
619 AC_TRY_LINK([#include <sys/types.h>
620 #include <sys/socket.h>
621 #include <netinet/in.h>
622 #include <arpa/nameser.h>
623 #include <resolv.h>],
624 [_res.options = RES_INIT;],
625 ac_cv_var__res_options=yes);
626 if test "$ac_cv_var__res_options" != "yes"; then
631 if test "x$LIBRESOLV" = "x"; then
632 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
638 LIBS="$LIBS $LIBRESOLV"
640 dnl for LDAP support in addressbook
641 dnl no check for libraries; dynamically loaded
643 [ --disable-ldap disable LDAP support],
644 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
645 AC_MSG_CHECKING([whether to use LDAP])
646 if test x"$ac_cv_enable_ldap" = xno; then
648 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
649 AC_MSG_RESULT(no - LDAP support needs pthread support)
655 dnl check for available libraries, and pull them in
656 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
657 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
658 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
659 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
662 AC_CHECK_HEADERS(ldap.h lber.h,
663 [ ac_cv_enable_ldap=yes ],
664 [ ac_cv_enable_ldap=no ])
666 if test "$ac_cv_enable_ldap" = yes; then
667 AC_CHECK_LIB(ldap, ldap_open,
668 [ ac_cv_enable_ldap=yes ],
669 [ ac_cv_enable_ldap=no ],
672 AC_CHECK_LIB(ldap, ldap_start_tls_s,
673 [ ac_cv_have_tls=yes ],
674 [ ac_cv_have_tls=no ])
678 AC_MSG_CHECKING([whether ldap library is available])
679 AC_MSG_RESULT($ac_cv_enable_ldap)
681 AC_MSG_CHECKING([whether TLS library is available])
682 AC_MSG_RESULT($ac_cv_have_tls)
684 if test "$ac_cv_enable_ldap" = yes; then
685 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
686 LDAP_LIBS="$LDAP_LIBS -lldap"
688 if test "$ac_cv_have_tls" = yes; then
689 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
691 dnl As of OpenLDAP API version 3000 a number of functions has
692 dnl been deprecated. As Claws-mail compiles and runs on many
693 dnl platforms and many versions of OpenLDAP we need to be able
694 dnl to switch between the old and new API because new API has
695 dnl added new functions replacing old ones and at the same time
696 dnl old functions has been changed.
697 dnl If cross-compiling defaults to enable deprecated features
698 dnl for maximum portability
699 AC_MSG_CHECKING([The API version of OpenLDAP])
703 [if (LDAP_API_VERSION >= 3000)
706 [AC_MSG_RESULT([version < 3000])
707 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
708 [AC_MSG_RESULT([version >= 3000])
709 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
710 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
711 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
712 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
717 dnl for JPilot support in addressbook
718 dnl no check for libraries; these are dynamically loaded
719 AC_ARG_ENABLE(jpilot,
720 [ --disable-jpilot disable JPilot support],
721 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
722 AC_MSG_CHECKING([whether to use JPilot])
723 if test "$ac_cv_enable_jpilot" = yes; then
725 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
726 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
727 [ ac_cv_enable_jpilot=no ])
728 if test "$ac_cv_enable_jpilot" = no; then
729 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
730 [ ac_cv_enable_jpilot=yes
731 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
734 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
735 if test x"$ac_cv_enable_jpilot" = xyes; then
736 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
738 AC_MSG_NOTICE([JPilot support not available])
740 AC_SUBST(JPILOT_LIBS)
745 dnl #######################################################################
746 dnl # Check for startup notification
747 dnl #######################################################################
748 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
750 if test "x$enable_startup_notification" = "xyes"; then
751 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
753 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
754 echo "Building with libstartup-notification"
755 enable_startup_notification=yes
758 echo "Building without libstartup-notification"
759 enable_startup_notification=no
762 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
763 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
766 dnl #######################################################################
767 dnl # Check for D-Bus support
768 dnl #######################################################################
769 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
771 if test "x$enable_dbus" = "xyes"; then
772 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
774 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
778 echo "D-Bus requirements not met. D-Bus support not activated."
781 AC_SUBST(DBUS_CFLAGS)
785 dnl #######################################################################
786 dnl # Check for NetworkManager support
787 dnl #######################################################################
788 if test x"$enable_dbus_glib" = xyes; then
789 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
790 if test x"$enable_networkmanager_support" = xyes; then
791 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
793 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
794 echo "Building with NetworkManager support"
795 enable_networkmanager_support=yes
798 echo "NetworkManager not found."
799 enable_networkmanager_support=no
801 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
804 echo "NetworkManager support deactivated as D-Bus requirements were not met."
805 enable_networkmanager_support=no
808 dnl *************************
809 dnl ** section for plugins **
810 dnl *************************
815 AC_MSG_CHECKING([whether to build Trayicon plugin])
816 AC_ARG_ENABLE(trayicon-plugin,
817 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
818 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
819 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
821 PLUGINS="trayicon $PLUGINS"
825 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
827 dnl --- SpamAssassin ---
828 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
829 AC_ARG_ENABLE(spamassassin-plugin,
830 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
831 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
832 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
835 PLUGINS="spamassassin $PLUGINS"
836 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
840 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
842 dnl --- Bogofilter ---
843 AC_MSG_CHECKING([whether to build Bogofilter plugin])
844 AC_ARG_ENABLE(bogofilter-plugin,
845 [ --disable-bogofilter-plugin do not build bogofilter plugin],
846 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
847 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
849 PLUGINS="bogofilter $PLUGINS"
850 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
854 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
857 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
858 AC_ARG_ENABLE(pgpcore-plugin,
859 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
860 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
861 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
863 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
864 [ac_cv_enable_pgpcore_plugin=no])
865 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
866 PLUGINS="pgpcore $PLUGINS"
868 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
869 [Define if GPGME supports PKA.]))
870 #needed to get GPGME_LIBS and al correctly
871 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
872 [ac_cv_enable_pgpcore_plugin=no])
874 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
879 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
881 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
882 AC_ARG_ENABLE(pgpmime-plugin,
883 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
884 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
885 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
887 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
888 PLUGINS="pgpmime $PLUGINS"
890 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
891 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
896 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
898 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
899 AC_ARG_ENABLE(pgpinline-plugin,
900 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
901 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
902 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
904 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
905 PLUGINS="pgpinline $PLUGINS"
907 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
908 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
913 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
915 AC_MSG_CHECKING([whether to build S/Mime plugin])
916 AC_ARG_ENABLE(smime-plugin,
917 [ --disable-smime-plugin do not build S/Mime plugin],
918 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
919 if test x"$ac_cv_enable_smime_plugin" = xyes; then
921 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
922 PLUGINS="smime $PLUGINS"
924 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
925 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
930 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
932 dnl --- Dillo Viewer ---
933 AC_MSG_CHECKING([whether to build Dillo plugin])
934 AC_ARG_ENABLE(dillo-viewer-plugin,
935 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
936 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
937 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
939 PLUGINS="dillo-viewer $PLUGINS"
943 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
946 AC_ARG_ENABLE(demo-plugin,
947 [ --enable-demo-plugin build demo plugin],
948 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
949 if test x"$ac_cv_enable_demo_plugin" = xyes; then
950 PLUGINS="demo $PLUGINS"
952 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
955 AC_MSG_CHECKING([whether to use libetpan])
956 AC_ARG_ENABLE(libetpan,
957 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
958 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
959 if test x"$ac_cv_enable_libetpan" = xyes; then
962 AC_PATH_PROG(libetpanconfig, [libetpan-config])
963 if test "x$libetpanconfig" != "x"; then
964 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
965 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
966 if test "x$libetpan_result" = "xyes"; then
967 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
968 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
969 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
970 AC_MSG_RESULT([$libetpan_result])
973 if test "x$libetpan_result" = "xyes"; then
974 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
975 LIBETPAN_LIBS="`$libetpanconfig --libs`"
976 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
977 if test "$LIBETPAN_VERSION" -lt "057"; then
978 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
979 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
980 AC_MSG_ERROR([libetpan 0.57 not found])
982 AC_SUBST(LIBETPAN_FLAGS)
983 AC_SUBST(LIBETPAN_LIBS)
984 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
986 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
987 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
988 AC_MSG_ERROR([libetpan 0.57 not found])
993 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
996 dnl Printing support.
997 PKG_CHECK_MODULES(GTK210, gtk+-2.0 >= 2.10, ac_cv_have_gtk210=yes, ac_cv_have_gtk210=no)
999 AC_MSG_CHECKING([whether to use libgnomeprint])
1000 AC_ARG_ENABLE(gnomeprint,
1001 [ --disable-gnomeprint disable libgnomeprint support],
1002 [ac_cv_enable_gnomeprint=$enableval], [ac_cv_enable_gnomeprint=auto])
1004 if test x$ac_cv_have_gtk210 = xyes; then
1005 ac_cv_enable_gnomeprint="no"
1008 if test x$ac_cv_enable_gnomeprint = xyes \
1009 -o \( x$ac_cv_enable_gnomeprint = xauto \
1010 -a x$ac_cv_have_gtk210 = xno \); then
1012 PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
1013 ac_cv_enable_gnomeprint=yes, ac_cv_enable_gnomeprint=no)
1014 if test x"$ac_cv_enable_gnomeprint" = xyes; then
1015 AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
1017 AC_MSG_RESULT(not found)
1018 AC_MSG_WARN([*** libgnomeprintui wasn't found ***])
1019 AC_MSG_WARN([*** using built-in printing support ***])
1022 ac_cv_enable_gnomeprint=no
1025 AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes")
1027 AC_MSG_CHECKING([whether to use valgrind])
1028 AC_ARG_ENABLE(valgrind,
1029 [ --disable-valgrind disable valgrind support for debugging],
1030 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1031 if test x$ac_cv_enable_valgrind = xyes; then
1033 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1034 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1035 if test x"$ac_cv_enable_valgrind" = xyes; then
1036 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1038 AC_MSG_RESULT(not found)
1043 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1045 dnl ****************************
1046 dnl ** Final configure output **
1047 dnl ****************************
1053 src/common/version.h
1056 src/common/passcrypt.h
1059 src/plugins/Makefile
1060 src/plugins/demo/Makefile
1061 src/plugins/bogofilter/Makefile
1062 src/plugins/spamassassin/Makefile
1063 src/plugins/dillo_viewer/Makefile
1064 src/plugins/trayicon/Makefile
1065 src/plugins/trayicon/libeggtrayicon/Makefile
1066 src/plugins/pgpcore/Makefile
1067 src/plugins/pgpmime/Makefile
1068 src/plugins/pgpinline/Makefile
1069 src/plugins/smime/Makefile
1076 manual/dist/Makefile
1077 manual/dist/pdf/Makefile
1078 manual/dist/ps/Makefile
1079 manual/dist/html/Makefile
1080 manual/dist/txt/Makefile
1082 manual/fr/dist/Makefile
1083 manual/fr/dist/pdf/Makefile
1084 manual/fr/dist/ps/Makefile
1085 manual/fr/dist/html/Makefile
1086 manual/fr/dist/txt/Makefile
1088 manual/pl/dist/Makefile
1089 manual/pl/dist/pdf/Makefile
1090 manual/pl/dist/ps/Makefile
1091 manual/pl/dist/html/Makefile
1092 manual/pl/dist/txt/Makefile
1094 manual/es/dist/Makefile
1095 manual/es/dist/pdf/Makefile
1096 manual/es/dist/ps/Makefile
1097 manual/es/dist/html/Makefile
1098 manual/es/dist/txt/Makefile
1102 dnl Output the configuration summary
1104 echo "$PACKAGE $VERSION"
1106 echo "JPilot : $ac_cv_enable_jpilot"
1107 echo "LDAP : $ac_cv_enable_ldap"
1108 echo "gnuTLS : $ac_cv_enable_gnutls"
1109 echo "iconv : $am_cv_func_iconv"
1110 echo "compface : $ac_cv_enable_compface"
1111 echo "IPv6 : $ac_cv_enable_ipv6"
1112 echo "enchant : $ac_cv_enable_enchant"
1113 echo "IMAP4 : $ac_cv_enable_libetpan"
1114 echo "NNTP : $ac_cv_enable_libetpan"
1115 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1116 echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
1117 echo "GTK+ print support: $ac_cv_have_gtk210"
1118 echo "LibSM : $ac_cv_enable_libsm"
1119 echo "DBUS : $enable_dbus"
1120 echo "NetworkManager : $enable_networkmanager_support"
1121 echo "Manual : $ac_cv_enable_manual"
1122 echo "Plugins : $PLUGINS"
1123 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1124 echo "Maemo build : $ac_cv_enable_maemo"
1125 echo "Config dir : $ac_cv_with_config_dir"
1127 echo "The binary will be installed in $prefix/bin"
1129 echo "Configure finished, type 'make' to build."