sync with sylpheed 0.6.5cvs14
[claws.git] / configure.in
blob62bb9609f2d798faf5f96bf7a8e66c1c31e91746
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/main.c)
3 PACKAGE=sylpheed
5 dnl version number
6 MAJOR_VERSION=0
7 MINOR_VERSION=6
8 MICRO_VERSION=5
9 INTERFACE_AGE=0
10 BINARY_AGE=0
11 EXTRA_VERSION=claws27
12 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
14 dnl
15 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
16 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
17 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
18 AC_SUBST(PACKAGE)
19 AC_SUBST(VERSION)
21 dnl GNOME installed?
22 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
23 if test "$GNOME_CONFIG" != no; then
24         gnomedir="`gnome-config --prefix`"
25         AC_SUBST(gnomedir)
27 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
29 dnl Claws version
30 AC_DEFINE(CLAWS, 1)
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`
37 AC_SUBST(LT_RELEASE)
38 AC_SUBST(LT_CURRENT)
39 AC_SUBST(LT_REVISION)
40 AC_SUBST(LT_AGE)
42 dnl Specify a header configuration file
43 AM_CONFIG_HEADER(config.h)
45 AM_MAINTAINER_MODE
47 dnl Checks for programs.
48 AC_ARG_PROGRAM
49 AC_PROG_CC
50 AC_ISC_POSIX
51 AM_PROG_CC_STDC
52 AC_PROG_INSTALL
53 AC_PROG_LN_S
54 AC_PROG_MAKE_SET
55 AC_PROG_CPP
56 dnl AC_PROG_RANLIB
57 AM_PROG_LIBTOOL
58 AM_PROG_LEX
59 AC_PROG_YACC
61 SYLPHEED_ACLOCAL_INCLUDE(ac)
63 dnl for gettext
64 ALL_LINGUAS="cs de el es fr hr it ja ko nl pl pt_BR ru sv"
65 AM_GNU_GETTEXT
66 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
67 localedir='${prefix}/${DATADIRNAME}/locale'
68 AC_SUBST(localedir)
70 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
71 AC_SUBST(manualdir)
73 dnl Checks for libraries.
74 AM_PATH_GLIB(1.2.6,,
75         AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
76         gthread)
77 AM_PATH_GTK(1.2.6,,
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])
84 AC_ARG_ENABLE(imlib,
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 
102 AC_ARG_ENABLE(gpgme,
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
107         AC_MSG_RESULT(yes)
108         AM_PATH_GPGME(0.2.3, AC_DEFINE(USE_GPGME), [use_gpgme=no
109                                                     ac_cv_enable_gpgme=no])
110 else
111         AC_MSG_RESULT(no)
114 dnl Check for OpenSSL
115 AC_ARG_ENABLE(ssl,
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
120         AC_MSG_RESULT(yes)
121         AC_MSG_CHECKING([if openssl is available])
122         LIBS="$LIBS -lssl -lcrypto"
123         AC_TRY_LINK([
124 #include <openssl/opensslv.h>
125 ],      [ return OPENSSL_VERSION_NUMBER; ],
126         [ AC_MSG_RESULT(yes)
127           AC_DEFINE(USE_SSL) ],
128         [ AC_MSG_RESULT(no)
129           LIBS="$ac_save_LIBS"
130           ac_cv_enable_ssl=no ])
131 else
132         AC_MSG_RESULT(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
150         AC_MSG_RESULT(yes)
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) ])
160         fi
161         AC_MSG_CHECKING([whether jpilot is available])
162         AC_MSG_RESULT($ac_cv_enable_jpilot)
163 else
164         AC_MSG_RESULT(no)
167 dnl for LDAP support in addressbook
168 dnl no check for libraries; dynamically loaded
169 AC_ARG_ENABLE(ldap,
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
174         AC_MSG_RESULT(yes)
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)
181 else
182         AC_MSG_RESULT(no)
185 dnl get ispell path
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)
191 else
192         AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
193         AC_SUBST(ISPELL_PATH)
196 dnl Check for libjconv
197 AC_ARG_ENABLE(jconv,
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
214         AC_MSG_RESULT(yes)
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)
219         else
220                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
221         fi
222 else
223         AC_MSG_RESULT(no)
226 dnl check for IPv6 option
227 AC_ARG_ENABLE(ipv6,
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
234         AC_MSG_RESULT(yes)
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)
242         ])
243         AC_MSG_RESULT($ac_cv_ipv6)
244         if test $ac_cv_ipv6 = yes; then
245                 AC_DEFINE(INET6)
246         else
247                 AC_MSG_WARN(*** IPv6 will not be supported ***)
248                 ac_cv_enable_ipv6=no
249         fi
250 else
251         AC_MSG_RESULT(no)
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
260         AC_MSG_RESULT(yes)
261         AM_PATH_PSPELL(.12.2, AC_DEFINE(USE_PSPELL), [use_pspell=no
262                                                     ac_cv_enable_pspell=no])
263 else
264         AC_MSG_RESULT(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)
278         ])
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.
288 AC_HEADER_DIRENT
289 AC_HEADER_STDC
290 AC_HEADER_SYS_WAIT
291 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
292                  sys/param.h sys/utsname.h \
293                  wchar.h wctype.h)
295 dnl Checks for typedefs, structures, and compiler characteristics.
296 AC_C_CONST
297 AC_TYPE_OFF_T
298 AC_TYPE_PID_T
299 AC_TYPE_SIZE_T
300 AC_STRUCT_TM
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,
307 #if HAVE_WCHAR_H
308 #include <wchar.h>
309 #endif
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.
318 AC_FUNC_ALLOCA
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 \
323                fchmod mkstemp)
325 AC_OUTPUT([
326 Makefile
327 sylpheed.spec
328 intl/Makefile
329 ac/Makefile
330 po/Makefile.in
331 libkcc/Makefile
332 src/version.h
333 src/Makefile
334 manual/Makefile
335 manual/en/Makefile
336 manual/ja/Makefile
337 tools/Makefile
340 dnl Output the configuration summary
341 echo ""
342 echo "$PACKAGE $VERSION"
343 echo ""
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"
354 echo ""
355 echo "The binary will be installed in $prefix/bin"
356 echo ""
357 echo "Configure finished, type 'make' to build."