updated pt_BR.po
[claws.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/main.c)
3 PACKAGE=sylpheed
4
5 dnl version number
6 MAJOR_VERSION=0
7 MINOR_VERSION=5
8 MICRO_VERSION=1
9 INTERFACE_AGE=0
10 BINARY_AGE=0
11 EXTRA_VERSION=claws2
12 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
13
14 dnl
15 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
16 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
17 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
18
19 dnl GNOME installed?
20 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
21 if test "$GNOME_CONFIG" != no; then
22         gnomedir="`gnome-config --prefix`"
23         AC_SUBST(gnomedir)
24 fi
25 AM_CONDITIONAL(SYLPHEED_GNOME, test -d "$gnomedir")
26
27 dnl Claws version
28 AC_DEFINE(CLAWS, 1)
29
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`
35 AC_SUBST(LT_RELEASE)
36 AC_SUBST(LT_CURRENT)
37 AC_SUBST(LT_REVISION)
38 AC_SUBST(LT_AGE)
39
40 dnl Specify a header configuration file
41 AM_CONFIG_HEADER(config.h)
42
43 AM_PROG_LIBTOOL
44 AM_MAINTAINER_MODE
45
46 dnl Checks for programs.
47 AC_ARG_PROGRAM
48 AC_PROG_CC
49 AC_ISC_POSIX
50 AM_PROG_CC_STDC
51 AC_PROG_INSTALL
52 AC_PROG_LN_S
53 AC_PROG_MAKE_SET
54 AC_PROG_CPP
55 dnl AC_PROG_RANLIB
56 AM_PROG_LEX
57 AC_PROG_YACC
58
59 SYLPHEED_ACLOCAL_INCLUDE(ac)
60
61 dnl for gettext
62 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
63 AM_GNU_GETTEXT
64 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
65 localedir='${prefix}/${DATADIRNAME}/locale'
66 AC_SUBST(localedir)
67
68 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
69 AC_SUBST(manualdir)
70
71 dnl Checks for libraries.
72 AM_PATH_GLIB(1.2.6,,
73         AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
74         gthread)
75 AM_PATH_GTK(1.2.6,,
76         AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
77
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])
82 AC_ARG_ENABLE(imlib,
83         [  --disable-imlib         Do not use imlib],
84         [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
85
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])
89 fi
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])
93 fi
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 ***)
96 fi
97
98 dnl GPGME is used to support OpenPGP 
99 AC_ARG_ENABLE(gpgme,
100         [  --enable-gpgme          Enable GnuPG support using GPGME [default=no]],
101         [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
102 if test $ac_cv_enable_gpgme = yes; then
103         AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
104 fi
105
106 dnl Use OpenSSL for SSL connections 
107 AC_MSG_CHECKING([whether to use ssl])
108 AC_ARG_ENABLE(ssl,
109         [  --enable-ssl            Enable SSL support using OpenSSL [default=no]],
110         [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
111 if test $ac_cv_enable_ssl = yes; then
112         AC_MSG_RESULT(yes)
113 else
114         AC_MSG_RESULT(no)
115 fi
116
117 if test $ac_cv_enable_ssl = yes; then
118         AC_MSG_CHECKING([whether to openssl is available])
119         LIBS="$LIBS -lssl"
120         AC_TRY_LINK([
121 #include <openssl/opensslv.h>
122 ],      [ return(OPENSSL_VERSION_NUMBER); ],
123         [ AC_MSG_RESULT(yes)
124           AC_DEFINE(USE_SSL) ],
125         [ AC_MSG_RESULT(no) 
126           LIBS="$ac_save_LIBS" ])
127 fi
128
129 dnl Check for X-Face support
130 AC_ARG_ENABLE(compface,
131         [  --disable-compface      Do not use compface (X-Face)],
132         [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
133 if test "$ac_cv_disable_compface" = no; then
134         AC_CHECK_LIB(compface, uncompface)
135 fi
136
137 dnl for JPilot support in addressbook
138 dnl no check for libraries: these are dynamically loaded
139 AC_ARG_ENABLE(jpilot,
140         [  --enable-jpilot         Enable JPilot support [default=no]],
141         [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
142
143 AC_MSG_CHECKING([whether to use jpilot])
144 if test "$ac_cv_enable_jpilot" = yes; then
145         AC_MSG_RESULT(yes)
146         if test "$ac_cv_enable_jpilot" = yes; then
147                 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, , [ac_cv_enable_jpilot=no])
148                 if test "$ac_cv_enable_jpilot" = yes; then              
149                         LIBS="$LIBS -lpisock"
150                         AC_DEFINE(USE_JPILOT)
151                 fi
152         fi
153         AC_MSG_CHECKING(whether jpilot is available)
154         if test "$ac_cv_enable_jpilot" = yes; then
155                 AC_MSG_RESULT(yes)
156         else
157                 AC_MSG_RESULT(no)
158         fi
159 else
160         AC_MSG_RESULT(no)
161 fi
162
163 dnl for LDAP support in addressbook
164 dnl no check for libraries; dynamically loaded
165 AC_ARG_ENABLE(ldap,
166         [  --enable-ldap         Enable LDAP support [default=no]],
167         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
168
169 AC_MSG_CHECKING([whether to use ldap])
170 if test "$ac_cv_enable_ldap" = yes; then
171         AC_MSG_RESULT(yes)
172         if test "$ac_cv_enable_ldap" = yes; then
173                 AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
174                 if test "$ac_cv_enable_ldap" = yes; then
175                         LIBS="$LIBS -lldap -llber -lpthread -lresolv"
176                         AC_DEFINE(USE_LDAP)
177                 fi      
178         fi
179         AC_MSG_CHECKING(whether ldap is available)
180         if test "$ac_cv_enable_ldap" = yes; then
181                 AC_MSG_RESULT(yes)
182         else
183                 AC_MSG_RESULT(no)
184         fi
185 else
186         AC_MSG_RESULT(no)
187 fi
188
189 dnl Check for libjconv
190 AC_ARG_ENABLE(jconv,
191         [  --disable-jconv         Do not use libjconv],
192         [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
193 if test "$ac_cv_disable_jconv" = no; then
194         AC_CHECK_LIB(jconv, jconv_alloc_conv)
195 fi
196
197 AC_CHECK_LIB(xpg4, setlocale)
198 dnl AC_CHECK_LIB(kcc, KCC_filter)
199
200 dnl for GThread support
201 dnl AC_ARG_ENABLE(threads,
202 dnl     [  --enable-threads        Enable multithread support [default=no]],
203 dnl     [use_threads=$enableval], [use_threads=no])
204
205 AC_MSG_CHECKING([whether to use threads])
206 if test x"$use_threads" = xyes ; then
207         AC_MSG_RESULT(yes)
208         if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
209                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
210                 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
211                 AC_DEFINE(USE_THREADS)
212         else
213                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
214         fi
215 else
216         AC_MSG_RESULT(no)
217 fi
218
219 dnl check for IPv6 option
220 AC_ARG_ENABLE(ipv6,
221         [  --enable-ipv6           Enable IPv6 support [default=no]],
222         [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
223
224 dnl automated checks for IPv6 support.
225 if test x"$ac_cv_enableipv6" = xyes; then
226         AC_MSG_CHECKING([for IPv6 support])
227         AC_CACHE_VAL(ac_cv_ipv6,[
228                 AC_TRY_COMPILE([#define INET6
229                                 #include <sys/types.h>
230                                 #include <netinet/in.h>],
231                         [int x = IPPROTO_IPV6; struct in6_addr a;],
232                         ac_cv_ipv6=yes, ac_cv_ipv6=no)
233         ])
234         AC_MSG_RESULT($ac_cv_ipv6)
235         if test $ac_cv_ipv6 = yes; then
236                 AC_DEFINE(INET6)
237         fi
238 fi
239
240 dnl check if gdk / gtk was compiled with USE_XIM
241 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
242 CFLAGS_SAVE="$CFLAGS"
243 LDFLAGS_SAVE="$LDFLAGS"
244 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
245 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
246 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
247         AC_TRY_COMPILE([#include <gtk/gtk.h>
248                         #include <gdk/gdk.h>],
249                         [extern gint gdk_im_open(void); gdk_im_open();],
250                          ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
251         ])
252 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
253 if test $ac_cv_use_gtkgdk_xim = yes; then
254         AC_DEFINE(USE_GTKGDK_XIM)
255 fi
256 CFLAGS="$CFLAGS_SAVE"
257 LDFLAGS="$LDFLAGS_SAVE"
258
259
260 dnl Checks for header files.
261 AC_HEADER_DIRENT
262 AC_HEADER_STDC
263 AC_HEADER_SYS_WAIT
264 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
265                  sys/param.h sys/utsname.h \
266                  wchar.h wctype.h)
267
268 dnl Checks for typedefs, structures, and compiler characteristics.
269 AC_C_CONST
270 AC_TYPE_OFF_T
271 AC_TYPE_PID_T
272 AC_TYPE_SIZE_T
273 AC_STRUCT_TM
274
275 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
276 dnl may be defined only in wchar.h (this happens with gcc-2.96).
277 dnl So we need to use this extended macro.
278 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
279 [
280 #if HAVE_WCHAR_H
281 #include <wchar.h>
282 #endif
283 ])
284
285 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
286 AC_CHECK_SIZEOF(unsigned short, 2)
287 AC_CHECK_SIZEOF(unsigned int, 4)
288 AC_CHECK_SIZEOF(unsigned long, 4)
289
290 dnl Checks for library functions.
291 AC_FUNC_ALLOCA
292 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
293                wcsstr wcswcs iswalnum iswspace towlower \
294                wcslen wcscpy wcsncpy \
295                uname flock lockf inet_aton inet_addr \
296                fchmod mkstemp)
297
298 AC_OUTPUT([
299 Makefile
300 sylpheed.spec
301 intl/Makefile
302 ac/Makefile
303 po/Makefile.in
304 libkcc/Makefile
305 src/Makefile
306 manual/Makefile
307 manual/ja/Makefile
308 manual/en/Makefile
309 ])