add mini-icons to windows
[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=3
12 INTERFACE_AGE=0
13 BINARY_AGE=0
14 EXTRA_VERSION=claws6
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 pl 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 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.1, AC_DEFINE(USE_GPGME), [use_gpgme=no
109                                                     ac_cv_enable_gpgme=no])
110 else
111         AC_MSG_RESULT(no)
112 fi
113
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 else
131         AC_MSG_RESULT(no)
132 fi
133
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])
140 fi
141
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])
147
148 AC_MSG_CHECKING([whether to use jpilot])
149 if test "$ac_cv_enable_jpilot" = yes; then
150         AC_MSG_RESULT(yes)
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)
156                 fi
157         fi
158         AC_MSG_CHECKING(whether jpilot is available)
159         if test "$ac_cv_enable_jpilot" = yes; then
160                 AC_MSG_RESULT(yes)
161         else
162                 AC_MSG_RESULT(no)
163         fi
164 else
165         AC_MSG_RESULT(no)
166 fi
167
168 dnl for LDAP support in addressbook
169 dnl no check for libraries; dynamically loaded
170 AC_ARG_ENABLE(ldap,
171         [  --enable-ldap         Enable LDAP support [default=no]],
172         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
173
174 AC_MSG_CHECKING([whether to use ldap])
175 if test "$ac_cv_enable_ldap" = yes; then
176         AC_MSG_RESULT(yes)
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"
181                         AC_DEFINE(USE_LDAP)
182                 fi      
183         fi
184         AC_MSG_CHECKING(whether ldap is available)
185         if test "$ac_cv_enable_ldap" = yes; then
186                 AC_MSG_RESULT(yes)
187         else
188                 AC_MSG_RESULT(no)
189         fi
190 else
191         AC_MSG_RESULT(no)
192 fi
193
194 dnl get ispell path
195 dnl
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)
200 else
201         AC_DEFINE_UNQUOTED(ISPELL_PATH, "/usr/bin/ispell")
202         AC_SUBST(ISPELL_PATH)
203 fi
204
205 dnl Check for libjconv
206 AC_ARG_ENABLE(jconv,
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])
211 fi
212
213 AC_CHECK_LIB(xpg4, setlocale)
214 dnl AC_CHECK_LIB(kcc, KCC_filter)
215
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])
220
221 AC_MSG_CHECKING([whether to use threads])
222 if test x"$use_threads" = xyes ; then
223         AC_MSG_RESULT(yes)
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)
228         else
229                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
230         fi
231 else
232         AC_MSG_RESULT(no)
233 fi
234
235 dnl check for IPv6 option
236 AC_ARG_ENABLE(ipv6,
237         [  --enable-ipv6           Enable IPv6 support [default=no]],
238         [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
239
240 dnl automated checks for IPv6 support.
241 AC_MSG_CHECKING([whether to use IPv6])
242 if test x"$ac_cv_enableipv6" = xyes; then
243         AC_MSG_RESULT(yes)
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)
251         ])
252         AC_MSG_RESULT($ac_cv_ipv6)
253         if test $ac_cv_ipv6 = yes; then
254                 AC_DEFINE(INET6)
255         else
256                 AC_MSG_WARN(*** IPv6 will not be supported ***)
257                 ac_cv_enableipv6=no
258         fi
259 else
260         AC_MSG_RESULT(no)
261 fi
262
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)
274         ])
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)
278 fi
279 CFLAGS="$CFLAGS_SAVE"
280 LDFLAGS="$LDFLAGS_SAVE"
281
282
283 dnl Checks for header files.
284 AC_HEADER_DIRENT
285 AC_HEADER_STDC
286 AC_HEADER_SYS_WAIT
287 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
288                  sys/param.h sys/utsname.h \
289                  wchar.h wctype.h)
290
291 dnl Checks for typedefs, structures, and compiler characteristics.
292 AC_C_CONST
293 AC_TYPE_OFF_T
294 AC_TYPE_PID_T
295 AC_TYPE_SIZE_T
296 AC_STRUCT_TM
297
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,
302 [
303 #if HAVE_WCHAR_H
304 #include <wchar.h>
305 #endif
306 ])
307
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)
312
313 dnl Checks for library functions.
314 AC_FUNC_ALLOCA
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 \
319                fchmod mkstemp)
320
321 AC_OUTPUT([
322 Makefile
323 sylpheed.spec
324 intl/Makefile
325 ac/Makefile
326 po/Makefile.in
327 libkcc/Makefile
328 src/Makefile
329 manual/Makefile
330 manual/en/Makefile
331 manual/ja/Makefile
332 ])
333
334 dnl Output the configuration summary
335 echo ""
336 echo "$PACKAGE $VERSION"
337 echo ""
338 if test "$ac_cv_disable_gdk_pixbuf" = no; then
339         echo "gdk-pixbuf : yes"
340         echo "gdk_imlib  : no"
341 else
342         echo "gdk-pixbuf : no"
343         if test "$ac_cv_disable_imlib" = no; then
344                 echo "gdk_imlib  : yes"
345         else
346                 echo "gdk_imlib  : no"
347         fi
348 fi
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"
353 else
354         echo "compface   : no"
355 fi
356 if test "$ac_cv_disable_jconv" = no; then
357         echo "libjconv   : yes"
358 else
359         echo "libjconv   : no"
360 fi
361 echo "IPv6       : $ac_cv_enableipv6"
362 echo ""
363 echo "The binary will be installed in $prefix/bin"
364 echo ""
365 echo "Configure finished, type 'make' to build."