Statistics
| Revision:

root / configure.in @ 2601

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