1 dnl check for needed autoconf version
4 dnl Process this file with autoconf to produce a configure script.
15 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
18 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
19 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
20 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
23 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
24 if test "$GNOME_CONFIG" != no; then
25 gnomedir="`gnome-config --prefix`"
28 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
33 dnl libtool versioning
34 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
35 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
36 LT_REVISION=$INTERFACE_AGE
37 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
43 dnl Specify a header configuration file
44 AM_CONFIG_HEADER(config.h)
49 dnl Checks for programs.
62 SYLPHEED_ACLOCAL_INCLUDE(ac)
65 ALL_LINGUAS="cs de el es fr it ja ko nl pl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
67 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
68 localedir='${prefix}/${DATADIRNAME}/locale'
71 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
74 dnl Checks for libraries.
76 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
79 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
81 dnl Check for built-in image view support
82 AC_ARG_ENABLE(gdk-pixbuf,
83 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
84 [ac_cv_disable_gdk_pixbuf=disable], [ac_cv_disable_gdk_pixbuf=no])
86 [ --disable-imlib Do not use imlib],
87 [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
89 if test "$ac_cv_disable_gdk_pixbuf" = no; then
90 AM_PATH_GDK_PIXBUF(0.8.0,
91 AC_DEFINE(HAVE_GDK_PIXBUF), [ac_cv_disable_gdk_pixbuf=disable])
93 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = no; then
94 AM_PATH_GDK_IMLIB(1.9,
95 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_disable_imlib=disable])
97 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = disable; then
98 AC_MSG_WARN(*** Built-in image view will not be supported ***)
101 dnl GPGME is used to support OpenPGP
103 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
104 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
105 if test $ac_cv_enable_gpgme = yes; then
106 AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
109 dnl Use OpenSSL for SSL connections
110 AC_MSG_CHECKING([whether to use ssl])
112 [ --enable-ssl Enable SSL support using OpenSSL [default=no]],
113 [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
114 if test $ac_cv_enable_ssl = yes; then
120 if test $ac_cv_enable_ssl = yes; then
121 AC_MSG_CHECKING([whether to openssl is available])
124 #include <openssl/opensslv.h>
125 ], [ return(OPENSSL_VERSION_NUMBER); ],
127 AC_DEFINE(USE_SSL) ],
129 LIBS="$ac_save_LIBS" ])
132 dnl Check for X-Face support
133 AC_ARG_ENABLE(compface,
134 [ --disable-compface Do not use compface (X-Face)],
135 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
136 if test "$ac_cv_disable_compface" = no; then
137 AC_CHECK_LIB(compface, uncompface)
140 dnl for JPilot support in addressbook
141 dnl no check for libraries: these are dynamically loaded
142 AC_ARG_ENABLE(jpilot,
143 [ --enable-jpilot Enable JPilot support [default=no]],
144 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
146 AC_MSG_CHECKING([whether to use jpilot])
147 if test "$ac_cv_enable_jpilot" = yes; then
149 if test "$ac_cv_enable_jpilot" = yes; then
150 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, , [ac_cv_enable_jpilot=no])
151 if test "$ac_cv_enable_jpilot" = yes; then
152 LIBS="$LIBS -lpisock"
153 AC_DEFINE(USE_JPILOT)
156 AC_MSG_CHECKING(whether jpilot is available)
157 if test "$ac_cv_enable_jpilot" = yes; then
166 dnl for LDAP support in addressbook
167 dnl no check for libraries; dynamically loaded
169 [ --enable-ldap Enable LDAP support [default=no]],
170 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
172 AC_MSG_CHECKING([whether to use ldap])
173 if test "$ac_cv_enable_ldap" = yes; then
175 if test "$ac_cv_enable_ldap" = yes; then
176 AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
177 if test "$ac_cv_enable_ldap" = yes; then
178 LIBS="$LIBS -lldap -llber -lpthread -lresolv"
182 AC_MSG_CHECKING(whether ldap is available)
183 if test "$ac_cv_enable_ldap" = yes; then
194 AC_PATH_PROG(ispell_path, ispell, no)
195 if test "$ispell_path" != no; then
196 AC_DEFINE_UNQUOTED(ISPELL_PATH, "$ispell_path")
197 AC_SUBST(ISPELL_PATH)
199 AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
200 AC_SUBST(ISPELL_PATH)
203 dnl Check for libjconv
205 [ --disable-jconv Do not use libjconv],
206 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
207 if test "$ac_cv_disable_jconv" = no; then
208 AC_CHECK_LIB(jconv, jconv_alloc_conv)
211 AC_CHECK_LIB(xpg4, setlocale)
212 dnl AC_CHECK_LIB(kcc, KCC_filter)
214 dnl for GThread support
215 dnl AC_ARG_ENABLE(threads,
216 dnl [ --enable-threads Enable multithread support [default=no]],
217 dnl [use_threads=$enableval], [use_threads=no])
219 AC_MSG_CHECKING([whether to use threads])
220 if test x"$use_threads" = xyes ; then
222 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
223 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
224 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
225 AC_DEFINE(USE_THREADS)
227 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
233 dnl check for IPv6 option
235 [ --enable-ipv6 Enable IPv6 support [default=no]],
236 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
238 dnl automated checks for IPv6 support.
239 if test x"$ac_cv_enableipv6" = xyes; then
240 AC_MSG_CHECKING([for IPv6 support])
241 AC_CACHE_VAL(ac_cv_ipv6,[
242 AC_TRY_COMPILE([#define INET6
243 #include <sys/types.h>
244 #include <netinet/in.h>],
245 [int x = IPPROTO_IPV6; struct in6_addr a;],
246 ac_cv_ipv6=yes, ac_cv_ipv6=no)
248 AC_MSG_RESULT($ac_cv_ipv6)
249 if test $ac_cv_ipv6 = yes; then
254 dnl check if gdk / gtk was compiled with USE_XIM
255 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
256 CFLAGS_SAVE="$CFLAGS"
257 LDFLAGS_SAVE="$LDFLAGS"
258 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
259 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
260 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
261 AC_TRY_COMPILE([#include <gtk/gtk.h>
262 #include <gdk/gdk.h>],
263 [extern gint gdk_im_open(void); gdk_im_open();],
264 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
266 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
267 if test $ac_cv_use_gtkgdk_xim = yes; then
268 AC_DEFINE(USE_GTKGDK_XIM)
270 CFLAGS="$CFLAGS_SAVE"
271 LDFLAGS="$LDFLAGS_SAVE"
274 dnl Checks for header files.
278 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
279 sys/param.h sys/utsname.h \
282 dnl Checks for typedefs, structures, and compiler characteristics.
289 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
290 dnl may be defined only in wchar.h (this happens with gcc-2.96).
291 dnl So we need to use this extended macro.
292 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
299 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
300 AC_CHECK_SIZEOF(unsigned short, 2)
301 AC_CHECK_SIZEOF(unsigned int, 4)
302 AC_CHECK_SIZEOF(unsigned long, 4)
304 dnl Checks for library functions.
306 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
307 wcsstr wcswcs iswalnum iswspace towlower \
308 wcslen wcscpy wcsncpy \
309 uname flock lockf inet_aton inet_addr \