added 'recieve at get all' to 'Edit accounts' window
[claws.git] / configure.in
1 dnl check for needed autoconf version
2 AC_PREREQ(2.50)
3
4 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(src/main.c)
6 PACKAGE=sylpheed
7
8 dnl version number
9 MAJOR_VERSION=0
10 MINOR_VERSION=5
11 MICRO_VERSION=2
12 INTERFACE_AGE=0
13 BINARY_AGE=0
14 EXTRA_VERSION=claws1
15 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
16
17 dnl
18 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
19 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
20 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
21
22 dnl GNOME installed?
23 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
24 if test "$GNOME_CONFIG" != no; then
25         gnomedir="`gnome-config --prefix`"
26         AC_SUBST(gnomedir)
27 fi
28 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
29
30 dnl Claws version
31 AC_DEFINE(CLAWS, 1)
32
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`
38 AC_SUBST(LT_RELEASE)
39 AC_SUBST(LT_CURRENT)
40 AC_SUBST(LT_REVISION)
41 AC_SUBST(LT_AGE)
42
43 dnl Specify a header configuration file
44 AM_CONFIG_HEADER(config.h)
45
46 AM_PROG_LIBTOOL
47 AM_MAINTAINER_MODE
48
49 dnl Checks for programs.
50 AC_ARG_PROGRAM
51 AC_PROG_CC
52 AC_ISC_POSIX
53 AM_PROG_CC_STDC
54 AC_PROG_INSTALL
55 AC_PROG_LN_S
56 AC_PROG_MAKE_SET
57 AC_PROG_CPP
58 dnl AC_PROG_RANLIB
59 AM_PROG_LEX
60 AC_PROG_YACC
61
62 SYLPHEED_ACLOCAL_INCLUDE(ac)
63
64 dnl for gettext
65 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
66 AM_GNU_GETTEXT
67 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
68 localedir='${prefix}/${DATADIRNAME}/locale'
69 AC_SUBST(localedir)
70
71 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
72 AC_SUBST(manualdir)
73
74 dnl Checks for libraries.
75 AM_PATH_GLIB(1.2.6,,
76         AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
77         gthread)
78 AM_PATH_GTK(1.2.6,,
79         AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
80
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])
85 AC_ARG_ENABLE(imlib,
86         [  --disable-imlib         Do not use imlib],
87         [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
88
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])
92 fi
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])
96 fi
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 ***)
99 fi
100
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 if test $ac_cv_enable_gpgme = yes; then
106         AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
107 fi
108
109 dnl Use OpenSSL for SSL connections 
110 AC_MSG_CHECKING([whether to use ssl])
111 AC_ARG_ENABLE(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
115         AC_MSG_RESULT(yes)
116 else
117         AC_MSG_RESULT(no)
118 fi
119
120 if test $ac_cv_enable_ssl = yes; then
121         AC_MSG_CHECKING([whether to openssl is available])
122         LIBS="$LIBS -lssl"
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 fi
131
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)
138 fi
139
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])
145
146 AC_MSG_CHECKING([whether to use jpilot])
147 if test "$ac_cv_enable_jpilot" = yes; then
148         AC_MSG_RESULT(yes)
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)
154                 fi
155         fi
156         AC_MSG_CHECKING(whether jpilot is available)
157         if test "$ac_cv_enable_jpilot" = yes; then
158                 AC_MSG_RESULT(yes)
159         else
160                 AC_MSG_RESULT(no)
161         fi
162 else
163         AC_MSG_RESULT(no)
164 fi
165
166 dnl for LDAP support in addressbook
167 dnl no check for libraries; dynamically loaded
168 AC_ARG_ENABLE(ldap,
169         [  --enable-ldap         Enable LDAP support [default=no]],
170         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
171
172 AC_MSG_CHECKING([whether to use ldap])
173 if test "$ac_cv_enable_ldap" = yes; then
174         AC_MSG_RESULT(yes)
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"
179                         AC_DEFINE(USE_LDAP)
180                 fi      
181         fi
182         AC_MSG_CHECKING(whether ldap is available)
183         if test "$ac_cv_enable_ldap" = yes; then
184                 AC_MSG_RESULT(yes)
185         else
186                 AC_MSG_RESULT(no)
187         fi
188 else
189         AC_MSG_RESULT(no)
190 fi
191
192 dnl get ispell path
193 dnl
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)
198 else
199         AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
200         AC_SUBST(ISPELL_PATH)
201 fi
202
203 dnl Check for libjconv
204 AC_ARG_ENABLE(jconv,
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)
209 fi
210
211 AC_CHECK_LIB(xpg4, setlocale)
212 dnl AC_CHECK_LIB(kcc, KCC_filter)
213
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])
218
219 AC_MSG_CHECKING([whether to use threads])
220 if test x"$use_threads" = xyes ; then
221         AC_MSG_RESULT(yes)
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)
226         else
227                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
228         fi
229 else
230         AC_MSG_RESULT(no)
231 fi
232
233 dnl check for IPv6 option
234 AC_ARG_ENABLE(ipv6,
235         [  --enable-ipv6           Enable IPv6 support [default=no]],
236         [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
237
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)
247         ])
248         AC_MSG_RESULT($ac_cv_ipv6)
249         if test $ac_cv_ipv6 = yes; then
250                 AC_DEFINE(INET6)
251         fi
252 fi
253
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)
265         ])
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)
269 fi
270 CFLAGS="$CFLAGS_SAVE"
271 LDFLAGS="$LDFLAGS_SAVE"
272
273
274 dnl Checks for header files.
275 AC_HEADER_DIRENT
276 AC_HEADER_STDC
277 AC_HEADER_SYS_WAIT
278 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
279                  sys/param.h sys/utsname.h \
280                  wchar.h wctype.h)
281
282 dnl Checks for typedefs, structures, and compiler characteristics.
283 AC_C_CONST
284 AC_TYPE_OFF_T
285 AC_TYPE_PID_T
286 AC_TYPE_SIZE_T
287 AC_STRUCT_TM
288
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,
293 [
294 #if HAVE_WCHAR_H
295 #include <wchar.h>
296 #endif
297 ])
298
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)
303
304 dnl Checks for library functions.
305 AC_FUNC_ALLOCA
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 \
310                fchmod mkstemp)
311
312 AC_OUTPUT([
313 Makefile
314 sylpheed.spec
315 intl/Makefile
316 ac/Makefile
317 po/Makefile.in
318 libkcc/Makefile
319 src/Makefile
320 manual/Makefile
321 manual/ja/Makefile
322 manual/en/Makefile
323 ])