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 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
17 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
22 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
23 if test "$GNOME_CONFIG" != no; then
24 gnomedir="`gnome-config --prefix`"
27 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
32 dnl libtool versioning
33 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
34 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
35 LT_REVISION=$INTERFACE_AGE
36 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
42 dnl Specify a header configuration file
43 AM_CONFIG_HEADER(config.h)
47 dnl Checks for programs.
61 SYLPHEED_ACLOCAL_INCLUDE(ac)
64 ALL_LINGUAS="cs de el es fr hr it ja ko nl pl pt_BR ru sv"
66 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
67 localedir='${prefix}/${DATADIRNAME}/locale'
70 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
73 dnl Checks for libraries.
75 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
78 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
80 dnl Check for built-in image view support
81 AC_ARG_ENABLE(gdk-pixbuf,
82 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
83 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
85 [ --disable-imlib Do not use imlib],
86 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
88 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
89 AM_PATH_GDK_PIXBUF(0.8.0,
90 [AC_DEFINE(HAVE_GDK_PIXBUF)
91 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
93 if test "$ac_cv_enable_imlib" = yes; then
94 AM_PATH_GDK_IMLIB(1.9,
95 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_enable_imlib=no])
97 if test "$ac_cv_enable_gdk_pixbuf" = no -a "$ac_cv_enable_imlib" = no; 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 AC_MSG_CHECKING([whether to use GPGME])
106 if test $ac_cv_enable_gpgme = yes; then
108 AM_PATH_GPGME(0.2.3, AC_DEFINE(USE_GPGME), [use_gpgme=no
109 ac_cv_enable_gpgme=no])
114 dnl Check for OpenSSL
116 [ --enable-ssl Enable SSL support using OpenSSL [default=no]],
117 [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
118 AC_MSG_CHECKING([whether to use OpenSSL])
119 if test $ac_cv_enable_ssl = yes; then
121 AC_MSG_CHECKING([if openssl is available])
122 LIBS="$LIBS -lssl -lcrypto"
124 #include <openssl/opensslv.h>
125 ], [ return OPENSSL_VERSION_NUMBER; ],
127 AC_DEFINE(USE_SSL) ],
130 ac_cv_enable_ssl=no ])
135 dnl Check for X-Face support
136 AC_ARG_ENABLE(compface,
137 [ --disable-compface Do not use compface (X-Face)],
138 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
139 if test "$ac_cv_enable_compface" = yes; then
140 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
143 dnl for JPilot support in addressbook
144 dnl no check for libraries; these are dynamically loaded
145 AC_ARG_ENABLE(jpilot,
146 [ --enable-jpilot Enable JPilot support [default=no]],
147 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
148 AC_MSG_CHECKING([whether to use JPilot])
149 if test "$ac_cv_enable_jpilot" = yes; then
151 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
152 [ LIBS="$LIBS -lpisock"
153 AC_DEFINE(USE_JPILOT) ],
154 [ ac_cv_enable_jpilot=no ])
155 if test "$ac_cv_enable_jpilot" = no; then
156 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
157 [ LIBS="$LIBS -lpisock"
158 ac_cv_enable_jpilot=yes
159 AC_DEFINE(USE_JPILOT) ])
161 AC_MSG_CHECKING([whether jpilot is available])
162 AC_MSG_RESULT($ac_cv_enable_jpilot)
167 dnl for LDAP support in addressbook
168 dnl no check for libraries; dynamically loaded
170 [ --enable-ldap Enable LDAP support [default=no]],
171 [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 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
176 [ LIBS="$LIBS -lldap -llber -lpthread -lresolv `glib-config --libs gthread`"
177 AC_DEFINE(USE_LDAP) ],
178 [ ac_cv_enable_ldap=no ])
179 AC_MSG_CHECKING([whether ldap is available])
180 AC_MSG_RESULT($ac_cv_enable_ldap)
187 AC_PATH_PROG(ispell_path, ispell, no)
188 if test "$ispell_path" != no; then
189 AC_DEFINE_UNQUOTED(ISPELL_PATH, "$ispell_path")
190 AC_SUBST(ISPELL_PATH)
192 AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
193 AC_SUBST(ISPELL_PATH)
196 dnl Check for libjconv
198 [ --disable-jconv Do not use libjconv],
199 [ac_cv_enable_jconv=$enableval], [ac_cv_enable_jconv=yes])
200 if test "$ac_cv_enable_jconv" = yes; then
201 AC_CHECK_LIB(jconv, jconv_alloc_conv,,[ac_cv_enable_jconv=no])
204 AC_CHECK_LIB(xpg4, setlocale)
205 dnl AC_CHECK_LIB(kcc, KCC_filter)
207 dnl for GThread support (currently disabled)
208 dnl AC_ARG_ENABLE(threads,
209 dnl [ --enable-threads Enable multithread support [default=no]],
210 dnl [use_threads=$enableval], [use_threads=no])
212 AC_MSG_CHECKING([whether to use threads])
213 if test x"$use_threads" = xyes ; then
215 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
216 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
217 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
218 AC_DEFINE(USE_THREADS)
220 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
226 dnl check for IPv6 option
228 [ --enable-ipv6 Enable IPv6 support [default=no]],
229 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
231 dnl automated checks for IPv6 support.
232 AC_MSG_CHECKING([whether to use IPv6])
233 if test x"$ac_cv_enable_ipv6" = xyes; then
235 AC_MSG_CHECKING([for IPv6 support])
236 AC_CACHE_VAL(ac_cv_ipv6,[
237 AC_TRY_COMPILE([#define INET6
238 #include <sys/types.h>
239 #include <netinet/in.h>],
240 [int x = IPPROTO_IPV6; struct in6_addr a;],
241 ac_cv_ipv6=yes, ac_cv_ipv6=no)
243 AC_MSG_RESULT($ac_cv_ipv6)
244 if test $ac_cv_ipv6 = yes; then
247 AC_MSG_WARN(*** IPv6 will not be supported ***)
254 dnl PSPELL is user for spell checking
255 AC_ARG_ENABLE(pspell,
256 [ --enable-pspell Enable pspell support [default=no]],
257 [ac_cv_enable_pspell=$enableval], [ac_cv_enable_pspell=no])
258 AC_MSG_CHECKING([whether to use pspell])
259 if test $ac_cv_enable_pspell = yes; then
261 AM_PATH_PSPELL(.12.2, AC_DEFINE(USE_PSPELL), [use_pspell=no
262 ac_cv_enable_pspell=no])
267 dnl check if gdk / gtk was compiled with USE_XIM
268 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
269 CFLAGS_SAVE="$CFLAGS"
270 LDFLAGS_SAVE="$LDFLAGS"
271 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
272 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
273 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
274 AC_TRY_COMPILE([#include <gtk/gtk.h>
275 #include <gdk/gdk.h>],
276 [extern gint gdk_im_open(void); gdk_im_open();],
277 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
279 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
280 if test $ac_cv_use_gtkgdk_xim = yes; then
281 AC_DEFINE(USE_GTKGDK_XIM)
283 CFLAGS="$CFLAGS_SAVE"
284 LDFLAGS="$LDFLAGS_SAVE"
287 dnl Checks for header files.
291 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
292 sys/param.h sys/utsname.h \
295 dnl Checks for typedefs, structures, and compiler characteristics.
302 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
303 dnl may be defined only in wchar.h (this happens with gcc-2.96).
304 dnl So we need to use this extended macro.
305 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
312 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
313 AC_CHECK_SIZEOF(unsigned short, 2)
314 AC_CHECK_SIZEOF(unsigned int, 4)
315 AC_CHECK_SIZEOF(unsigned long, 4)
317 dnl Checks for library functions.
319 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
320 wcsstr wcswcs iswalnum iswspace towlower \
321 wcslen wcscpy wcsncpy \
322 uname flock lockf inet_aton inet_addr \
340 dnl Output the configuration summary
342 echo "$PACKAGE $VERSION"
344 echo "gdk-pixbuf : $ac_cv_enable_gdk_pixbuf"
345 echo "gdk_imlib : $ac_cv_enable_imlib"
346 echo "GPGME : $ac_cv_enable_gpgme"
347 echo "JPilot : $ac_cv_enable_jpilot"
348 echo "LDAP : $ac_cv_enable_ldap"
349 echo "OpenSSL : $ac_cv_enable_ssl"
350 echo "compface : $ac_cv_enable_compface"
351 echo "libjconv : $ac_cv_enable_jconv"
352 echo "IPv6 : $ac_cv_enable_ipv6"
353 echo "Pspell : $ac_cv_enable_pspell"
355 echo "The binary will be installed in $prefix/bin"
357 echo "Configure finished, type 'make' to build."