Statistics
| Revision:

root / configure.in @ 1650

History | View | Annotate | Download (12.4 kB)

1
dnl Process this file with autoconf to produce a configure script.
2
AC_PREREQ(2.50)
3
AC_INIT(src/main.c)
4
PACKAGE=sylpheed
5
6
dnl version number
7
MAJOR_VERSION=2
8
MINOR_VERSION=4
9
MICRO_VERSION=0
10
INTERFACE_AGE=0
11
BINARY_AGE=0
12
EXTRA_VERSION=rc
13
BUILD_REVISION=0
14
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
15
16
dnl set $target
17
AC_CANONICAL_SYSTEM
18
19
dnl
20
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
21
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
22
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
23
AC_SUBST(PACKAGE)
24
AC_SUBST(VERSION)
25
AC_SUBST(MAJOR_VERSION)
26
AC_SUBST(MINOR_VERSION)
27
AC_SUBST(MICRO_VERSION)
28
AC_SUBST(BUILD_REVISION)
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_MAINTAINER_MODE
44
45
dnl Checks for programs.
46
dnl AC_ARG_PROGRAM
47
AC_PROG_CC
48
AC_ISC_POSIX
49
AM_PROG_CC_STDC
50
AC_PROG_INSTALL
51
AC_PROG_LN_S
52
AC_PROG_MAKE_SET
53
AC_PROG_CPP
54
dnl AC_PROG_RANLIB
55
AM_PROG_LEX
56
AC_PROG_YACC
57
AM_PROG_LIBTOOL
58
59
AC_CHECK_PROG(WINDRES, windres, windres)
60
AM_CONDITIONAL(HAVE_WINDRES, test x"$WINDRES" != x)
61
62
SYLPHEED_ACLOCAL_INCLUDE(ac)
63
64
native_win32=no
65
66
case "$target" in
67
*-darwin*)
68
	CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
69
	;;
70
*-*-mingw*)
71
	native_win32=yes
72
	CFLAGS="$CFLAGS -mms-bitfields -mwindows"
73
	LIBS="$LIBS -lws2_32"
74
	;;
75
esac
76
77
dnl Checks for libraries.
78
AM_PATH_GLIB_2_0(2.4.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.))
79
80
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
81
82
AM_PATH_GTK_2_0(2.4.0,, AC_MSG_ERROR(Test for Gtk failed. See the 'INSTALL' for help.))
83
84
dnl --disable-deprecated switch for GTK2 purification
85
AC_ARG_ENABLE(deprecated, [  --disable-deprecated    Disable deprecated GTK functions. ],
86
			  [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
87
88
AC_SUBST(GTK_CFLAGS)
89
AC_SUBST(GTK_LIBS)
90
91
dnl checks for iconv
92
AM_ICONV
93
94
AC_CHECK_FUNCS(bind_textdomain_codeset)
95
96
dnl for gettext
97
ALL_LINGUAS="be bg cs da de el es et fr gl hr hu it ja ko lt nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW"
98
GETTEXT_PACKAGE=sylpheed
99
AC_SUBST(GETTEXT_PACKAGE)
100
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
101
102
AM_GLIB_GNU_GETTEXT
103
dnl AM_GNU_GETTEXT
104
dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
105
106
if test "x$DATADIRNAME" != "x"; then
107
	localedir='${prefix}/${DATADIRNAME}/locale'
108
else
109
	localedir='${datadir}/locale'
110
fi
111
AC_ARG_WITH(localedir,
112
	[  --with-localedir=DIR    Locale directory],
113
	[localedir="$withval"])
114
AC_SUBST(localedir)
115
116
manualdir='${datadir}/${PACKAGE}/manual'
117
AC_ARG_WITH(manualdir,
118
	[  --with-manualdir=DIR    Manual directory],
119
	[manualdir="$withval"])
120
AC_SUBST(manualdir)
121
122
faqdir='${datadir}/${PACKAGE}/faq'
123
AC_ARG_WITH(faqdir,
124
	[  --with-faqdir=DIR       FAQ directory],
125
	[faqdir="$withval"])
126
AC_SUBST(faqdir)
127
128
dnl GPGME is used to support OpenPGP 
129
AC_ARG_ENABLE(gpgme,
130
	[  --disable-gpgme         Disable GnuPG support using GPGME],
131
	[ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=yes])
132
AC_MSG_CHECKING([whether to use GPGME])
133
if test $ac_cv_enable_gpgme = yes; then
134
	AC_MSG_RESULT(yes)
135
	AM_PATH_GPGME(0.4.5, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
136
		      [use_gpgme=no
137
		       ac_cv_enable_gpgme=no])
138
else
139
	AC_MSG_RESULT(no)
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
AC_MSG_CHECKING([whether to use JPilot])
148
if test "$ac_cv_enable_jpilot" = yes; then
149
	AC_MSG_RESULT(yes)
150
	AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
151
			 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
152
			 [ ac_cv_enable_jpilot=no ])
153
	if test "$ac_cv_enable_jpilot" = no; then
154
		AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
155
				 [ ac_cv_enable_jpilot=yes
156
				   AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
157
	fi
158
	AC_MSG_CHECKING([whether jpilot is available])
159
	AC_MSG_RESULT($ac_cv_enable_jpilot)
160
161
	if test "$ac_cv_enable_jpilot" = yes; then
162
		LIBS="$LIBS -lpisock"
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
AC_MSG_CHECKING([whether to use LDAP])
174
if test "$ac_cv_enable_ldap" = yes; then
175
	AC_MSG_RESULT(yes)
176
177
	dnl check for available libraries, and pull them in
178
	AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
179
	AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
180
	AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
181
	AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
182
		     $LDAP_LIBS)
183
184
	dnl we need libpthread for sylpheed ldap,  until we find
185
	dnl a better way to handle ldap requests asynchronously...
186
	AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
187
188
	AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
189
			 [ ac_cv_enable_ldap=yes ],
190
			 [ ac_cv_enable_ldap=no ])
191
192
	if test "$ac_cv_enable_ldap" = yes; then
193
		AC_CHECK_LIB(ldap, ldap_open,
194
			     [ ac_cv_enable_ldap=yes ],
195
			     [ ac_cv_enable_ldap=no ],
196
			     $LDAP_LIBS)
197
	fi
198
199
	AC_MSG_CHECKING([whether ldap library is available])
200
	AC_MSG_RESULT($ac_cv_enable_ldap)
201
202
	if test "$ac_cv_enable_ldap" = yes; then
203
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
204
		LDAP_LIBS="$LDAP_LIBS -lldap `$PKG_CONFIG --libs gthread-2.0`"
205
		AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
206
		AC_SUBST(LDAP_LIBS)
207
	fi
208
else
209
	AC_MSG_RESULT(no)
210
fi
211
212
dnl Check for OpenSSL
213
AC_ARG_ENABLE(ssl,
214
	[  --disable-ssl           Disable SSL support using OpenSSL],
215
	[ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes])
216
AC_MSG_CHECKING([whether to use OpenSSL])
217
if test $ac_cv_enable_ssl = yes; then
218
	AC_MSG_RESULT(yes)
219
	dnl First check with pkg-config
220
	PKG_CHECK_MODULES(OPENSSL, openssl, [:], [:])
221
	if test "x$OPENSSL_LIBS" != "x"; then
222
		CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
223
		LIBS="$LIBS $OPENSSL_LIBS"
224
		AC_MSG_CHECKING([if openssl is available])
225
		AC_MSG_RESULT(yes)
226
		AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.)
227
	else
228
		dnl If pkg-config fails, run compile/link test.
229
		AC_MSG_CHECKING([if openssl is available])
230
		ac_save_LIBS="$LIBS"
231
		if test "$native_win32" = yes; then
232
			LIBS="$LIBS -lssl32 -leay32"
233
		else
234
			LIBS="$LIBS -lssl -lcrypto"
235
		fi
236
		AC_TRY_LINK([
237
#include <openssl/opensslv.h>
238
],		[ return OPENSSL_VERSION_NUMBER; ],
239
		[ AC_MSG_RESULT(yes)
240
		  AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) ],
241
		[ AC_MSG_RESULT(no)
242
		  LIBS="$ac_save_LIBS"
243
		  ac_cv_enable_ssl=no ])
244
	fi
245
else
246
	AC_MSG_RESULT(no)
247
fi
248
249
dnl Check for X-Face support
250
AC_ARG_ENABLE(compface,
251
	[  --disable-compface      Do not use compface (X-Face)],
252
	[ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
253
if test "$ac_cv_enable_compface" = yes; then
254
	AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
255
fi
256
257
dnl Check for GtkSpell support
258
AC_MSG_CHECKING([whether to use GtkSpell])
259
AC_ARG_ENABLE(gtkspell,
260
	[  --disable-gtkspell      Do not use GtkSpell in editor],
261
	[ac_cv_enable_gtkspell=$enableval], [ac_cv_enable_gtkspell=yes])
262
if test "$ac_cv_enable_gtkspell" = yes; then
263
	AC_MSG_RESULT(yes)
264
	AC_MSG_CHECKING([whether GtkSpell is available])
265
	if $PKG_CONFIG gtkspell-2.0 ; then
266
		AC_MSG_RESULT(yes)
267
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtkspell-2.0`"
268
		LIBS="$LIBS `$PKG_CONFIG --libs gtkspell-2.0`"
269
		AC_DEFINE(USE_GTKSPELL, 1, Use GtkSpell in editor)
270
	else
271
		AC_MSG_RESULT(no)
272
		ac_cv_enable_gtkspell=no
273
	fi
274
else
275
	AC_MSG_RESULT(no)		
276
fi
277
278
dnl Check for Oniguruma support in message filtering
279
AC_ARG_ENABLE(oniguruma,
280
	[  --enable-oniguruma      Use Oniguruma instead of system's regex [[default=no]]],
281
	[ac_cv_enable_oniguruma=$enableval], [ac_cv_enable_oniguruma=no])
282
AC_MSG_CHECKING([whether to use Oniguruma])
283
if test "$ac_cv_enable_oniguruma" = yes; then
284
	AC_MSG_RESULT(yes)
285
	AC_MSG_CHECKING([whether Oniguruma is available])
286
        dnl AC_CHECK_PROG(ONIG_CONFIG, onig-config, onig-config)
287
	ONIG_CONFIG=onig-config
288
	ONIG_VERSION=`$ONIG_CONFIG --version 2>/dev/null`
289
	if test "x$ONIG_VERSION" != "x"; then
290
		AC_MSG_RESULT(yes)
291
		CFLAGS="$CFLAGS `$ONIG_CONFIG --cflags`"
292
		LIBS="$LIBS `$ONIG_CONFIG --libs`"
293
		AC_DEFINE(USE_ONIGURUMA, 1, Define if you want to use Oniguruma.)
294
	else
295
		AC_MSG_RESULT(no)
296
		ac_cv_enable_oniguruma=no
297
	fi
298
else
299
	AC_MSG_RESULT(no)
300
fi
301
302
dnl check additional libraries
303
AC_CHECK_LIB(xpg4, setlocale)
304
AC_CHECK_LIB(resolv, res_init)
305
AC_CHECK_LIB(socket, bind)
306
AC_CHECK_LIB(nsl, gethostbyname)
307
308
dnl for GThread support (currently disabled)
309
dnl AC_ARG_ENABLE(threads,
310
dnl	[  --enable-threads        Enable multithread support [[default=no]]],
311
dnl	[use_threads=$enableval], [use_threads=no])
312
313
AC_MSG_CHECKING([whether to use threads])
314
if test x"$use_threads" = xyes ; then
315
	AC_MSG_RESULT(yes)
316
	if test ! -z `$PKG_CONFIG --help 2>&1 |grep 'gthread-2.0'` ; then
317
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
318
		LIBS="$LIBS `$PKG_CONFIG --libs gthread-2.0`"
319
		AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
320
	else
321
		AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
322
	fi
323
else
324
	AC_MSG_RESULT(no)
325
fi
326
327
dnl check for IPv6 option
328
AC_ARG_ENABLE(ipv6,
329
	[  --disable-ipv6          Disable IPv6 support],
330
	[ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
331
332
dnl automated checks for IPv6 support.
333
AC_MSG_CHECKING([whether to use IPv6])
334
if test x"$ac_cv_enable_ipv6" = xyes; then
335
	AC_MSG_RESULT(yes)
336
	AC_MSG_CHECKING([for IPv6 support])
337
	if test "$native_win32" = yes; then
338
		AC_CACHE_VAL(ac_cv_ipv6,[
339
			AC_TRY_COMPILE([#define INET6
340
					#include <sys/types.h>
341
					#include <winsock2.h>
342
					#include <ws2tcpip.h>],
343
				[int x = IPPROTO_IPV6; struct in6_addr a;],
344
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
345
		])
346
	else
347
		AC_CACHE_VAL(ac_cv_ipv6,[
348
			AC_TRY_COMPILE([#define INET6
349
					#include <sys/types.h>
350
					#include <netinet/in.h>],
351
				[int x = IPPROTO_IPV6; struct in6_addr a;],
352
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
353
		])
354
	fi
355
	AC_MSG_RESULT($ac_cv_ipv6)
356
	if test $ac_cv_ipv6 = yes; then
357
		AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
358
	else
359
		AC_MSG_WARN(*** IPv6 will not be supported ***)
360
		ac_cv_enable_ipv6=no
361
	fi
362
else
363
	AC_MSG_RESULT(no)
364
fi
365
366
dnl Check for d_type member in struct dirent
367
AC_MSG_CHECKING([whether struct dirent has d_type member])
368
AC_CACHE_VAL(ac_cv_dirent_d_type,[
369
	AC_TRY_COMPILE([#include <dirent.h>],
370
		       [struct dirent d; d.d_type = DT_REG;],
371
		       ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
372
])
373
AC_MSG_RESULT($ac_cv_dirent_d_type)
374
if test $ac_cv_dirent_d_type = yes; then
375
	AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
376
		  Define if `struct dirent' has `d_type' member.)
377
fi
378
379
380
dnl Checks for header files.
381
AC_HEADER_DIRENT
382
AC_HEADER_STDC
383
AC_HEADER_SYS_WAIT
384
AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
385
		 sys/param.h sys/utsname.h sys/select.h \
386
		 netdb.h regex.h sys/mman.h)
387
388
dnl Checks for typedefs, structures, and compiler characteristics.
389
AC_C_CONST
390
AC_TYPE_OFF_T
391
AC_TYPE_PID_T
392
AC_TYPE_SIZE_T
393
AC_STRUCT_TM
394
395
AC_SYS_LARGEFILE
396
AC_FUNC_FSEEKO
397
398
GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
399
AC_CHECK_SIZEOF(unsigned short, 2)
400
AC_CHECK_SIZEOF(unsigned int, 4)
401
AC_CHECK_SIZEOF(unsigned long, 4)
402
403
dnl Checks for library functions.
404
AC_FUNC_ALLOCA
405
AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
406
	       uname flock lockf inet_aton inet_addr \
407
	       fchmod truncate getuid regcomp mlock)
408
409
AC_OUTPUT([
410
Makefile
411
sylpheed.spec
412
ac/Makefile
413
libsylph/Makefile
414
src/version.h
415
src/sylpheed.rc
416
src/Makefile
417
src/icons/Makefile
418
po/Makefile.in
419
faq/Makefile
420
faq/de/Makefile
421
faq/en/Makefile
422
faq/es/Makefile
423
faq/fr/Makefile
424
faq/it/Makefile
425
manual/Makefile
426
manual/en/Makefile
427
manual/ja/Makefile
428
])
429
430
dnl Output the configuration summary
431
echo ""
432
echo "$PACKAGE $VERSION"
433
echo ""
434
echo "GnuPG         : $ac_cv_enable_gpgme"
435
echo "JPilot        : $ac_cv_enable_jpilot"
436
echo "LDAP          : $ac_cv_enable_ldap"
437
echo "OpenSSL       : $ac_cv_enable_ssl"
438
echo "iconv         : $am_cv_func_iconv"
439
echo "compface      : $ac_cv_enable_compface"
440
echo "IPv6          : $ac_cv_enable_ipv6"
441
echo "GtkSpell      : $ac_cv_enable_gtkspell"
442
echo "Oniguruma     : $ac_cv_enable_oniguruma"
443
echo ""
444
echo "The binary will be installed in $prefix/bin"
445
echo ""
446
echo "Configure finished, type 'make' to build."