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"
147 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
148 _gcc_cflags_save=$CFLAGS
149 CFLAGS="-Wno-pointer-sign"
150 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
151 AC_MSG_RESULT($_gcc_psign)
152 CFLAGS=$_gcc_cflags_save;
153 if test x"$_gcc_psign" = xyes ; then
154 CFLAGS="$CFLAGS -Wno-pointer-sign"
157 CFLAGS="$CFLAGS -Wall"
159 #if test $USE_MAINTAINER_MODE = yes; then
160 # 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"
166 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
169 # Note that we need to link to pthreadGC2 in all cases. This
170 # is because some locking is used even when pthread support is
172 pthread_name=pthreadGC2
173 CFLAGS="$CFLAGS -mms-bitfields"
174 LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
177 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
178 CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
186 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
189 LIBS="$LIBS $GTK_LIBS"
190 AC_CHECK_FUNCS(bind_textdomain_codeset)
194 ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id it ja lt nl pl pt_BR pt_PT ru sk sv uk zh_CN"
195 GETTEXT_PACKAGE=claws-mail
196 AC_SUBST(GETTEXT_PACKAGE)
197 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
199 AM_GNU_GETTEXT_VERSION([0.15])
200 AM_GNU_GETTEXT([external])
202 manualdir='${docdir}/manual'
203 AC_ARG_WITH(manualdir,
204 [ --with-manualdir=DIR Manual directory],
205 [manualdir="$withval"])
208 AC_ARG_ENABLE(manual,
209 [ --disable-manual do not build manual],
210 [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
212 dnl ******************************
213 dnl ** Check for required tools **
214 dnl ** to build manuals **
215 dnl ******************************
217 AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
218 AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
219 AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
220 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
222 AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
223 AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
224 AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
225 AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
227 if test x"$ac_cv_enable_manual" = x"yes"; then
228 if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
229 -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
230 ac_cv_enable_manual=yes
232 ac_cv_enable_manual=no
236 AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
238 dnl Set PACKAGE_DATA_DIR in config.h.
239 if test "x${datarootdir}" = 'x${prefix}/share'; then
240 if test "x${prefix}" = "xNONE"; then
241 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
243 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
246 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
249 AC_CHECK_LIB(xpg4, setlocale)
254 [ --disable-libsm disable libSM support for session management.],
255 [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
256 AC_MSG_CHECKING([whether to use LibSM])
257 if test x"$ac_cv_enable_libsm" = xyes; then
259 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
260 [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
262 AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
263 if test x"$ac_cv_enable_libsm" = xyes; then
264 AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
266 AC_MSG_RESULT(not found)
267 AC_MSG_WARN([*** LibSM will not be supported ***])
274 dnl for GThread support (currently disabled)
275 dnl AC_ARG_ENABLE(threads,
276 dnl [ --enable-threads Enable multithread support [default=no]],
277 dnl [use_threads=$enableval], [use_threads=no])
279 AC_MSG_CHECKING([whether to use threads])
280 if test x"$use_threads" = xyes ; then
282 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
283 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
284 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
285 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
287 AC_MSG_ERROR([Claws Mail requires GThread from GLib to use threading.])
293 dnl Check for d_type member in struct dirent
294 AC_MSG_CHECKING([whether struct dirent has d_type member])
295 AC_CACHE_VAL(ac_cv_dirent_d_type,[
296 AC_TRY_COMPILE([#include <dirent.h>],
297 [struct dirent d; d.d_type = DT_REG;],
298 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
300 AC_MSG_RESULT($ac_cv_dirent_d_type)
301 if test $ac_cv_dirent_d_type = yes; then
302 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
303 Define if `struct dirent' has `d_type' member.)
306 # Check whether mkdir does not take the permission argument.
307 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
309 dnl Checks for header files.
313 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
314 sys/param.h sys/utsname.h sys/select.h \
315 wchar.h wctype.h locale.h netdb.h)
316 AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
317 AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
319 dnl alf - Check for apache installation f*ck up. apache may also install an
320 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
321 AC_TRY_COMPILE([#include <stdlib.h>
322 #include <fnmatch.h>],
323 [int x = USE_HSREGEX;],
324 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
325 if test $ac_cv_have_apache_fnmatch = yes; then
326 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
328 AC_MSG_CHECKING([whether to use Apache regex header kludge])
329 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
331 dnl Checks for typedefs, structures, and compiler characteristics.
338 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
339 dnl may be defined only in wchar.h (this happens with gcc-2.96).
340 dnl So we need to use this extended macro.
341 CLAWS_CHECK_TYPE(wint_t, unsigned int,
346 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
348 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
349 AC_CHECK_SIZEOF(unsigned short, 2)
350 AC_CHECK_SIZEOF(unsigned int, 4)
351 AC_CHECK_SIZEOF(unsigned long, 4)
353 dnl Checks for library functions.
355 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
356 uname flock lockf inet_aton inet_addr \
357 fchmod mkstemp truncate getuid regcomp)
359 AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
361 dnl *****************
362 dnl ** common code **
363 dnl *****************
366 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
368 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
369 AC_SUBST(GLIB_GENMARSHAL)
371 AC_SUBST(GLIB_CFLAGS)
374 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
376 LIBS="$LIBS $GTK_LIBS"
377 AC_CHECK_FUNCS(bind_textdomain_codeset)
380 dnl check for IPv6 option
382 [ --disable-ipv6 disable build IPv6 support],
383 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
385 dnl automated checks for IPv6 support.
386 AC_MSG_CHECKING([whether to use IPv6])
387 if test x"$ac_cv_enable_ipv6" = xyes; then
389 AC_MSG_CHECKING([for IPv6 support])
390 AC_CACHE_VAL(ac_cv_ipv6,[
391 AC_TRY_COMPILE([#define INET6
392 #include <sys/types.h>
393 #include <netinet/in.h>],
394 [int x = IPPROTO_IPV6; struct in6_addr a;],
395 ac_cv_ipv6=yes, ac_cv_ipv6=no)
397 AC_MSG_RESULT($ac_cv_ipv6)
398 if test $ac_cv_ipv6 = yes; then
399 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
401 AC_MSG_WARN(*** IPv6 will not be supported ***)
409 AC_MSG_CHECKING([whether to use GnuTLS])
410 AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
411 [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
413 AC_MSG_RESULT($ac_cv_enable_gnutls)
414 if test "x$ac_cv_enable_gnutls" != "xno"; then
415 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
417 AC_DEFINE(USE_GNUTLS, 1, gnutls)
418 echo "Building with GnuTLS"
421 echo "Building without gnutls"
423 PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
425 dnl No linking against libgcrypt needed
428 dnl linking against libgcrypt *is* needed
429 GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
431 AC_SUBST(GNUTLS_LIBS)
432 AC_SUBST(GNUTLS_CFLAGS)
435 dnl password encryption
440 AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
443 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
450 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
451 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
452 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
454 dnl RC dir (will be default at a certain point in time)
455 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
456 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
457 if test x"$ac_cv_with_config_dir" = x""; then
458 ac_cv_with_config_dir=".claws-mail"
460 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
462 dnl ************************
463 dnl ** GTK user interface **
464 dnl ************************
468 AS_HELP_STRING([--enable-gtk3],
469 [Determines whether to use Gtk+ 3.0.]),
470 [ac_cv_enable_gtk3=$enableval],[ac_cv_enable_gtk3=no])
471 AM_CONDITIONAL(GTK3, false)
472 AM_CONDITIONAL(GTK2, true)
473 if test x"$ac_cv_enable_gtk3" = x"yes"; then
474 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 cairo)
475 AM_CONDITIONAL(GTK3, true)
476 AM_CONDITIONAL(GTK2, false)
478 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
480 dnl --disable-deprecated switch for GTK2 purification
481 AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
482 [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
487 dnl enchant is used for spell checking
488 AC_MSG_CHECKING([whether to use enchant])
489 AC_ARG_ENABLE(enchant,
490 [ --disable-enchant disable enchant support],
491 [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
492 AC_MSG_RESULT($ac_cv_enable_enchant)
493 if test $ac_cv_enable_enchant = yes; then
494 PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
496 AC_DEFINE(USE_ENCHANT, 1, enchant)
497 echo "Building with enchant"
498 ac_cv_enable_enchant=yes
499 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
502 echo "Building without enchant-notification"
503 ac_cv_enable_enchant=no
505 AC_SUBST(ENCHANT_CFLAGS)
506 AC_SUBST(ENCHANT_LIBS)
509 dnl want crash dialog
510 AC_ARG_ENABLE(crash-dialog,
511 [ --enable-crash-dialog Enable crash dialog [default=no]],
512 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
513 if test $ac_cv_enable_crash_dialog = yes; then
514 dnl check if GDB is somewhere
515 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
516 AC_MSG_CHECKING([whether to use crash dialog])
517 if test $ac_cv_enable_crash_dialog = yes; then
518 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
520 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
524 AC_ARG_ENABLE(generic-umpc,
525 [ --enable-generic-umpc Enable generic UMPC code [default=no]],
526 [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
527 if test $ac_cv_enable_generic_umpc = yes; then
528 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
529 AC_MSG_RESULT($ac_cv_enable_generic_umpc)
534 [ --enable-maemo build for the Maemo platform [default=no]],
535 [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
536 if test $ac_cv_enable_maemo = yes; then
537 PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
538 ac_cv_enable_maemo=no)
539 AC_SUBST(MAEMO_CFLAGS)
541 if test $ac_cv_enable_maemo = no; then
543 PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
544 ac_cv_enable_maemo=no)
545 AC_SUBST(MAEMO_CFLAGS)
547 if test $ac_cv_enable_maemo = no; then
548 AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
550 AC_DEFINE(MAEMO, 1, Build for maemo)
551 AC_DEFINE(CHINOOK, 1, Maemo chinook)
552 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
553 ac_cv_enable_generic_umpc=yes
556 AC_DEFINE(MAEMO, 1, Build for maemo)
557 AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
558 ac_cv_enable_generic_umpc=yes
562 PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
563 ac_cv_enable_conic=no)
564 AC_SUBST(CONIC_CFLAGS)
566 if test $ac_cv_enable_conic = yes; then
567 AC_DEFINE(CONIC, 1, Have conic lib)
570 dnl Check for X-Face support
571 AC_ARG_ENABLE(compface,
572 [ --disable-compface disable compface (X-Face) support],
573 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
574 AC_MSG_CHECKING([whether to use compface])
575 if test x"$ac_cv_enable_compface" = xyes; then
577 AC_CHECK_LIB(compface, uncompface,
578 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
579 [ac_cv_enable_compface=no])
580 if test x"$ac_cv_enable_compface" = xyes; then
581 COMPFACE_LIBS="-lcompface"
585 AC_SUBST(COMPFACE_LIBS)
590 dnl check for pthread support
591 AC_ARG_ENABLE(pthread,
592 [ --disable-pthread disable pthread support],
593 [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
594 AC_MSG_CHECKING([whether to use pthread])
595 if test x$ac_cv_enable_pthread = xno; then
600 # For W32 we need to use a special ptrhead lib. In this case we can't
601 # use AC_CHECK_LIB because it has no means of checking for a
602 # library installed under a different name. Checking for the
604 if test -n "${pthread_name}" ; then
605 ac_cv_enable_pthread=yes
607 AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
609 AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
611 if test x$ac_cv_enable_pthread = xyes; then
612 AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
613 if test -z "${pthread_name}" ; then
614 PTHREAD_LIBS="-lpthread"
619 AC_SUBST(PTHREAD_LIBS)
622 dnl Check whether we need to pass -lresolv
623 dnl We know that we don't need it for W32.
625 if test x$os_win32 = xno; then
628 ac_cv_var__res_options=no
629 AC_TRY_LINK([#include <sys/types.h>
630 #include <sys/socket.h>
631 #include <netinet/in.h>
632 #include <arpa/nameser.h>
633 #include <resolv.h>],
634 [_res.options = RES_INIT;],
635 ac_cv_var__res_options=yes);
636 if test "$ac_cv_var__res_options" != "yes"; then
641 if test "x$LIBRESOLV" = "x"; then
642 AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
648 LIBS="$LIBS $LIBRESOLV"
650 dnl for LDAP support in addressbook
651 dnl no check for libraries; dynamically loaded
653 [ --disable-ldap disable LDAP support],
654 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
655 AC_MSG_CHECKING([whether to use LDAP])
656 if test x"$ac_cv_enable_ldap" = xno; then
658 elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
659 AC_MSG_RESULT(no - LDAP support needs pthread support)
662 elif test x"$platform_win32" = xyes; then
664 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
665 LDAP_LIBS="-lwldap32"
670 dnl check for available libraries, and pull them in
671 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
672 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
673 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
674 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
677 AC_CHECK_HEADERS(ldap.h lber.h,
678 [ ac_cv_enable_ldap=yes ],
679 [ ac_cv_enable_ldap=no ])
681 if test "$ac_cv_enable_ldap" = yes; then
682 AC_CHECK_LIB(ldap, ldap_open,
683 [ ac_cv_enable_ldap=yes ],
684 [ ac_cv_enable_ldap=no ],
687 AC_CHECK_LIB(ldap, ldap_start_tls_s,
688 [ ac_cv_have_tls=yes ],
689 [ ac_cv_have_tls=no ])
693 AC_MSG_CHECKING([whether ldap library is available])
694 AC_MSG_RESULT($ac_cv_enable_ldap)
696 AC_MSG_CHECKING([whether TLS library is available])
697 AC_MSG_RESULT($ac_cv_have_tls)
699 if test "$ac_cv_enable_ldap" = yes; then
700 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
701 LDAP_LIBS="$LDAP_LIBS -lldap"
703 if test "$ac_cv_have_tls" = yes; then
704 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
706 dnl As of OpenLDAP API version 3000 a number of functions has
707 dnl been deprecated. As Claws-mail compiles and runs on many
708 dnl platforms and many versions of OpenLDAP we need to be able
709 dnl to switch between the old and new API because new API has
710 dnl added new functions replacing old ones and at the same time
711 dnl old functions has been changed.
712 dnl If cross-compiling defaults to enable deprecated features
713 dnl for maximum portability
714 AC_MSG_CHECKING([The API version of OpenLDAP])
718 [if (LDAP_API_VERSION >= 3000)
721 [AC_MSG_RESULT([version < 3000])
722 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
723 [AC_MSG_RESULT([version >= 3000])
724 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
725 [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
726 AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
727 AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
732 dnl for JPilot support in addressbook
733 dnl no check for libraries; these are dynamically loaded
734 AC_ARG_ENABLE(jpilot,
735 [ --disable-jpilot disable JPilot support],
736 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
737 AC_MSG_CHECKING([whether to use JPilot])
738 if test "$ac_cv_enable_jpilot" = yes; then
740 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
741 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
742 [ ac_cv_enable_jpilot=no ])
743 if test "$ac_cv_enable_jpilot" = no; then
744 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
745 [ ac_cv_enable_jpilot=yes
746 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
749 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
750 if test x"$ac_cv_enable_jpilot" = xyes; then
751 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
753 AC_MSG_NOTICE([JPilot support not available])
755 AC_SUBST(JPILOT_LIBS)
760 dnl #######################################################################
761 dnl # Check for startup notification
762 dnl #######################################################################
763 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
765 if test "x$enable_startup_notification" = "xyes"; then
766 PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
768 AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
769 echo "Building with libstartup-notification"
770 enable_startup_notification=yes
773 echo "Building without libstartup-notification"
774 enable_startup_notification=no
777 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
778 AC_SUBST(STARTUP_NOTIFICATION_LIBS)
781 dnl #######################################################################
782 dnl # Check for D-Bus support
783 dnl #######################################################################
784 AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
786 if test "x$enable_dbus" = "xyes"; then
787 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
789 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
793 echo "D-Bus requirements not met. D-Bus support not activated."
796 AC_SUBST(DBUS_CFLAGS)
800 dnl #######################################################################
801 dnl # Check for NetworkManager support
802 dnl #######################################################################
803 if test x"$enable_dbus_glib" = xyes; then
804 AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
805 if test x"$enable_networkmanager_support" = xyes; then
806 PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
808 AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
809 echo "Building with NetworkManager support"
810 enable_networkmanager_support=yes
813 echo "NetworkManager not found."
814 enable_networkmanager_support=no
816 AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
819 echo "NetworkManager support deactivated as D-Bus requirements were not met."
820 enable_networkmanager_support=no
823 dnl *************************
824 dnl ** section for plugins **
825 dnl *************************
830 AC_MSG_CHECKING([whether to build Trayicon plugin])
831 AC_ARG_ENABLE(trayicon-plugin,
832 [ --disable-trayicon-plugin do not build System Tray Icon plugin],
833 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
834 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
836 PLUGINS="trayicon $PLUGINS"
840 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
842 dnl --- SpamAssassin ---
843 AC_MSG_CHECKING([whether to build SpamAssassin plugin])
844 AC_ARG_ENABLE(spamassassin-plugin,
845 [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
846 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
847 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
850 PLUGINS="spamassassin $PLUGINS"
851 AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
855 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
857 dnl --- Bogofilter ---
858 AC_MSG_CHECKING([whether to build Bogofilter plugin])
859 AC_ARG_ENABLE(bogofilter-plugin,
860 [ --disable-bogofilter-plugin do not build bogofilter plugin],
861 [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
862 if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
864 PLUGINS="bogofilter $PLUGINS"
865 AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
869 AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
872 AC_MSG_CHECKING([whether to build PGP/CORE plugin])
873 AC_ARG_ENABLE(pgpcore-plugin,
874 [ --disable-pgpcore-plugin do not build PGP/Core plugin],
875 [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
876 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
878 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
879 [ac_cv_enable_pgpcore_plugin=no])
880 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
881 PLUGINS="pgpcore $PLUGINS"
883 AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
884 [Define if GPGME supports PKA.]))
885 #needed to get GPGME_LIBS and al correctly
886 AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
887 [ac_cv_enable_pgpcore_plugin=no])
889 AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
894 AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
896 AC_MSG_CHECKING([whether to build PGP/MIME plugin])
897 AC_ARG_ENABLE(pgpmime-plugin,
898 [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
899 [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
900 if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
902 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
903 PLUGINS="pgpmime $PLUGINS"
905 AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
906 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
911 AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
913 AC_MSG_CHECKING([whether to build PGP/Inline plugin])
914 AC_ARG_ENABLE(pgpinline-plugin,
915 [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
916 [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
917 if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
919 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
920 PLUGINS="pgpinline $PLUGINS"
922 AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
923 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
928 AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
930 AC_MSG_CHECKING([whether to build S/Mime plugin])
931 AC_ARG_ENABLE(smime-plugin,
932 [ --disable-smime-plugin do not build S/Mime plugin],
933 [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
934 if test x"$ac_cv_enable_smime_plugin" = xyes; then
936 if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
937 PLUGINS="smime $PLUGINS"
939 AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
940 AC_MSG_WARN([*** without the PGP/CORE plugin ***])
945 AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
947 dnl --- Dillo Viewer ---
948 AC_MSG_CHECKING([whether to build Dillo plugin])
949 AC_ARG_ENABLE(dillo-viewer-plugin,
950 [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
951 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
952 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
954 PLUGINS="dillo-viewer $PLUGINS"
958 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
961 AC_ARG_ENABLE(demo-plugin,
962 [ --enable-demo-plugin build demo plugin],
963 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
964 if test x"$ac_cv_enable_demo_plugin" = xyes; then
965 PLUGINS="demo $PLUGINS"
967 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
970 AC_MSG_CHECKING([whether to use libetpan])
971 AC_ARG_ENABLE(libetpan,
972 [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
973 [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
974 if test x"$ac_cv_enable_libetpan" = xyes; then
977 AC_PATH_PROG(libetpanconfig, [libetpan-config])
978 if test "x$libetpanconfig" != "x"; then
979 CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
980 AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
981 if test "x$libetpan_result" = "xyes"; then
982 AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
983 LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
984 AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
985 AC_MSG_RESULT([$libetpan_result])
988 if test "x$libetpan_result" = "xyes"; then
989 LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
990 LIBETPAN_LIBS="`$libetpanconfig --libs`"
991 LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
992 LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
993 if test x"$LIBETPAN_STABLE" != "x"; then
994 LIBETPAN_VERSION="100"
996 if test "$LIBETPAN_VERSION" -lt "057"; then
997 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
998 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
999 AC_MSG_ERROR([libetpan 0.57 not found])
1001 AC_SUBST(LIBETPAN_FLAGS)
1002 AC_SUBST(LIBETPAN_LIBS)
1003 AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
1005 AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
1006 AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
1007 AC_MSG_ERROR([libetpan 0.57 not found])
1012 AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
1014 AC_MSG_CHECKING([whether to use valgrind])
1015 AC_ARG_ENABLE(valgrind,
1016 [ --disable-valgrind disable valgrind support for debugging],
1017 [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
1018 if test x$ac_cv_enable_valgrind = xyes; then
1020 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1021 ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
1022 if test x"$ac_cv_enable_valgrind" = xyes; then
1023 AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
1025 AC_MSG_RESULT(not found)
1030 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
1032 dnl ****************************
1033 dnl ** Final configure output **
1034 dnl ****************************
1040 src/common/version.h
1043 src/common/passcrypt.h
1046 src/plugins/Makefile
1047 src/plugins/demo/Makefile
1048 src/plugins/bogofilter/Makefile
1049 src/plugins/spamassassin/Makefile
1050 src/plugins/dillo_viewer/Makefile
1051 src/plugins/trayicon/Makefile
1052 src/plugins/pgpcore/Makefile
1053 src/plugins/pgpmime/Makefile
1054 src/plugins/pgpinline/Makefile
1055 src/plugins/smime/Makefile
1062 manual/dist/Makefile
1063 manual/dist/pdf/Makefile
1064 manual/dist/ps/Makefile
1065 manual/dist/html/Makefile
1066 manual/dist/txt/Makefile
1068 manual/fr/dist/Makefile
1069 manual/fr/dist/pdf/Makefile
1070 manual/fr/dist/ps/Makefile
1071 manual/fr/dist/html/Makefile
1072 manual/fr/dist/txt/Makefile
1074 manual/pl/dist/Makefile
1075 manual/pl/dist/pdf/Makefile
1076 manual/pl/dist/ps/Makefile
1077 manual/pl/dist/html/Makefile
1078 manual/pl/dist/txt/Makefile
1080 manual/es/dist/Makefile
1081 manual/es/dist/pdf/Makefile
1082 manual/es/dist/ps/Makefile
1083 manual/es/dist/html/Makefile
1084 manual/es/dist/txt/Makefile
1086 manual/de/dist/Makefile
1087 manual/de/dist/pdf/Makefile
1088 manual/de/dist/ps/Makefile
1089 manual/de/dist/html/Makefile
1090 manual/de/dist/txt/Makefile
1094 dnl Output the configuration summary
1096 echo "$PACKAGE $VERSION"
1098 echo "JPilot : $ac_cv_enable_jpilot"
1099 echo "LDAP : $ac_cv_enable_ldap"
1100 echo "gnuTLS : $ac_cv_enable_gnutls"
1101 echo "iconv : $am_cv_func_iconv"
1102 echo "compface : $ac_cv_enable_compface"
1103 echo "IPv6 : $ac_cv_enable_ipv6"
1104 echo "enchant : $ac_cv_enable_enchant"
1105 echo "IMAP4 : $ac_cv_enable_libetpan"
1106 echo "NNTP : $ac_cv_enable_libetpan"
1107 echo "Crash dialog : $ac_cv_enable_crash_dialog"
1108 echo "LibSM : $ac_cv_enable_libsm"
1109 echo "DBUS : $enable_dbus"
1110 echo "NetworkManager : $enable_networkmanager_support"
1111 echo "Manual : $ac_cv_enable_manual"
1112 echo "Plugins : $PLUGINS"
1113 echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
1114 echo "Maemo build : $ac_cv_enable_maemo"
1115 echo "Config dir : $ac_cv_with_config_dir"
1117 echo "The binary will be installed in $prefix/bin"
1119 echo "Configure finished, type 'make' to build."