1 dnl Process this file with autoconf to produce a configure script.
12 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
15 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
16 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
17 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
19 dnl libtool versioning
20 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
21 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
22 LT_REVISION=$INTERFACE_AGE
23 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
29 dnl Specify a header configuration file
30 AM_CONFIG_HEADER(config.h)
35 dnl Checks for programs.
46 SYLPHEED_ACLOCAL_INCLUDE(ac)
49 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
51 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
52 localedir='${prefix}/${DATADIRNAME}/locale'
55 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
58 dnl Checks for libraries.
60 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
63 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
65 dnl Check for built-in image view support
66 AC_ARG_ENABLE(gdk-pixbuf,
67 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
68 [ac_cv_disable_gdk_pixbuf=disable], [ac_cv_disable_gdk_pixbuf=no])
70 [ --disable-imlib Do not use imlib],
71 [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
73 if test "$ac_cv_disable_gdk_pixbuf" = no; then
74 AM_PATH_GDK_PIXBUF(0.8.0,
75 AC_DEFINE(HAVE_GDK_PIXBUF), [ac_cv_disable_gdk_pixbuf=disable])
77 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = no; then
78 AM_PATH_GDK_IMLIB(1.9,
79 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_disable_imlib=disable])
81 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = disable; then
82 AC_MSG_WARN(*** Built-in image view will not be supported ***)
85 dnl GPGME is used to support OpenPGP
87 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
88 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
89 if test $ac_cv_enable_gpgme = yes; then
90 AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
93 dnl Check for X-Face support
94 AC_ARG_ENABLE(compface,
95 [ --disable-compface Do not use compface (X-Face)],
96 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
97 if test "$ac_cv_disable_compface" = no; then
98 AC_CHECK_LIB(compface, uncompface)
101 dnl Check for libjconv
103 [ --disable-jconv Do not use libjconv],
104 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
105 if test "$ac_cv_disable_jconv" = no; then
106 AC_CHECK_LIB(jconv, jconv_alloc_conv)
109 AC_CHECK_LIB(xpg4, setlocale)
110 dnl AC_CHECK_LIB(kcc, KCC_filter)
112 dnl for GThread support
113 AC_ARG_ENABLE(threads,
114 [ --enable-threads Enable multithread support [default=no]],
115 [use_threads=$enableval], [use_threads=no])
117 AC_MSG_CHECKING([whether to use threads])
118 if test x"$use_threads" = xyes ; then
120 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
121 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
122 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
123 AC_DEFINE(USE_THREADS)
125 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
131 dnl check for IPv6 option
133 [ --enable-ipv6 Enable IPv6 support [default=no]],
134 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
136 dnl automated checks for IPv6 support.
137 if test x"$ac_cv_enableipv6" = xyes; then
138 AC_MSG_CHECKING([for IPv6 support])
139 AC_CACHE_VAL(ac_cv_ipv6,[
140 AC_TRY_COMPILE([#define INET6
141 #include <sys/types.h>
142 #include <netinet/in.h>],
143 [int x = IPPROTO_IPV6; struct in6_addr a;],
144 ac_cv_ipv6=yes, ac_cv_ipv6=no)
146 AC_MSG_RESULT($ac_cv_ipv6)
147 if test $ac_cv_ipv6 = yes; then
152 dnl check if gdk / gtk was compiled with USE_XIM
153 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
154 CFLAGS_SAVE="$CFLAGS"
155 LDFLAGS_SAVE="$LDFLAGS"
156 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
157 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
158 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
159 AC_TRY_COMPILE([#include <gtk/gtk.h>
160 #include <gdk/gdk.h>],
161 [extern gint gdk_im_open(void); gdk_im_open();],
162 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
164 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
165 if test $ac_cv_use_gtkgdk_xim = yes; then
166 AC_DEFINE(USE_GTKGDK_XIM)
168 CFLAGS="$CFLAGS_SAVE"
169 LDFLAGS="$LDFLAGS_SAVE"
172 dnl Checks for header files.
176 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
177 sys/param.h sys/utsname.h \
181 dnl Checks for typedefs, structures, and compiler characteristics.
188 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
189 dnl may be defined only in wchar.h (this happens with gcc-2.96).
190 dnl So we need to use this extended macro.
191 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
198 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
199 AC_CHECK_SIZEOF(unsigned short, 2)
200 AC_CHECK_SIZEOF(unsigned int, 4)
201 AC_CHECK_SIZEOF(unsigned long, 4)
203 dnl Checks for library functions.
205 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
206 wcsstr wcswcs iswalnum iswspace towlower \
207 wcslen wcscpy wcsncpy \
208 uname flock lockf inet_aton inet_addr \