ac -> m4
[claws.git] / configure.ac
index a09f944ed480edc40776ae2d92e56da34e8b648f..04c1de5de622c2fb0fd20e869e5927d4200bdfa0 100644 (file)
@@ -8,10 +8,10 @@ PACKAGE=sylpheed
 dnl version number
 MAJOR_VERSION=0
 MINOR_VERSION=9
-MICRO_VERSION=4
+MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=1
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
@@ -60,7 +60,7 @@ AC_SUBST(LT_REVISION)
 AC_SUBST(LT_AGE)
 
 dnl Specify a header configuration file
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
 
 AM_MAINTAINER_MODE
 
@@ -68,7 +68,6 @@ dnl Checks for programs.
 dnl AC_ARG_PROGRAM
 AC_PROG_CC
 AC_ISC_POSIX
-AM_PROG_CC_STDC
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
@@ -76,21 +75,59 @@ AC_PROG_CPP
 dnl AC_PROG_RANLIB
 AM_PROG_LEX
 AC_PROG_YACC
-AM_PROG_LIBTOOL
+AC_PROG_LIBTOOL
+
+SYLPHEED_ACLOCAL_INCLUDE(m4)
+  
+dnl ******************************
+dnl Checks for host
+dnl ******************************
+AC_CANONICAL_HOST
+
+dnl Copied from the official gtk+-2 configure.in
+AC_MSG_CHECKING([for some Win32 platform])
+case "$host" in
+  *-*-mingw*|*-*-cygwin*)
+    platform_win32=yes
+    LDFLAGS="$LDFLAGS -mwindows"
+    ;;
+  *)
+    platform_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
+
+if test x"$platform_win32" = x"yes"; then
+    WINDRES=windres
+    AC_SUBST(WINDRES)
+fi
 
-SYLPHEED_ACLOCAL_INCLUDE(ac)
+AC_MSG_CHECKING([for native Win32])
+case "$host" in
+  *-*-mingw*)
+    os_win32=yes
+    ;;
+  *)
+    os_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$os_win32])
+AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
 
 case "$target" in
 *-darwin*)
        CFLAGS="$CFLAGS -traditional-cpp -fno-common"
        ;;
 esac
-
+  
+dnl Checks for iconv
 AM_ICONV
 
 dnl for gettext
-ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sr sv zh_TW.Big5"
+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"
 AM_GNU_GETTEXT([use-libtool])
+AM_GNU_GETTEXT_VERSION(0.12.1)
 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
 localedir='${prefix}/${DATADIRNAME}/locale'
 AC_SUBST(localedir)
@@ -132,6 +169,19 @@ else
        AC_MSG_RESULT(no)
 fi
 
+dnl Check for d_type member in struct dirent
+AC_MSG_CHECKING([whether struct dirent has d_type member])
+AC_CACHE_VAL(ac_cv_dirent_d_type,[
+       AC_TRY_COMPILE([#include <dirent.h>],
+                      [struct dirent d; d.d_type = DT_REG;],
+                      ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
+])
+AC_MSG_RESULT($ac_cv_dirent_d_type)
+if test $ac_cv_dirent_d_type = yes; then
+       AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
+                 Define if `struct dirent' has `d_type' member.)
+fi
+
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
@@ -187,14 +237,20 @@ dnl ** common code **
 dnl *****************
 
 dnl check for glib
-AM_PATH_GLIB(1.2.6,,
+AM_PATH_GLIB_2_0(2.0.0,,
        AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
-       gthread)
+       gmodule gobject gthread)
+
+dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
+syl_save_LIBS=$LIBS
+LIBS="$LIBS $GTK_LIBS"
+AC_CHECK_FUNCS(bind_textdomain_codeset)
+LIBS=$syl_save_LIBS
 
 dnl check for IPv6 option
 AC_ARG_ENABLE(ipv6,
-       [  --enable-ipv6           Enable IPv6 support [default=no]],
-       [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
+       [  --disable-ipv6           Disable IPv6 support],
+       [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
 
 dnl automated checks for IPv6 support.
 AC_MSG_CHECKING([whether to use IPv6])
@@ -240,7 +296,7 @@ dnl ** GTK user interface **
 dnl ************************
 
 dnl Checks for GTK
-AM_PATH_GTK(1.2.6,,
+AM_PATH_GTK_2_0(2.0.0,,
        AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
 
 dnl check if gdk / gtk was compiled with USE_XIM
@@ -291,8 +347,20 @@ dnl Check for X-Face support
 AC_ARG_ENABLE(compface,
        [  --disable-compface      Do not use compface (X-Face)],
        [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
-if test "$ac_cv_enable_compface" = yes; then
-       AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
+AC_MSG_CHECKING([whether to use compface])
+if test x"$ac_cv_enable_compface" = xyes; then
+       AC_MSG_RESULT(yes)
+       AC_CHECK_LIB(compface, uncompface, 
+               [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
+               [ac_cv_enable_compface=no])
+       if test x"$ac_cv_enable_compface" = xyes; then
+               COMPFACE_LIBS="-lcompface"
+       else
+               COMPFACE_LIBS=""
+       fi
+       AC_SUBST(COMPFACE_LIBS)
+else
+       AC_MSG_RESULT(no)
 fi
 
 dnl for LDAP support in addressbook
@@ -355,12 +423,14 @@ if test "$ac_cv_enable_jpilot" = yes; then
                                 [ ac_cv_enable_jpilot=yes
                                   AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
        fi
-       AC_MSG_CHECKING([whether jpilot is available])
-       AC_MSG_RESULT($ac_cv_enable_jpilot)
 
-       if test "$ac_cv_enable_jpilot" = yes; then
-               LIBS="$LIBS -lpisock"
+       AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
+       if test x"$ac_cv_enable_jpilot" = xyes; then
+               AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
+       else
+               AC_MSG_NOTICE([JPilot support not available])
        fi
+       AC_SUBST(JPILOT_LIBS)
 else
        AC_MSG_RESULT(no)
 fi
@@ -387,7 +457,7 @@ PLUGINS=""
 
 dnl --- Trayicon ---
 AC_ARG_ENABLE(trayicon-plugin,
-       [  --enable-trayicon-plugin   System Tray Icon [default=no]],
+       [  --disable-trayicon-plugin         Do not build System Tray Icon plugin],
        [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
        PLUGINS="trayicon $PLUGINS"
@@ -396,7 +466,7 @@ AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xy
 
 dnl --- SpamAssassin ---
 AC_ARG_ENABLE(spamassassin-plugin,
-       [  --enable-spamassassin-plugin    Build SpamAssassin plugin [default=no]],
+       [  --enable-spamassassin-plugin      Build SpamAssassin plugin [default=no]],
        [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
        AC_SPAMASSASSIN
@@ -406,10 +476,10 @@ AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plug
 
 dnl --- MathML Viewer ---
 AC_ARG_ENABLE(mathml-viewer-plugin,
-       [  --enable-mathml-viewer-plugin    Build MathML-Viewer plugin [default=no]],
+       [  --disable-mathml-viewer-plugin    Do not build MathML-Viewer plugin],
        [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
-       PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2, :, ac_cv_enable_mathml_viewer_plugin=no)
+       PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
 
        if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
                AC_SUBST(GTK_MATH_VIEW_CFLAGS)
@@ -422,31 +492,25 @@ AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_pl
 
 dnl --- Image Viewer ---
 AC_ARG_ENABLE(image-viewer-plugin,
-       [  --disable-image-viewer-plugin   Do not build image viewer plugin],
+       [  --disable-image-viewer-plugin     Do not build image viewer plugin],
        [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
        AC_ARG_ENABLE(gdk-pixbuf,
-               [  --disable-gdk-pixbuf    Do not use gdk-pixbuf],
+               [  --disable-gdk-pixbuf              Do not use gdk-pixbuf],
                [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
        AC_ARG_ENABLE(imlib,
-               [  --disable-imlib         Do not use imlib],
+               [  --disable-imlib                   Do not use imlib],
                [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
 
        if test "$ac_cv_enable_gdk_pixbuf" = yes; then
-               AM_PATH_GDK_PIXBUF(0.8.0,
-                       [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
-                        ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
-       fi
-       if test "$ac_cv_enable_imlib" = yes; then
-               AM_PATH_GDK_IMLIB(1.9,
-                       AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
-                       [ac_cv_enable_imlib=no])
+               PKG_CHECK_MODULES(GDK_PIXBUF, \
+                       [ gdk-pixbuf-2.0 ],
+                       [ AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer) ],
+                       [ ac_cv_enable_gdk_pixbuf=no ])
        fi
 
        if test "$ac_cv_enable_gdk_pixbuf" = yes; then
                PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
-       elif test "$ac_cv_enable_imlib" = yes; then
-               PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
        else
                ac_cv_enable_image_viewer_plugin=no
        fi
@@ -455,7 +519,7 @@ AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plug
 
 dnl --- Dillo Viewer ---
 AC_ARG_ENABLE(dillo-viewer-plugin,
-       [  --enable-dillo-viewer-plugin   Build Dillo plugin for html mail rendering [default=no]],
+       [  --disable-dillo-viewer-plugin     Do not build Dillo plugin for html mail rendering],
        [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
        PLUGINS="dillo-viewer $PLUGINS"
@@ -464,7 +528,7 @@ AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plug
 
 dnl --- Demo ---
 AC_ARG_ENABLE(demo-plugin,
-       [  --enable-demo-plugin    Build demo plugin [default=no]],
+       [  --enable-demo-plugin              Build demo plugin [default=no]],
        [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
 if test x"$ac_cv_enable_demo_plugin" = xyes; then
        PLUGINS="demo $PLUGINS"
@@ -473,7 +537,7 @@ AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
 
 dnl --- ClamAV ---
 AC_ARG_ENABLE(clamav-plugin,
-       [  --enable-clamav-plugin    Build Clam AntiVirus plugin [default=no]],
+       [  --disable-clamav-plugin           Do not build Clam AntiVirus plugin],
        [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
        AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
@@ -484,7 +548,7 @@ if test x"$ac_cv_enable_clamav_plugin" = xyes; then
 
                PLUGINS="clamav $PLUGINS"
        else
-               AC_MSG_NOTICE(clamav library not found, will not build clamav plugin)
+               AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
        fi
 fi
 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
@@ -497,7 +561,7 @@ AC_OUTPUT([
 Makefile
 sylpheed.spec
 intl/Makefile
-ac/Makefile
+m4/Makefile
 po/Makefile.in
 src/common/version.h
 src/Makefile
@@ -513,19 +577,20 @@ src/plugins/image_viewer/Makefile
 src/plugins/trayicon/Makefile
 src/plugins/trayicon/libeggtrayicon/Makefile
 src/plugins/clamav/Makefile
-faq/Makefile
-faq/de/Makefile
-faq/en/Makefile
-faq/es/Makefile
-faq/fr/Makefile
-faq/it/Makefile
-man/Makefile
-manual/Makefile
-manual/de/Makefile
-manual/en/Makefile
-manual/es/Makefile
-manual/fr/Makefile
-manual/ja/Makefile
+doc/Makefile
+doc/faq/Makefile
+doc/faq/de/Makefile
+doc/faq/en/Makefile
+doc/faq/es/Makefile
+doc/faq/fr/Makefile
+doc/faq/it/Makefile
+doc/man/Makefile
+doc/manual/Makefile
+doc/manual/de/Makefile
+doc/manual/en/Makefile
+doc/manual/es/Makefile
+doc/manual/fr/Makefile
+doc/manual/ja/Makefile
 tools/Makefile
 config/Makefile
 sylpheed-claws.pc