1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
18 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
19 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
21 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
28 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
29 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
30 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
33 AC_SUBST(MAJOR_VERSION)
34 AC_SUBST(MINOR_VERSION)
35 AC_SUBST(MICRO_VERSION)
36 AC_SUBST(EXTRA_VERSION)
39 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
40 if test "$GNOME_CONFIG" != no; then
41 gnomedatadir="`gnome-config --datadir`"
42 gnomeprefix="`gnome-config --prefix`"
43 if test "${prefix}" = "NONE"; then
44 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
46 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
48 AC_SUBST(gnomedatadir)
50 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
53 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
55 dnl libtool versioning
56 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
57 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
58 LT_REVISION=$INTERFACE_AGE
59 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
65 dnl Specify a header configuration file
66 AC_CONFIG_HEADERS(config.h)
70 dnl Checks for programs.
83 SYLPHEED_ACLOCAL_INCLUDE(m4)
85 dnl ******************************
87 dnl ******************************
90 dnl Copied from the official gtk+-2 configure.in
91 AC_MSG_CHECKING([for some Win32 platform])
93 *-*-mingw*|*-*-cygwin*)
95 LDFLAGS="$LDFLAGS -mwindows"
101 AC_MSG_RESULT([$platform_win32])
102 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
104 if test x"$platform_win32" = x"yes"; then
109 AC_MSG_CHECKING([for native Win32])
118 AC_MSG_RESULT([$os_win32])
119 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
123 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
131 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_CN zh_TW.Big5"
132 AM_GNU_GETTEXT([use-libtool])
133 AM_GNU_GETTEXT_VERSION(0.12.1)
134 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
135 localedir='${prefix}/${DATADIRNAME}/locale'
138 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
140 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
143 dnl Set PACKAGE_DATA_DIR in config.h.
144 if test "x${datadir}" = 'x${prefix}/share'; then
145 if test "x${prefix}" = "xNONE"; then
146 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
148 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
151 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
154 AC_CHECK_LIB(xpg4, setlocale)
156 dnl for GThread support (currently disabled)
157 dnl AC_ARG_ENABLE(threads,
158 dnl [ --enable-threads Enable multithread support [default=no]],
159 dnl [use_threads=$enableval], [use_threads=no])
161 AC_MSG_CHECKING([whether to use threads])
162 if test x"$use_threads" = xyes ; then
164 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
165 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
166 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
167 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
169 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
175 dnl Check for d_type member in struct dirent
176 AC_MSG_CHECKING([whether struct dirent has d_type member])
177 AC_CACHE_VAL(ac_cv_dirent_d_type,[
178 AC_TRY_COMPILE([#include <dirent.h>],
179 [struct dirent d; d.d_type = DT_REG;],
180 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
182 AC_MSG_RESULT($ac_cv_dirent_d_type)
183 if test $ac_cv_dirent_d_type = yes; then
184 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
185 Define if `struct dirent' has `d_type' member.)
188 dnl Checks for header files.
192 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
193 sys/param.h sys/utsname.h sys/select.h \
194 wchar.h wctype.h locale.h)
196 dnl alf - Check for apache installation f*ck up. apache may also install an
197 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
198 AC_TRY_COMPILE([#include <stdlib.h>
199 #include <fnmatch.h>],
200 [int x = USE_HSREGEX;],
201 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
202 if test $ac_cv_have_apache_fnmatch = yes; then
203 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
205 AC_MSG_CHECKING([whether to use Apache regex header kludge])
206 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
208 dnl Checks for typedefs, structures, and compiler characteristics.
215 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
216 dnl may be defined only in wchar.h (this happens with gcc-2.96).
217 dnl So we need to use this extended macro.
218 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
223 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
225 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
226 AC_CHECK_SIZEOF(unsigned short, 2)
227 AC_CHECK_SIZEOF(unsigned int, 4)
228 AC_CHECK_SIZEOF(unsigned long, 4)
230 dnl Checks for library functions.
232 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
233 wcsstr wcswcs iswalnum iswspace towlower \
234 wcslen wcscpy wcsncpy \
235 uname flock lockf inet_aton inet_addr \
238 dnl *****************
239 dnl ** common code **
240 dnl *****************
243 AM_PATH_GLIB_2_0(2.0.0,,
244 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
245 gmodule gobject gthread)
247 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
249 LIBS="$LIBS $GTK_LIBS"
250 AC_CHECK_FUNCS(bind_textdomain_codeset)
253 dnl check for IPv6 option
255 [ --disable-ipv6 Disable IPv6 support],
256 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
258 dnl automated checks for IPv6 support.
259 AC_MSG_CHECKING([whether to use IPv6])
260 if test x"$ac_cv_enable_ipv6" = xyes; then
262 AC_MSG_CHECKING([for IPv6 support])
263 AC_CACHE_VAL(ac_cv_ipv6,[
264 AC_TRY_COMPILE([#define INET6
265 #include <sys/types.h>
266 #include <netinet/in.h>],
267 [int x = IPPROTO_IPV6; struct in6_addr a;],
268 ac_cv_ipv6=yes, ac_cv_ipv6=no)
270 AC_MSG_RESULT($ac_cv_ipv6)
271 if test $ac_cv_ipv6 = yes; then
272 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
274 AC_MSG_WARN(*** IPv6 will not be supported ***)
281 dnl Check for OpenSSL
284 dnl password encryption
287 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
292 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
293 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
294 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
296 dnl RC dir (will be default at a certain point in time)
297 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
298 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
299 if test x"$ac_cv_with_config_dir" = x""; then
300 ac_cv_with_config_dir=".sylpheed"
302 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
304 dnl ************************
305 dnl ** GTK user interface **
306 dnl ************************
309 AM_PATH_GTK_2_0(2.4.0,,
310 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
312 dnl GNU/Aspell is used for spell checking
313 AC_ARG_ENABLE(aspell,
314 [ --enable-aspell Enable GNU/aspell support [default=no]],
315 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
316 AC_MSG_CHECKING([whether to use GNU/aspell])
317 if test $ac_cv_enable_aspell = yes; then
319 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
320 [use_aspell=no ac_cv_enable_aspell=no])
325 dnl want crash dialog
326 AC_ARG_ENABLE(crash-dialog,
327 [ --enable-crash-dialog Enable crash dialog [default=no]],
328 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
329 if test $ac_cv_enable_crash_dialog = yes; then
330 dnl check if GDB is somewhere
331 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
332 AC_MSG_CHECKING([whether to use crash dialog])
333 if test $ac_cv_enable_crash_dialog = yes; then
334 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
336 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
339 dnl Check for X-Face support
340 AC_ARG_ENABLE(compface,
341 [ --disable-compface Do not use compface (X-Face)],
342 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
343 AC_MSG_CHECKING([whether to use compface])
344 if test x"$ac_cv_enable_compface" = xyes; then
346 AC_CHECK_LIB(compface, uncompface,
347 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
348 [ac_cv_enable_compface=no])
349 if test x"$ac_cv_enable_compface" = xyes; then
350 COMPFACE_LIBS="-lcompface"
354 AC_SUBST(COMPFACE_LIBS)
359 dnl for LDAP support in addressbook
360 dnl no check for libraries; dynamically loaded
362 [ --enable-ldap Enable LDAP support [default=no]],
363 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
364 AC_MSG_CHECKING([whether to use LDAP])
365 if test "$ac_cv_enable_ldap" = yes; then
368 dnl check for available libraries, and pull them in
369 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
370 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
371 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
372 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
375 dnl we need libpthread for sylpheed ldap, until we find
376 dnl a better way to handle ldap requests asynchronously...
377 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
379 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
380 [ ac_cv_enable_ldap=yes ],
381 [ ac_cv_enable_ldap=no ])
383 if test "$ac_cv_enable_ldap" = yes; then
384 AC_CHECK_LIB(ldap, ldap_open,
385 [ ac_cv_enable_ldap=yes ],
386 [ ac_cv_enable_ldap=no ],
390 AC_MSG_CHECKING([whether ldap library is available])
391 AC_MSG_RESULT($ac_cv_enable_ldap)
393 if test "$ac_cv_enable_ldap" = yes; then
394 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
395 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
396 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
403 dnl for JPilot support in addressbook
404 dnl no check for libraries; these are dynamically loaded
405 AC_ARG_ENABLE(jpilot,
406 [ --enable-jpilot Enable JPilot support [default=no]],
407 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
408 AC_MSG_CHECKING([whether to use JPilot])
409 if test "$ac_cv_enable_jpilot" = yes; then
411 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
412 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
413 [ ac_cv_enable_jpilot=no ])
414 if test "$ac_cv_enable_jpilot" = no; then
415 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
416 [ ac_cv_enable_jpilot=yes
417 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
420 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
421 if test x"$ac_cv_enable_jpilot" = xyes; then
422 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
424 AC_MSG_NOTICE([JPilot support not available])
426 AC_SUBST(JPILOT_LIBS)
431 dnl GPGME is used to support OpenPGP
433 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
434 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
435 AC_MSG_CHECKING([whether to use GPGME])
436 if test $ac_cv_enable_gpgme = yes; then
438 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
440 ac_cv_enable_gpgme=no])
445 dnl *************************
446 dnl ** section for plugins **
447 dnl *************************
452 AC_ARG_ENABLE(trayicon-plugin,
453 [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
454 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
455 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
456 PLUGINS="trayicon $PLUGINS"
458 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
460 dnl --- SpamAssassin ---
461 AC_ARG_ENABLE(spamassassin-plugin,
462 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
463 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
464 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
466 PLUGINS="spamassassin $PLUGINS"
468 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
470 dnl --- MathML Viewer ---
471 AC_ARG_ENABLE(mathml-viewer-plugin,
472 [ --disable-mathml-viewer-plugin Do not build MathML-Viewer plugin],
473 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
474 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
475 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
477 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
478 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
479 AC_SUBST(GTK_MATH_VIEW_LIBS)
481 PLUGINS="mathml-viewer $PLUGINS"
484 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
486 dnl --- Image Viewer ---
487 AC_ARG_ENABLE(image-viewer-plugin,
488 [ --disable-image-viewer-plugin Do not build image viewer plugin],
489 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
490 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
491 AC_ARG_ENABLE(gdk-pixbuf,
492 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
493 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
495 [ --disable-imlib Do not use imlib],
496 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
498 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
499 PKG_CHECK_MODULES(GDK_PIXBUF, \
501 [ AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer) ],
502 [ ac_cv_enable_gdk_pixbuf=no ])
505 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
506 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
508 ac_cv_enable_image_viewer_plugin=no
511 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
513 dnl --- Dillo Viewer ---
514 AC_ARG_ENABLE(dillo-viewer-plugin,
515 [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
516 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
517 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
518 PLUGINS="dillo-viewer $PLUGINS"
520 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
523 AC_ARG_ENABLE(demo-plugin,
524 [ --enable-demo-plugin Build demo plugin [default=no]],
525 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
526 if test x"$ac_cv_enable_demo_plugin" = xyes; then
527 PLUGINS="demo $PLUGINS"
529 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
532 AC_ARG_ENABLE(clamav-plugin,
533 [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
534 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
535 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
536 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
537 AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
538 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
539 CLAMAV_LIBS="${clamav_lib}"
540 AC_SUBST(CLAMAV_LIBS)
542 PLUGINS="clamav $PLUGINS"
544 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
547 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
549 dnl ****************************
550 dnl ** Final configure output **
551 dnl ****************************
562 src/common/passcrypt.h
565 src/plugins/demo/Makefile
566 src/plugins/spamassassin/Makefile
567 src/plugins/mathml_viewer/Makefile
568 src/plugins/dillo_viewer/Makefile
569 src/plugins/image_viewer/Makefile
570 src/plugins/trayicon/Makefile
571 src/plugins/trayicon/libeggtrayicon/Makefile
572 src/plugins/clamav/Makefile
582 doc/manual/de/Makefile
583 doc/manual/en/Makefile
584 doc/manual/es/Makefile
585 doc/manual/fr/Makefile
586 doc/manual/ja/Makefile
592 dnl Output the configuration summary
594 echo "$PACKAGE $VERSION"
596 echo "GnuPG : $ac_cv_enable_gpgme"
597 echo "JPilot : $ac_cv_enable_jpilot"
598 echo "LDAP : $ac_cv_enable_ldap"
599 echo "OpenSSL : $ac_cv_enable_openssl"
600 echo "iconv : $am_cv_func_iconv"
601 echo "compface : $ac_cv_enable_compface"
602 echo "IPv6 : $ac_cv_enable_ipv6"
603 echo "GNU/aspell : $ac_cv_enable_aspell"
604 echo "Crash dialog : $ac_cv_enable_crash_dialog"
605 echo "Plugins : $PLUGINS"
606 echo "Config dir : $ac_cv_with_config_dir"
608 echo "The binary will be installed in $prefix/bin"
610 echo "Configure finished, type 'make' to build."