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 pl 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 AC_MSG_CHECKING([whether to use GPGME])
103 if test $ac_cv_enable_gpgme = yes; then
105 AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no
106 ac_cv_enable_gpgme=no])
111 dnl Check for OpenSSL
113 [ --enable-ssl Enable SSL support using OpenSSL [default=no]],
114 [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
115 AC_MSG_CHECKING([whether to use OpenSSL])
116 if test $ac_cv_enable_ssl = yes; then
118 AC_MSG_CHECKING([if openssl is available])
119 LIBS="$LIBS -lssl -lcrypto"
121 #include <openssl/opensslv.h>
122 ], [ return OPENSSL_VERSION_NUMBER; ],
124 AC_DEFINE(USE_SSL) ],
126 LIBS="$ac_save_LIBS" ])
131 dnl Check for X-Face support
132 AC_ARG_ENABLE(compface,
133 [ --disable-compface Do not use compface (X-Face)],
134 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
135 if test "$ac_cv_disable_compface" = no; then
136 AC_CHECK_LIB(compface, uncompface,,[ac_cv_disable_compface=disable])
139 dnl for JPilot support in addressbook
140 dnl no check for libraries: these are dynamically loaded
141 AC_ARG_ENABLE(jpilot,
142 [ --enable-jpilot Enable JPilot support [default=no]],
143 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
145 AC_MSG_CHECKING([whether to use jpilot])
146 if test "$ac_cv_enable_jpilot" = yes; then
148 if test "$ac_cv_enable_jpilot" = yes; then
149 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, , [ac_cv_enable_jpilot=no])
150 if test "$ac_cv_enable_jpilot" = yes; then
151 LIBS="$LIBS -lpisock"
152 AC_DEFINE(USE_JPILOT)
155 AC_MSG_CHECKING(whether jpilot is available)
156 if test "$ac_cv_enable_jpilot" = yes; then
165 dnl for LDAP support in addressbook
166 dnl no check for libraries; dynamically loaded
168 [ --enable-ldap Enable LDAP support [default=no]],
169 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
171 AC_MSG_CHECKING([whether to use ldap])
172 if test "$ac_cv_enable_ldap" = yes; then
174 if test "$ac_cv_enable_ldap" = yes; then
175 AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
176 if test "$ac_cv_enable_ldap" = yes; then
177 LIBS="$LIBS -lldap -llber -lpthread -lresolv"
181 AC_MSG_CHECKING(whether ldap is available)
182 if test "$ac_cv_enable_ldap" = yes; then
193 AC_PATH_PROG(ispell_path, ispell, no)
194 if test "$ispell_path" != no; then
195 AC_DEFINE_UNQUOTED(ISPELL_PATH, "$ispell_path")
196 AC_SUBST(ISPELL_PATH)
198 AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
199 AC_SUBST(ISPELL_PATH)
202 dnl Check for libjconv
204 [ --disable-jconv Do not use libjconv],
205 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
206 if test "$ac_cv_disable_jconv" = no; then
207 AC_CHECK_LIB(jconv, jconv_alloc_conv,,[ac_cv_disable_jconv=disable])
210 AC_CHECK_LIB(xpg4, setlocale)
211 dnl AC_CHECK_LIB(kcc, KCC_filter)
213 dnl for GThread support (currently disabled)
214 dnl AC_ARG_ENABLE(threads,
215 dnl [ --enable-threads Enable multithread support [default=no]],
216 dnl [use_threads=$enableval], [use_threads=no])
218 AC_MSG_CHECKING([whether to use threads])
219 if test x"$use_threads" = xyes ; then
221 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
222 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
223 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
224 AC_DEFINE(USE_THREADS)
226 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
232 dnl check for IPv6 option
234 [ --enable-ipv6 Enable IPv6 support [default=no]],
235 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
237 dnl automated checks for IPv6 support.
238 AC_MSG_CHECKING([whether to use IPv6])
239 if test x"$ac_cv_enableipv6" = xyes; then
241 AC_MSG_CHECKING([for IPv6 support])
242 AC_CACHE_VAL(ac_cv_ipv6,[
243 AC_TRY_COMPILE([#define INET6
244 #include <sys/types.h>
245 #include <netinet/in.h>],
246 [int x = IPPROTO_IPV6; struct in6_addr a;],
247 ac_cv_ipv6=yes, ac_cv_ipv6=no)
249 AC_MSG_RESULT($ac_cv_ipv6)
250 if test $ac_cv_ipv6 = yes; then
253 AC_MSG_WARN(*** IPv6 will not be supported ***)
260 dnl check if gdk / gtk was compiled with USE_XIM
261 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
262 CFLAGS_SAVE="$CFLAGS"
263 LDFLAGS_SAVE="$LDFLAGS"
264 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
265 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
266 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
267 AC_TRY_COMPILE([#include <gtk/gtk.h>
268 #include <gdk/gdk.h>],
269 [extern gint gdk_im_open(void); gdk_im_open();],
270 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
272 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
273 if test $ac_cv_use_gtkgdk_xim = yes; then
274 AC_DEFINE(USE_GTKGDK_XIM)
276 CFLAGS="$CFLAGS_SAVE"
277 LDFLAGS="$LDFLAGS_SAVE"
280 dnl Checks for header files.
284 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
285 sys/param.h sys/utsname.h \
288 dnl Checks for typedefs, structures, and compiler characteristics.
295 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
296 dnl may be defined only in wchar.h (this happens with gcc-2.96).
297 dnl So we need to use this extended macro.
298 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
305 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
306 AC_CHECK_SIZEOF(unsigned short, 2)
307 AC_CHECK_SIZEOF(unsigned int, 4)
308 AC_CHECK_SIZEOF(unsigned long, 4)
310 dnl Checks for library functions.
312 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
313 wcsstr wcswcs iswalnum iswspace towlower \
314 wcslen wcscpy wcsncpy \
315 uname flock lockf inet_aton inet_addr \
332 dnl Output the configuration summary
334 echo "$PACKAGE $VERSION"
336 if test "$ac_cv_disable_gdk_pixbuf" = no; then
337 echo "gdk-pixbuf : yes"
338 echo "gdk_imlib : no"
340 echo "gdk-pixbuf : no"
341 if test "$ac_cv_disable_imlib" = no; then
342 echo "gdk_imlib : yes"
344 echo "gdk_imlib : no"
347 echo "GPGME : $ac_cv_enable_gpgme"
348 echo "JPilot : $ac_cv_enable_jpilot"
349 echo "LDAP : $ac_cv_enable_ldap"
350 echo "OpenSSL : $ac_cv_enable_ssl"
351 if test "$ac_cv_disable_compface" = no; then
352 echo "compface : yes"
356 if test "$ac_cv_disable_jconv" = no; then
357 echo "libjconv : yes"
361 echo "IPv6 : $ac_cv_enableipv6"
363 echo "The binary will be installed in $prefix/bin"
365 echo "Configure finished, type 'make' to build."