Statistics
| Revision:

root / configure.in @ 2164

History | View | Annotate | Download (13.1 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=7
9
MICRO_VERSION=0
10
INTERFACE_AGE=0
11
BINARY_AGE=0
12
EXTRA_VERSION=beta6
13
BUILD_REVISION=0
14
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
15

    
16
DEVEL_VERSION=yes
17

    
18
dnl set $target
19
AC_CANONICAL_SYSTEM
20

    
21
dnl
22
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
23
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
24
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
25
AC_SUBST(PACKAGE)
26
AC_SUBST(VERSION)
27
AC_SUBST(MAJOR_VERSION)
28
AC_SUBST(MINOR_VERSION)
29
AC_SUBST(MICRO_VERSION)
30
AC_SUBST(EXTRA_VERSION)
31
AC_SUBST(BUILD_REVISION)
32

    
33
dnl development or release version
34
AC_SUBST(DEVEL_VERSION)
35
if test "x$DEVEL_VERSION" != "x"; then
36
  AC_DEFINE(DEVEL_VERSION, 1, [Define if this is a development release])
37
fi
38

    
39
dnl libtool versioning
40
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
41
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
42
LT_REVISION=$INTERFACE_AGE
43
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
44
AC_SUBST(LT_RELEASE)
45
AC_SUBST(LT_CURRENT)
46
AC_SUBST(LT_REVISION)
47
AC_SUBST(LT_AGE)
48

    
49
dnl Specify a header configuration file
50
AM_CONFIG_HEADER(config.h)
51

    
52
AM_MAINTAINER_MODE
53

    
54
dnl Checks for programs.
55
dnl AC_ARG_PROGRAM
56
AC_PROG_CC
57
AM_DISABLE_STATIC
58
AC_ISC_POSIX
59
AM_PROG_CC_STDC
60
AC_PROG_INSTALL
61
AC_PROG_LN_S
62
AC_PROG_MAKE_SET
63
AC_PROG_CPP
64
dnl AC_PROG_RANLIB
65
AM_PROG_LEX
66
AC_PROG_YACC
67
AM_PROG_LIBTOOL
68

    
69
SYLPHEED_ACLOCAL_INCLUDE(ac)
70

    
71
native_win32=no
72

    
73
case "$target" in
74
*-darwin*)
75
	CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
76
	;;
77
*-*-mingw*)
78
	native_win32=yes
79
	CFLAGS="$CFLAGS -mms-bitfields -mwindows"
80
	LIBS="$LIBS -lws2_32"
81
	AC_CHECK_PROG(WINDRES, windres, windres)
82
	;;
83
esac
84

    
85
AM_CONDITIONAL(NATIVE_WIN32, test "$native_win32" = "yes")
86

    
87
dnl Checks for libraries.
88
AM_PATH_GLIB_2_0(2.4.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.), gobject gmodule)
89

    
90
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
91

    
92
AM_PATH_GTK_2_0(2.4.0,, AC_MSG_ERROR(Test for Gtk failed. See the 'INSTALL' for help.))
93

    
94
dnl --disable-deprecated switch for GTK2 purification
95
AC_ARG_ENABLE(deprecated, [  --disable-deprecated    Disable deprecated GTK functions. ],
96
			  [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
97

    
98
AC_SUBST(GTK_CFLAGS)
99
AC_SUBST(GTK_LIBS)
100

    
101
dnl checks for iconv
102
AM_ICONV
103

    
104
AC_CHECK_FUNCS(bind_textdomain_codeset)
105

    
106
dnl for gettext
107
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"
108
GETTEXT_PACKAGE=sylpheed
109
AC_SUBST(GETTEXT_PACKAGE)
110
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
111

    
112
AM_GLIB_GNU_GETTEXT
113
dnl AM_GNU_GETTEXT
114
dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
115

    
116
if test "x$DATADIRNAME" != "x"; then
117
	localedir='${prefix}/${DATADIRNAME}/locale'
118
else
119
	localedir='${datadir}/locale'
120
fi
121
AC_ARG_WITH(localedir,
122
	[  --with-localedir=DIR    Locale directory],
123
	[localedir="$withval"])
124
AC_SUBST(localedir)
125

    
126
manualdir='${datadir}/${PACKAGE}/manual'
127
AC_ARG_WITH(manualdir,
128
	[  --with-manualdir=DIR    Manual directory],
129
	[manualdir="$withval"])
130
AC_SUBST(manualdir)
131

    
132
faqdir='${datadir}/${PACKAGE}/faq'
133
AC_ARG_WITH(faqdir,
134
	[  --with-faqdir=DIR       FAQ directory],
135
	[faqdir="$withval"])
136
AC_SUBST(faqdir)
137

    
138
plugindir='${exec_prefix}/lib/${PACKAGE}/plugins'
139
AC_ARG_WITH(plugindir,
140
	[  --with-plugindir=DIR    Plug-in directory],
141
	[plugindir="$withval"])
142
AC_SUBST(plugindir)
143

    
144
dnl GPGME is used to support OpenPGP 
145
AC_ARG_ENABLE(gpgme,
146
	[  --disable-gpgme         Disable GnuPG support using GPGME],
147
	[ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=yes])
148
AC_MSG_CHECKING([whether to use GPGME])
149
if test $ac_cv_enable_gpgme = yes; then
150
	AC_MSG_RESULT(yes)
151
	AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
152
		      [use_gpgme=no
153
		       ac_cv_enable_gpgme=no])
154
else
155
	AC_MSG_RESULT(no)
156
fi
157

    
158
dnl for JPilot support in addressbook
159
dnl no check for libraries; these are dynamically loaded
160
AC_ARG_ENABLE(jpilot,
161
	[  --enable-jpilot         Enable JPilot support [[default=no]]],
162
	[ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
163
AC_MSG_CHECKING([whether to use JPilot])
164
if test "$ac_cv_enable_jpilot" = yes; then
165
	AC_MSG_RESULT(yes)
166
	AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
167
			 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
168
			 [ ac_cv_enable_jpilot=no ])
169
	if test "$ac_cv_enable_jpilot" = no; then
170
		AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
171
				 [ ac_cv_enable_jpilot=yes
172
				   AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
173
	fi
174
	AC_MSG_CHECKING([whether jpilot is available])
175
	AC_MSG_RESULT($ac_cv_enable_jpilot)
176

    
177
	if test "$ac_cv_enable_jpilot" = yes; then
178
		LIBS="$LIBS -lpisock"
179
	fi
180
else
181
	AC_MSG_RESULT(no)
182
fi
183

    
184
dnl for LDAP support in addressbook
185
dnl no check for libraries; dynamically loaded
186
AC_ARG_ENABLE(ldap,
187
	[  --enable-ldap           Enable LDAP support [[default=no]]],
188
	[ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
189
AC_MSG_CHECKING([whether to use LDAP])
190
if test "$ac_cv_enable_ldap" = yes; then
191
	AC_MSG_RESULT(yes)
192

    
193
	dnl check for available libraries, and pull them in
194
	AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
195
	AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
196
	AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
197
	AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
198
		     $LDAP_LIBS)
199

    
200
	dnl we need libpthread for sylpheed ldap,  until we find
201
	dnl a better way to handle ldap requests asynchronously...
202
	AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
203

    
204
	AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
205
			 [ ac_cv_enable_ldap=yes ],
206
			 [ ac_cv_enable_ldap=no ])
207

    
208
	if test "$ac_cv_enable_ldap" = yes; then
209
		AC_CHECK_LIB(ldap, ldap_open,
210
			     [ ac_cv_enable_ldap=yes ],
211
			     [ ac_cv_enable_ldap=no ],
212
			     $LDAP_LIBS)
213
	fi
214

    
215
	AC_MSG_CHECKING([whether ldap library is available])
216
	AC_MSG_RESULT($ac_cv_enable_ldap)
217

    
218
	if test "$ac_cv_enable_ldap" = yes; then
219
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
220
		LDAP_LIBS="$LDAP_LIBS -lldap `$PKG_CONFIG --libs gthread-2.0`"
221
		AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
222
		AC_SUBST(LDAP_LIBS)
223
	fi
224
else
225
	AC_MSG_RESULT(no)
226
fi
227

    
228
dnl Check for OpenSSL
229
AC_ARG_ENABLE(ssl,
230
	[  --disable-ssl           Disable SSL support using OpenSSL],
231
	[ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes])
232
AC_MSG_CHECKING([whether to use OpenSSL])
233
if test $ac_cv_enable_ssl = yes; then
234
	AC_MSG_RESULT(yes)
235
	dnl First check with pkg-config
236
	PKG_CHECK_MODULES(OPENSSL, openssl, [:], [:])
237
	if test "x$OPENSSL_LIBS" != "x"; then
238
		CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
239
		LIBS="$LIBS $OPENSSL_LIBS"
240
		AC_MSG_CHECKING([if openssl is available])
241
		AC_MSG_RESULT(yes)
242
		AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.)
243
	else
244
		dnl If pkg-config fails, run compile/link test.
245
		AC_MSG_CHECKING([if openssl is available])
246
		ac_save_LIBS="$LIBS"
247
		if test "$native_win32" = yes; then
248
			LIBS="$LIBS -lssl32 -leay32"
249
		else
250
			LIBS="$LIBS -lssl -lcrypto"
251
		fi
252
		AC_TRY_LINK([
253
#include <openssl/opensslv.h>
254
],		[ return OPENSSL_VERSION_NUMBER; ],
255
		[ AC_MSG_RESULT(yes)
256
		  AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) ],
257
		[ AC_MSG_RESULT(no)
258
		  LIBS="$ac_save_LIBS"
259
		  ac_cv_enable_ssl=no ])
260
	fi
261
else
262
	AC_MSG_RESULT(no)
263
fi
264

    
265
dnl Check for X-Face support
266
AC_ARG_ENABLE(compface,
267
	[  --disable-compface      Do not use compface (X-Face)],
268
	[ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
269
if test "$ac_cv_enable_compface" = yes; then
270
	AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
271
fi
272

    
273
dnl Check for GtkSpell support
274
AC_MSG_CHECKING([whether to use GtkSpell])
275
AC_ARG_ENABLE(gtkspell,
276
	[  --disable-gtkspell      Do not use GtkSpell in editor],
277
	[ac_cv_enable_gtkspell=$enableval], [ac_cv_enable_gtkspell=yes])
278
if test "$ac_cv_enable_gtkspell" = yes; then
279
	AC_MSG_RESULT(yes)
280
	AC_MSG_CHECKING([whether GtkSpell is available])
281
	if $PKG_CONFIG gtkspell-2.0 ; then
282
		AC_MSG_RESULT(yes)
283
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtkspell-2.0`"
284
		LIBS="$LIBS `$PKG_CONFIG --libs gtkspell-2.0`"
285
		if $PKG_CONFIG --atleast-version 2.0.13 gtkspell-2.0 ; then
286
			AC_DEFINE(USE_ENCHANT, 1, Use Enchant with GtkSpell)
287
		elif $PKG_CONFIG --atleast-version 2.0.12 gtkspell-2.0 ; then
288
			LIBS="$LIBS -laspell"
289
		fi
290
		AC_DEFINE(USE_GTKSPELL, 1, Use GtkSpell in editor)
291
	else
292
		AC_MSG_RESULT(no)
293
		ac_cv_enable_gtkspell=no
294
	fi
295
else
296
	AC_MSG_RESULT(no)		
297
fi
298

    
299
dnl Check for Oniguruma support in message filtering
300
AC_ARG_ENABLE(oniguruma,
301
	[  --enable-oniguruma      Use Oniguruma instead of system's regex [[default=no]]],
302
	[ac_cv_enable_oniguruma=$enableval], [ac_cv_enable_oniguruma=no])
303
AC_MSG_CHECKING([whether to use Oniguruma])
304
if test "$ac_cv_enable_oniguruma" = yes; then
305
	AC_MSG_RESULT(yes)
306
	AC_MSG_CHECKING([whether Oniguruma is available])
307
        dnl AC_CHECK_PROG(ONIG_CONFIG, onig-config, onig-config)
308
	ONIG_CONFIG=onig-config
309
	ONIG_VERSION=`$ONIG_CONFIG --version 2>/dev/null`
310
	if test "x$ONIG_VERSION" != "x"; then
311
		AC_MSG_RESULT(yes)
312
		CFLAGS="$CFLAGS `$ONIG_CONFIG --cflags`"
313
		LIBS="$LIBS `$ONIG_CONFIG --libs`"
314
		AC_DEFINE(USE_ONIGURUMA, 1, Define if you want to use Oniguruma.)
315
	else
316
		AC_MSG_RESULT(no)
317
		ac_cv_enable_oniguruma=no
318
	fi
319
else
320
	AC_MSG_RESULT(no)
321
fi
322

    
323
dnl check additional libraries
324
AC_CHECK_LIB(xpg4, setlocale)
325
AC_CHECK_LIB(resolv, res_init)
326
AC_CHECK_LIB(socket, bind)
327
AC_CHECK_LIB(nsl, gethostbyname)
328

    
329
dnl for GThread support (currently disabled)
330
dnl AC_ARG_ENABLE(threads,
331
dnl	[  --enable-threads        Enable multithread support [[default=no]]],
332
dnl	[use_threads=$enableval], [use_threads=no])
333

    
334
AC_MSG_CHECKING([whether to use threads])
335
if test x"$use_threads" = xyes ; then
336
	AC_MSG_RESULT(yes)
337
	if test ! -z `$PKG_CONFIG --help 2>&1 |grep 'gthread-2.0'` ; then
338
		CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
339
		LIBS="$LIBS `$PKG_CONFIG --libs gthread-2.0`"
340
		AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
341
	else
342
		AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
343
	fi
344
else
345
	AC_MSG_RESULT(no)
346
fi
347

    
348
dnl check for IPv6 option
349
AC_ARG_ENABLE(ipv6,
350
	[  --disable-ipv6          Disable IPv6 support],
351
	[ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
352

    
353
dnl automated checks for IPv6 support.
354
AC_MSG_CHECKING([whether to use IPv6])
355
if test x"$ac_cv_enable_ipv6" = xyes; then
356
	AC_MSG_RESULT(yes)
357
	AC_MSG_CHECKING([for IPv6 support])
358
	if test "$native_win32" = yes; then
359
		AC_CACHE_VAL(ac_cv_ipv6,[
360
			AC_TRY_COMPILE([#define INET6
361
					#include <sys/types.h>
362
					#include <winsock2.h>
363
					#include <ws2tcpip.h>],
364
				[int x = IPPROTO_IPV6; struct in6_addr a;],
365
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
366
		])
367
	else
368
		AC_CACHE_VAL(ac_cv_ipv6,[
369
			AC_TRY_COMPILE([#define INET6
370
					#include <sys/types.h>
371
					#include <netinet/in.h>],
372
				[int x = IPPROTO_IPV6; struct in6_addr a;],
373
				ac_cv_ipv6=yes, ac_cv_ipv6=no)
374
		])
375
	fi
376
	AC_MSG_RESULT($ac_cv_ipv6)
377
	if test $ac_cv_ipv6 = yes; then
378
		AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
379
	else
380
		AC_MSG_WARN(*** IPv6 will not be supported ***)
381
		ac_cv_enable_ipv6=no
382
	fi
383
else
384
	AC_MSG_RESULT(no)
385
fi
386

    
387
dnl Check for d_type member in struct dirent
388
AC_MSG_CHECKING([whether struct dirent has d_type member])
389
AC_CACHE_VAL(ac_cv_dirent_d_type,[
390
	AC_TRY_COMPILE([#include <dirent.h>],
391
		       [struct dirent d; d.d_type = DT_REG;],
392
		       ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
393
])
394
AC_MSG_RESULT($ac_cv_dirent_d_type)
395
if test $ac_cv_dirent_d_type = yes; then
396
	AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
397
		  Define if `struct dirent' has `d_type' member.)
398
fi
399

    
400

    
401
dnl Checks for header files.
402
AC_HEADER_DIRENT
403
AC_HEADER_STDC
404
AC_HEADER_SYS_WAIT
405
AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
406
		 sys/param.h sys/utsname.h sys/select.h \
407
		 netdb.h regex.h sys/mman.h)
408

    
409
dnl Checks for typedefs, structures, and compiler characteristics.
410
AC_C_CONST
411
AC_TYPE_OFF_T
412
AC_TYPE_PID_T
413
AC_TYPE_SIZE_T
414
AC_STRUCT_TM
415

    
416
AC_SYS_LARGEFILE
417
AC_FUNC_FSEEKO
418

    
419
GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
420
AC_CHECK_SIZEOF(unsigned short, 2)
421
AC_CHECK_SIZEOF(unsigned int, 4)
422
AC_CHECK_SIZEOF(unsigned long, 4)
423

    
424
dnl Checks for library functions.
425
AC_FUNC_ALLOCA
426
AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
427
	       uname flock lockf inet_aton inet_addr \
428
	       fchmod truncate getuid regcomp mlock fsync)
429

    
430
AC_OUTPUT([
431
Makefile
432
sylpheed.spec
433
ac/Makefile
434
libsylph/Makefile
435
src/version.h
436
src/sylpheed.rc
437
src/Makefile
438
src/icons/Makefile
439
plugin/Makefile
440
plugin/test/Makefile
441
po/Makefile.in
442
faq/Makefile
443
faq/de/Makefile
444
faq/en/Makefile
445
faq/es/Makefile
446
faq/fr/Makefile
447
faq/it/Makefile
448
manual/Makefile
449
manual/en/Makefile
450
manual/ja/Makefile
451
])
452

    
453
dnl Output the configuration summary
454
echo ""
455
echo "$PACKAGE $VERSION"
456
echo ""
457
echo "GnuPG         : $ac_cv_enable_gpgme"
458
echo "JPilot        : $ac_cv_enable_jpilot"
459
echo "LDAP          : $ac_cv_enable_ldap"
460
echo "OpenSSL       : $ac_cv_enable_ssl"
461
echo "iconv         : $am_cv_func_iconv"
462
echo "compface      : $ac_cv_enable_compface"
463
echo "IPv6          : $ac_cv_enable_ipv6"
464
echo "GtkSpell      : $ac_cv_enable_gtkspell"
465
echo "Oniguruma     : $ac_cv_enable_oniguruma"
466
echo ""
467
echo "The binary will be installed in $prefix/bin"
468
echo ""
469
echo "Configure finished, type 'make' to build."