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