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 AC_MSG_CHECKING([whether to use GPGME])
106 if test $ac_cv_enable_gpgme = yes; then
108 AM_PATH_GPGME(0.2.1, 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) ],
129 LIBS="$ac_save_LIBS" ])
134 dnl Check for X-Face support
135 AC_ARG_ENABLE(compface,
136 [ --disable-compface Do not use compface (X-Face)],
137 [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
138 if test "$ac_cv_disable_compface" = no; then
139 AC_CHECK_LIB(compface, uncompface,,[ac_cv_disable_compface=disable])
142 dnl for JPilot support in addressbook
143 dnl no check for libraries: these are dynamically loaded
144 AC_ARG_ENABLE(jpilot,
145 [ --enable-jpilot Enable JPilot support [default=no]],
146 [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 if test "$ac_cv_enable_jpilot" = yes; then
152 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, , [ac_cv_enable_jpilot=no])
153 if test "$ac_cv_enable_jpilot" = yes; then
154 LIBS="$LIBS -lpisock"
155 AC_DEFINE(USE_JPILOT)
158 AC_MSG_CHECKING(whether jpilot is available)
159 if test "$ac_cv_enable_jpilot" = yes; then
168 dnl for LDAP support in addressbook
169 dnl no check for libraries; dynamically loaded
171 [ --enable-ldap Enable LDAP support [default=no]],
172 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
174 AC_MSG_CHECKING([whether to use ldap])
175 if test "$ac_cv_enable_ldap" = yes; then
177 if test "$ac_cv_enable_ldap" = yes; then
178 AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
179 if test "$ac_cv_enable_ldap" = yes; then
180 LIBS="$LIBS -lldap -llber -lpthread -lresolv"
184 AC_MSG_CHECKING(whether ldap is available)
185 if test "$ac_cv_enable_ldap" = yes; then
196 AC_PATH_PROG(ispell_path, ispell, no)
197 if test "$ispell_path" != no; then
198 AC_DEFINE_UNQUOTED(ISPELL_PATH, "$ispell_path")
199 AC_SUBST(ISPELL_PATH)
201 AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
202 AC_SUBST(ISPELL_PATH)
205 dnl Check for libjconv
207 [ --disable-jconv Do not use libjconv],
208 [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
209 if test "$ac_cv_disable_jconv" = no; then
210 AC_CHECK_LIB(jconv, jconv_alloc_conv,,[ac_cv_disable_jconv=disable])
213 AC_CHECK_LIB(xpg4, setlocale)
214 dnl AC_CHECK_LIB(kcc, KCC_filter)
216 dnl for GThread support (currently disabled)
217 dnl AC_ARG_ENABLE(threads,
218 dnl [ --enable-threads Enable multithread support [default=no]],
219 dnl [use_threads=$enableval], [use_threads=no])
221 AC_MSG_CHECKING([whether to use threads])
222 if test x"$use_threads" = xyes ; then
224 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
225 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
226 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
227 AC_DEFINE(USE_THREADS)
229 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
235 dnl check for IPv6 option
237 [ --enable-ipv6 Enable IPv6 support [default=no]],
238 [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
240 dnl automated checks for IPv6 support.
241 AC_MSG_CHECKING([whether to use IPv6])
242 if test x"$ac_cv_enableipv6" = xyes; then
244 AC_MSG_CHECKING([for IPv6 support])
245 AC_CACHE_VAL(ac_cv_ipv6,[
246 AC_TRY_COMPILE([#define INET6
247 #include <sys/types.h>
248 #include <netinet/in.h>],
249 [int x = IPPROTO_IPV6; struct in6_addr a;],
250 ac_cv_ipv6=yes, ac_cv_ipv6=no)
252 AC_MSG_RESULT($ac_cv_ipv6)
253 if test $ac_cv_ipv6 = yes; then
256 AC_MSG_WARN(*** IPv6 will not be supported ***)
263 dnl check if gdk / gtk was compiled with USE_XIM
264 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
265 CFLAGS_SAVE="$CFLAGS"
266 LDFLAGS_SAVE="$LDFLAGS"
267 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
268 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
269 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
270 AC_TRY_COMPILE([#include <gtk/gtk.h>
271 #include <gdk/gdk.h>],
272 [extern gint gdk_im_open(void); gdk_im_open();],
273 ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
275 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
276 if test $ac_cv_use_gtkgdk_xim = yes; then
277 AC_DEFINE(USE_GTKGDK_XIM)
279 CFLAGS="$CFLAGS_SAVE"
280 LDFLAGS="$LDFLAGS_SAVE"
283 dnl Checks for header files.
287 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
288 sys/param.h sys/utsname.h \
291 dnl Checks for typedefs, structures, and compiler characteristics.
298 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
299 dnl may be defined only in wchar.h (this happens with gcc-2.96).
300 dnl So we need to use this extended macro.
301 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
308 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
309 AC_CHECK_SIZEOF(unsigned short, 2)
310 AC_CHECK_SIZEOF(unsigned int, 4)
311 AC_CHECK_SIZEOF(unsigned long, 4)
313 dnl Checks for library functions.
315 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
316 wcsstr wcswcs iswalnum iswspace towlower \
317 wcslen wcscpy wcsncpy \
318 uname flock lockf inet_aton inet_addr \
334 dnl Output the configuration summary
336 echo "$PACKAGE $VERSION"
338 if test "$ac_cv_disable_gdk_pixbuf" = no; then
339 echo "gdk-pixbuf : yes"
340 echo "gdk_imlib : no"
342 echo "gdk-pixbuf : no"
343 if test "$ac_cv_disable_imlib" = no; then
344 echo "gdk_imlib : yes"
346 echo "gdk_imlib : no"
349 echo "GPGME : $ac_cv_enable_gpgme"
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."