Statistics
| Revision:

root / configure.in @ 2066

History | View | Annotate | Download (12.6 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=6
9
MICRO_VERSION=0
10
INTERFACE_AGE=0
11
BINARY_AGE=0
12
EXTRA_VERSION=beta2
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
SYLPHEED_ACLOCAL_INCLUDE(ac)
60

    
61
native_win32=no
62

    
63
case "$target" in
64
*-darwin*)
65
	CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
66
	;;
67
*-*-mingw*)
68
	native_win32=yes
69
	CFLAGS="$CFLAGS -mms-bitfields -mwindows"
70
	LIBS="$LIBS -lws2_32"
71
	AC_CHECK_PROG(WINDRES, windres, windres)
72
	;;
73
esac
74

    
75
AM_CONDITIONAL(NATIVE_WIN32, test "$native_win32" = "yes")
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(1.0.0, 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
		if $PKG_CONFIG --atleast-version 2.0.13 gtkspell-2.0 ; then
270
			AC_DEFINE(USE_ENCHANT, 1, Use Enchant with GtkSpell)
271
		elif $PKG_CONFIG --atleast-version 2.0.12 gtkspell-2.0 ; then
272
			LIBS="$LIBS -laspell"
273
		fi
274
		AC_DEFINE(USE_GTKSPELL, 1, Use GtkSpell in editor)
275
	else
276
		AC_MSG_RESULT(no)
277
		ac_cv_enable_gtkspell=no
278
	fi
279
else
280
	AC_MSG_RESULT(no)		
281
fi
282

    
283
dnl Check for Oniguruma support in message filtering
284
AC_ARG_ENABLE(oniguruma,
285
	[  --enable-oniguruma      Use Oniguruma instead of system's regex [[default=no]]],
286
	[ac_cv_enable_oniguruma=$enableval], [ac_cv_enable_oniguruma=no])
287
AC_MSG_CHECKING([whether to use Oniguruma])
288
if test "$ac_cv_enable_oniguruma" = yes; then
289
	AC_MSG_RESULT(yes)
290
	AC_MSG_CHECKING([whether Oniguruma is available])
291
        dnl AC_CHECK_PROG(ONIG_CONFIG, onig-config, onig-config)
292
	ONIG_CONFIG=onig-config
293
	ONIG_VERSION=`$ONIG_CONFIG --version 2>/dev/null`
294
	if test "x$ONIG_VERSION" != "x"; then
295
		AC_MSG_RESULT(yes)
296
		CFLAGS="$CFLAGS `$ONIG_CONFIG --cflags`"
297
		LIBS="$LIBS `$ONIG_CONFIG --libs`"
298
		AC_DEFINE(USE_ONIGURUMA, 1, Define if you want to use Oniguruma.)
299
	else
300
		AC_MSG_RESULT(no)
301
		ac_cv_enable_oniguruma=no
302
	fi
303
else
304
	AC_MSG_RESULT(no)
305
fi
306

    
307
dnl check additional libraries
308
AC_CHECK_LIB(xpg4, setlocale)
309
AC_CHECK_LIB(resolv, res_init)
310
AC_CHECK_LIB(socket, bind)
311
AC_CHECK_LIB(nsl, gethostbyname)
312

    
313
dnl for GThread support (currently disabled)
314
dnl AC_ARG_ENABLE(threads,
315
dnl	[  --enable-threads        Enable multithread support [[default=no]]],
316
dnl	[use_threads=$enableval], [use_threads=no])
317

    
318
AC_MSG_CHECKING([whether to use threads])
319
if test x"$use_threads" = xyes ; then
320
	AC_MSG_RESULT(yes)
321
	if test ! -z `$PKG_CONFIG --help 2>&1 |grep 'gthread-2.0'` ; then
322
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
323
		LIBS="$LIBS `$PKG_CONFIG --libs gthread-2.0`"
324
		AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
325
	else
326
		AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
327
	fi
328
else
329
	AC_MSG_RESULT(no)
330
fi
331

    
332
dnl check for IPv6 option
333
AC_ARG_ENABLE(ipv6,
334
	[  --disable-ipv6          Disable IPv6 support],
335
	[ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
336

    
337
dnl automated checks for IPv6 support.
338
AC_MSG_CHECKING([whether to use IPv6])
339
if test x"$ac_cv_enable_ipv6" = xyes; then
340
	AC_MSG_RESULT(yes)
341
	AC_MSG_CHECKING([for IPv6 support])
342
	if test "$native_win32" = yes; then
343
		AC_CACHE_VAL(ac_cv_ipv6,[
344
			AC_TRY_COMPILE([#define INET6
345
					#include <sys/types.h>
346
					#include <winsock2.h>
347
					#include <ws2tcpip.h>],
348
				[int x = IPPROTO_IPV6; struct in6_addr a;],
349
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
350
		])
351
	else
352
		AC_CACHE_VAL(ac_cv_ipv6,[
353
			AC_TRY_COMPILE([#define INET6
354
					#include <sys/types.h>
355
					#include <netinet/in.h>],
356
				[int x = IPPROTO_IPV6; struct in6_addr a;],
357
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
358
		])
359
	fi
360
	AC_MSG_RESULT($ac_cv_ipv6)
361
	if test $ac_cv_ipv6 = yes; then
362
		AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
363
	else
364
		AC_MSG_WARN(*** IPv6 will not be supported ***)
365
		ac_cv_enable_ipv6=no
366
	fi
367
else
368
	AC_MSG_RESULT(no)
369
fi
370

    
371
dnl Check for d_type member in struct dirent
372
AC_MSG_CHECKING([whether struct dirent has d_type member])
373
AC_CACHE_VAL(ac_cv_dirent_d_type,[
374
	AC_TRY_COMPILE([#include <dirent.h>],
375
		       [struct dirent d; d.d_type = DT_REG;],
376
		       ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
377
])
378
AC_MSG_RESULT($ac_cv_dirent_d_type)
379
if test $ac_cv_dirent_d_type = yes; then
380
	AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
381
		  Define if `struct dirent' has `d_type' member.)
382
fi
383

    
384

    
385
dnl Checks for header files.
386
AC_HEADER_DIRENT
387
AC_HEADER_STDC
388
AC_HEADER_SYS_WAIT
389
AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
390
		 sys/param.h sys/utsname.h sys/select.h \
391
		 netdb.h regex.h sys/mman.h)
392

    
393
dnl Checks for typedefs, structures, and compiler characteristics.
394
AC_C_CONST
395
AC_TYPE_OFF_T
396
AC_TYPE_PID_T
397
AC_TYPE_SIZE_T
398
AC_STRUCT_TM
399

    
400
AC_SYS_LARGEFILE
401
AC_FUNC_FSEEKO
402

    
403
GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
404
AC_CHECK_SIZEOF(unsigned short, 2)
405
AC_CHECK_SIZEOF(unsigned int, 4)
406
AC_CHECK_SIZEOF(unsigned long, 4)
407

    
408
dnl Checks for library functions.
409
AC_FUNC_ALLOCA
410
AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
411
	       uname flock lockf inet_aton inet_addr \
412
	       fchmod truncate getuid regcomp mlock)
413

    
414
AC_OUTPUT([
415
Makefile
416
sylpheed.spec
417
ac/Makefile
418
libsylph/Makefile
419
src/version.h
420
src/sylpheed.rc
421
src/Makefile
422
src/icons/Makefile
423
po/Makefile.in
424
faq/Makefile
425
faq/de/Makefile
426
faq/en/Makefile
427
faq/es/Makefile
428
faq/fr/Makefile
429
faq/it/Makefile
430
manual/Makefile
431
manual/en/Makefile
432
manual/ja/Makefile
433
])
434

    
435
dnl Output the configuration summary
436
echo ""
437
echo "$PACKAGE $VERSION"
438
echo ""
439
echo "GnuPG         : $ac_cv_enable_gpgme"
440
echo "JPilot        : $ac_cv_enable_jpilot"
441
echo "LDAP          : $ac_cv_enable_ldap"
442
echo "OpenSSL       : $ac_cv_enable_ssl"
443
echo "iconv         : $am_cv_func_iconv"
444
echo "compface      : $ac_cv_enable_compface"
445
echo "IPv6          : $ac_cv_enable_ipv6"
446
echo "GtkSpell      : $ac_cv_enable_gtkspell"
447
echo "Oniguruma     : $ac_cv_enable_oniguruma"
448
echo ""
449
echo "The binary will be installed in $prefix/bin"
450
echo ""
451
echo "Configure finished, type 'make' to build."