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