sync with sylpheed 0.4.99cvs2
[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=4
8 MICRO_VERSION=99
9 INTERFACE_AGE=99
10 BINARY_AGE=99
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 libtool versioning
28 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
29 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
30 LT_REVISION=$INTERFACE_AGE
31 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
32 AC_SUBST(LT_RELEASE)
33 AC_SUBST(LT_CURRENT)
34 AC_SUBST(LT_REVISION)
35 AC_SUBST(LT_AGE)
36
37 dnl Specify a header configuration file
38 AM_CONFIG_HEADER(config.h)
39
40 AM_PROG_LIBTOOL
41 AM_MAINTAINER_MODE
42
43 dnl Checks for programs.
44 AC_ARG_PROGRAM
45 AC_PROG_CC
46 AC_ISC_POSIX
47 AM_PROG_CC_STDC
48 AC_PROG_INSTALL
49 AC_PROG_LN_S
50 AC_PROG_MAKE_SET
51 AC_PROG_CPP
52 dnl AC_PROG_RANLIB
53
54 SYLPHEED_ACLOCAL_INCLUDE(ac)
55
56 dnl for gettext
57 ALL_LINGUAS="cs de el es fr it ja ko nl pt_BR ru zh_CN.GB2312 zh_TW.Big5"
58 AM_GNU_GETTEXT
59 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
60 localedir='${prefix}/${DATADIRNAME}/locale'
61 AC_SUBST(localedir)
62
63 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
64 AC_SUBST(manualdir)
65
66 dnl Checks for libraries.
67 AM_PATH_GLIB(1.2.6,,
68         AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
69         gthread)
70 AM_PATH_GTK(1.2.6,,
71         AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
72
73 dnl Check for built-in image view support
74 AC_ARG_ENABLE(gdk-pixbuf,
75         [  --disable-gdk-pixbuf    Do not use gdk-pixbuf],
76         [ac_cv_disable_gdk_pixbuf=disable], [ac_cv_disable_gdk_pixbuf=no])
77 AC_ARG_ENABLE(imlib,
78         [  --disable-imlib         Do not use imlib],
79         [ac_cv_disable_imlib=disable], [ac_cv_disable_imlib=no])
80
81 if test "$ac_cv_disable_gdk_pixbuf" = no; then
82         AM_PATH_GDK_PIXBUF(0.8.0,
83                 AC_DEFINE(HAVE_GDK_PIXBUF), [ac_cv_disable_gdk_pixbuf=disable])
84 fi
85 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = no; then
86         AM_PATH_GDK_IMLIB(1.9,
87                 AC_DEFINE(HAVE_GDK_IMLIB), [ac_cv_disable_imlib=disable])
88 fi
89 if test "$ac_cv_disable_gdk_pixbuf" = disable -a "$ac_cv_disable_imlib" = disable; then
90         AC_MSG_WARN(*** Built-in image view will not be supported ***)
91 fi
92
93 dnl GPGME is used to support OpenPGP 
94 AC_ARG_ENABLE(gpgme,
95         [  --enable-gpgme          Enable GnuPG support using GPGME [default=no]],
96         [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
97 if test $ac_cv_enable_gpgme = yes; then
98         AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
99 fi
100
101 dnl Check for X-Face support
102 AC_ARG_ENABLE(compface,
103         [  --disable-compface      Do not use compface (X-Face)],
104         [ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
105 if test "$ac_cv_disable_compface" = no; then
106         AC_CHECK_LIB(compface, uncompface)
107 fi
108
109 dnl Check for libjconv
110 AC_ARG_ENABLE(jconv,
111         [  --disable-jconv         Do not use libjconv],
112         [ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
113 if test "$ac_cv_disable_jconv" = no; then
114         AC_CHECK_LIB(jconv, jconv_alloc_conv)
115 fi
116
117 AC_CHECK_LIB(xpg4, setlocale)
118 dnl AC_CHECK_LIB(kcc, KCC_filter)
119
120 dnl for GThread support
121 AC_ARG_ENABLE(threads,
122         [  --enable-threads        Enable multithread support [default=no]],
123         [use_threads=$enableval], [use_threads=no])
124
125 AC_MSG_CHECKING([whether to use threads])
126 if test x"$use_threads" = xyes ; then
127         AC_MSG_RESULT(yes)
128         if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
129                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
130                 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
131                 AC_DEFINE(USE_THREADS)
132         else
133                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
134         fi
135 else
136         AC_MSG_RESULT(no)
137 fi
138
139 dnl check for IPv6 option
140 AC_ARG_ENABLE(ipv6,
141         [  --enable-ipv6           Enable IPv6 support [default=no]],
142         [ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
143
144 dnl automated checks for IPv6 support.
145 if test x"$ac_cv_enableipv6" = xyes; then
146         AC_MSG_CHECKING([for IPv6 support])
147         AC_CACHE_VAL(ac_cv_ipv6,[
148                 AC_TRY_COMPILE([#define INET6
149                                 #include <sys/types.h>
150                                 #include <netinet/in.h>],
151                         [int x = IPPROTO_IPV6; struct in6_addr a;],
152                         ac_cv_ipv6=yes, ac_cv_ipv6=no)
153         ])
154         AC_MSG_RESULT($ac_cv_ipv6)
155         if test $ac_cv_ipv6 = yes; then
156                 AC_DEFINE(INET6)
157         fi
158 fi
159
160 dnl check if gdk / gtk was compiled with USE_XIM
161 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
162 CFLAGS_SAVE="$CFLAGS"
163 LDFLAGS_SAVE="$LDFLAGS"
164 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags` `gtk-config --cflags`"
165 LDFLAGS="$LIBS `$GLIB_CONFIG --libs` `gtk-config --libs`"
166 AC_CACHE_VAL(ac_cv_use_gtkgdk_xim, [
167         AC_TRY_COMPILE([#include <gtk/gtk.h>
168                         #include <gdk/gdk.h>],
169                         [extern gint gdk_im_open(void); gdk_im_open();],
170                          ac_cv_use_gtkgdk_xim=yes, ac_cv_use_gtkgdk_xim=no)
171         ])
172 AC_MSG_RESULT($ac_cv_use_gtkgdk_xim)
173 if test $ac_cv_use_gtkgdk_xim = yes; then
174         AC_DEFINE(USE_GTKGDK_XIM)
175 fi
176 CFLAGS="$CFLAGS_SAVE"
177 LDFLAGS="$LDFLAGS_SAVE"
178
179
180 dnl Checks for header files.
181 AC_HEADER_DIRENT
182 AC_HEADER_STDC
183 AC_HEADER_SYS_WAIT
184 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
185                  sys/param.h sys/utsname.h \
186                  wchar.h wctype.h)
187
188
189 dnl Checks for typedefs, structures, and compiler characteristics.
190 AC_C_CONST
191 AC_TYPE_OFF_T
192 AC_TYPE_PID_T
193 AC_TYPE_SIZE_T
194 AC_STRUCT_TM
195
196 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
197 dnl may be defined only in wchar.h (this happens with gcc-2.96).
198 dnl So we need to use this extended macro.
199 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
200 [
201 #if HAVE_WCHAR_H
202 #include <wchar.h>
203 #endif
204 ])
205
206 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
207 AC_CHECK_SIZEOF(unsigned short, 2)
208 AC_CHECK_SIZEOF(unsigned int, 4)
209 AC_CHECK_SIZEOF(unsigned long, 4)
210
211 dnl Checks for library functions.
212 AC_FUNC_ALLOCA
213 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \
214                wcsstr wcswcs iswalnum iswspace towlower \
215                wcslen wcscpy wcsncpy \
216                uname flock lockf inet_aton inet_addr \
217                fchmod mkstemp)
218
219 AC_OUTPUT([
220 Makefile
221 sylpheed.spec
222 intl/Makefile
223 ac/Makefile
224 po/Makefile.in
225 libkcc/Makefile
226 src/Makefile
227 manual/Makefile
228 manual/ja/Makefile
229 ])