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")
30 dnl libtool versioning
31 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
32 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
33 LT_REVISION=$INTERFACE_AGE
34 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
40 dnl Specify a header configuration file
41 AM_CONFIG_HEADER(config.h)
46 dnl Checks for programs.
59 SYLPHEED_ACLOCAL_INCLUDE(ac)
62 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
64 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
65 localedir='${prefix}/${DATADIRNAME}/locale'
68 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
71 dnl Checks for libraries.
73 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
76 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
78 dnl Check for built-in image view support
79 AC_ARG_ENABLE(gdk-pixbuf,
80 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
81 [ac_cv_disable_gdk_pixbuf=disable], [ac_cv_disable_gdk_pixbuf=no])
83 [ --disable-imlib Do not use imlib],
84 [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
86 if test "$ac_cv_disable_gdk_pixbuf" = no; then
87 AM_PATH_GDK_PIXBUF(0.8.0,
88 AC_DEFINE(HAVE_GDK_PIXBUF), [ac_cv_disable_gdk_pixbuf=disable])
90 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = no; then
91 AM_PATH_GDK_IMLIB(1.9,
92 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_disable_imlib=disable])
94 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = disable; then
95 AC_MSG_WARN(*** Built-in image view will not be supported ***)
98 dnl GPGME is used to support OpenPGP
100 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
101 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
102 if test $ac_cv_enable_gpgme = yes; then
103 AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
106 dnl Use OpenSSL for SSL connections
107 AC_MSG_CHECKING([whether to use ssl])
109 [ --enable-ssl Enable SSL support using OpenSSL [default=no]],
110 [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
111 if test $ac_cv_enable_ssl = yes; then
117 if test $ac_cv_enable_ssl = yes; then
118 AC_MSG_CHECKING([whether to openssl is available])
121 #include <openssl/opensslv.h>
122 ], [ return(OPENSSL_VERSION_NUMBER); ],
124 AC_DEFINE(USE_SSL) ],
126 LIBS="$ac_save_LIBS" ])
129 dnl Check for X-Face support
130 AC_ARG_ENABLE(compface,
131 [ --disable-compface Do not use compface (X-Face)],
132 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
133 if test "$ac_cv_disable_compface" = no; then
134 AC_CHECK_LIB(compface, uncompface)
137 dnl for JPilot support in addressbook
138 dnl no check for libraries: these are dynamically loaded
139 AC_ARG_ENABLE(jpilot,
140 [ --enable-jpilot Enable JPilot support [default=no]],
141 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
143 AC_MSG_CHECKING([whether to use jpilot])
144 if test "$ac_cv_enable_jpilot" = yes; then
146 if test "$ac_cv_enable_jpilot" = yes; then
147 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, , [ac_cv_enable_jpilot=no])
148 if test "$ac_cv_enable_jpilot" = yes; then
149 LIBS="$LIBS -lpisock"
150 AC_DEFINE(USE_JPILOT)
153 AC_MSG_CHECKING(whether jpilot is available)
154 if test "$ac_cv_enable_jpilot" = yes; then
163 dnl for LDAP support in addressbook
164 dnl no check for libraries; dynamically loaded
166 [ --enable-ldap Enable LDAP support [default=no]],
167 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
169 AC_MSG_CHECKING([whether to use ldap])
170 if test "$ac_cv_enable_ldap" = yes; then
172 if test "$ac_cv_enable_ldap" = yes; then
173 AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
174 if test "$ac_cv_enable_ldap" = yes; then
175 LIBS="$LIBS -lldap -llber -lpthread -lresolv"
179 AC_MSG_CHECKING(whether ldap is available)
180 if test "$ac_cv_enable_ldap" = yes; then
189 dnl Check for libjconv
191 [ --disable-jconv Do not use libjconv],
192 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
193 if test "$ac_cv_disable_jconv" = no; then
194 AC_CHECK_LIB(jconv, jconv_alloc_conv)
197 AC_CHECK_LIB(xpg4, setlocale)
198 dnl AC_CHECK_LIB(kcc, KCC_filter)
200 dnl for GThread support
201 dnl AC_ARG_ENABLE(threads,
202 dnl [ --enable-threads Enable multithread support [default=no]],
203 dnl [use_threads=$enableval], [use_threads=no])
205 AC_MSG_CHECKING([whether to use threads])
206 if test x"$use_threads" = xyes ; then
208 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
209 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
210 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
211 AC_DEFINE(USE_THREADS)
213 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
219 dnl check for IPv6 option
221 [ --enable-ipv6 Enable IPv6 support [default=no]],
222 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
224 dnl automated checks for IPv6 support.
225 if test x"$ac_cv_enableipv6" = xyes; then
226 AC_MSG_CHECKING([for IPv6 support])
227 AC_CACHE_VAL(ac_cv_ipv6,[
228 AC_TRY_COMPILE([#define INET6
229 #include <sys/types.h>
230 #include <netinet/in.h>],
231 [int x = IPPROTO_IPV6; struct in6_addr a;],
232 ac_cv_ipv6=yes, ac_cv_ipv6=no)
234 AC_MSG_RESULT($ac_cv_ipv6)
235 if test $ac_cv_ipv6 = yes; then
240 dnl check if gdk / gtk was compiled with USE_XIM
241 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
242 CFLAGS_SAVE="$CFLAGS"
243 LDFLAGS_SAVE="$LDFLAGS"
244 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
245 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
246 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
247 AC_TRY_COMPILE([#include <gtk/gtk.h>
248 #include <gdk/gdk.h>],
249 [extern gint gdk_im_open(void); gdk_im_open();],
250 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
252 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
253 if test $ac_cv_use_gtkgdk_xim = yes; then
254 AC_DEFINE(USE_GTKGDK_XIM)
256 CFLAGS="$CFLAGS_SAVE"
257 LDFLAGS="$LDFLAGS_SAVE"
260 dnl Checks for header files.
264 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
265 sys/param.h sys/utsname.h \
268 dnl Checks for typedefs, structures, and compiler characteristics.
275 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
276 dnl may be defined only in wchar.h (this happens with gcc-2.96).
277 dnl So we need to use this extended macro.
278 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
285 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
286 AC_CHECK_SIZEOF(unsigned short, 2)
287 AC_CHECK_SIZEOF(unsigned int, 4)
288 AC_CHECK_SIZEOF(unsigned long, 4)
290 dnl Checks for library functions.
292 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
293 wcsstr wcswcs iswalnum iswspace towlower \
294 wcslen wcscpy wcsncpy \
295 uname flock lockf inet_aton inet_addr \