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")
20 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
21 if test "$GNOME_CONFIG" != no; then
22 gnomedir="`gnome-config --prefix`"
25 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
27 dnl libtool versioning
28 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
29 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
30 LT_REVISION=$INTERFACE_AGE
31 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
37 dnl Specify a header configuration file
38 AM_CONFIG_HEADER(config.h)
43 dnl Checks for programs.
56 SYLPHEED_ACLOCAL_INCLUDE(ac)
59 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
61 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
62 localedir='${prefix}/${DATADIRNAME}/locale'
65 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
68 dnl Checks for libraries.
70 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
73 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
75 dnl Check for built-in image view support
76 AC_ARG_ENABLE(gdk-pixbuf,
77 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
78 [ac_cv_disable_gdk_pixbuf=disable], [ac_cv_disable_gdk_pixbuf=no])
80 [ --disable-imlib Do not use imlib],
81 [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
83 if test "$ac_cv_disable_gdk_pixbuf" = no; then
84 AM_PATH_GDK_PIXBUF(0.8.0,
85 AC_DEFINE(HAVE_GDK_PIXBUF), [ac_cv_disable_gdk_pixbuf=disable])
87 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = no; then
88 AM_PATH_GDK_IMLIB(1.9,
89 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_disable_imlib=disable])
91 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = disable; then
92 AC_MSG_WARN(*** Built-in image view will not be supported ***)
95 dnl GPGME is used to support OpenPGP
97 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
98 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
99 if test $ac_cv_enable_gpgme = yes; then
100 AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
103 dnl Use OpenSSL for SSL connections
104 AC_MSG_CHECKING([whether to use ssl])
106 [ --enable-ssl Enable SSL support using OpenSSL [default=no]],
107 [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
108 if test $ac_cv_enable_ssl = yes; then
114 if test $ac_cv_enable_ssl = yes; then
115 AC_MSG_CHECKING([whether to openssl is available])
118 #include <openssl/opensslv.h>
119 ], [ return(OPENSSL_VERSION_NUMBER); ],
121 AC_DEFINE(USE_SSL) ],
123 LIBS="$ac_save_LIBS" ])
126 dnl Check for X-Face support
127 AC_ARG_ENABLE(compface,
128 [ --disable-compface Do not use compface (X-Face)],
129 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
130 if test "$ac_cv_disable_compface" = no; then
131 AC_CHECK_LIB(compface, uncompface)
134 dnl for JPilot support in addressbook
135 AC_ARG_ENABLE(jpilot,
136 [ --enable-jpilot Enable JPilot support [default=no]],
137 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
139 AC_MSG_CHECKING([whether to use jpilot])
140 if test "$ac_cv_enable_jpilot" = yes; then
142 LIBS="$LIBS -lpisock"
143 AC_DEFINE(USE_JPILOT)
148 dnl for LDAP support in addressbook
150 [ --enable-ldap Enable LDAP support [default=no]],
151 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
153 AC_MSG_CHECKING([whether to use ldap])
154 if test "$ac_cv_enable_ldap" = yes; then
156 LIBS="$LIBS -lldap -llber -lpthread -lresolv"
162 dnl Check for libjconv
164 [ --disable-jconv Do not use libjconv],
165 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
166 if test "$ac_cv_disable_jconv" = no; then
167 AC_CHECK_LIB(jconv, jconv_alloc_conv)
170 AC_CHECK_LIB(xpg4, setlocale)
171 dnl AC_CHECK_LIB(kcc, KCC_filter)
173 dnl for GThread support
174 dnl AC_ARG_ENABLE(threads,
175 dnl [ --enable-threads Enable multithread support [default=no]],
176 dnl [use_threads=$enableval], [use_threads=no])
178 AC_MSG_CHECKING([whether to use threads])
179 if test x"$use_threads" = xyes ; then
181 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
182 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
183 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
184 AC_DEFINE(USE_THREADS)
186 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
192 dnl check for IPv6 option
194 [ --enable-ipv6 Enable IPv6 support [default=no]],
195 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
197 dnl automated checks for IPv6 support.
198 if test x"$ac_cv_enableipv6" = xyes; then
199 AC_MSG_CHECKING([for IPv6 support])
200 AC_CACHE_VAL(ac_cv_ipv6,[
201 AC_TRY_COMPILE([#define INET6
202 #include <sys/types.h>
203 #include <netinet/in.h>],
204 [int x = IPPROTO_IPV6; struct in6_addr a;],
205 ac_cv_ipv6=yes, ac_cv_ipv6=no)
207 AC_MSG_RESULT($ac_cv_ipv6)
208 if test $ac_cv_ipv6 = yes; then
213 dnl check if gdk / gtk was compiled with USE_XIM
214 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
215 CFLAGS_SAVE="$CFLAGS"
216 LDFLAGS_SAVE="$LDFLAGS"
217 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
218 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
219 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
220 AC_TRY_COMPILE([#include <gtk/gtk.h>
221 #include <gdk/gdk.h>],
222 [extern gint gdk_im_open(void); gdk_im_open();],
223 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
225 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
226 if test $ac_cv_use_gtkgdk_xim = yes; then
227 AC_DEFINE(USE_GTKGDK_XIM)
229 CFLAGS="$CFLAGS_SAVE"
230 LDFLAGS="$LDFLAGS_SAVE"
233 dnl Checks for header files.
237 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
238 sys/param.h sys/utsname.h \
241 dnl Checks for typedefs, structures, and compiler characteristics.
248 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
249 dnl may be defined only in wchar.h (this happens with gcc-2.96).
250 dnl So we need to use this extended macro.
251 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
258 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
259 AC_CHECK_SIZEOF(unsigned short, 2)
260 AC_CHECK_SIZEOF(unsigned int, 4)
261 AC_CHECK_SIZEOF(unsigned long, 4)
263 dnl Checks for library functions.
265 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
266 wcsstr wcswcs iswalnum iswspace towlower \
267 wcslen wcscpy wcsncpy \
268 uname flock lockf inet_aton inet_addr \