1
# ---------------------------------------------------------------------
3
# ---------------------------------------------------------------------
5
AC_INIT(sword, 1.5.7, sword-bugs@crosswire.org)
6
AC_CONFIG_SRCDIR(sword.bmp)
8
AC_REVISION($Revision: 1.31 $)
11
AM_INIT_AUTOMAKE(sword, 1.5.7)
13
AM_CONFIG_HEADER(config.h)
16
# ---------------------------------------------------------------------
18
# ---------------------------------------------------------------------
28
# ---------------------------------------------------------------------
30
# ---------------------------------------------------------------------
31
AC_ARG_WITH(zlib,[ --with-zlib allow zlib compressed modules [default=yes]],,with_zlib=yes)
32
AC_ARG_WITH(icu,[ --with-icu use ICU for unicode [default=no]],,with_icu=no)
33
AC_ARG_WITH(conf,[ --with-conf install a new sword.conf [default=yes]],,with_conf=yes)
34
AC_ARG_WITH(curl,[ --with-curl build install manager support using libcurl [default=yes]],,with_curl=yes)
35
AC_ARG_WITH(lucene,[ --with-lucene include lucene support for searching [default=yes]],,with_lucene=yes)
38
# ---------------------------------------------------------------------
40
# ---------------------------------------------------------------------
41
AC_ARG_ENABLE(debug,[ --enable-debug build debug library [default=no]],,enable_debug=no)
42
AC_ARG_ENABLE(profile,[ --enable-profile allow profiling [default=no]],,enable_profile=no)
43
AC_ARG_ENABLE(profilefn,[ --enable-profilefn allow functioncheck profiling [default=no]],,enable_profilefn=no)
44
AC_ARG_ENABLE(tests,[ --enable-tests build test programs [default=no]],,enable_tests=no)
45
AC_ARG_ENABLE(utilities,[ --enable-utilities build utilities [default=yes]],,enable_utilities=yes)
46
AC_ARG_ENABLE(examples,[ --enable-examples build examples [default=no]],,enable_examples=no)
49
# ---------------------------------------------------------------------
51
# ---------------------------------------------------------------------
52
if test x$with_zlib = xyes; then
53
AC_CHECK_LIB(z, compress)
56
# ---------------------------------------------------------------------
58
# ---------------------------------------------------------------------
60
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
61
if test x$PKG_CONFIG = xno ; then
62
AC_MSG_WARN([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
63
AC_MSG_WARN([not using pkg-config])
67
if $PKG_CONFIG --atleast-pkgconfig-version 0.14 ; then
70
AC_MSG_WARN([*** pkg-config too old; version 0.14 or better required.])
71
AC_MSG_WARN([not using pkg-config])
76
# ---------------------------------------------------------------------
78
# ---------------------------------------------------------------------
82
if test x$with_icu = xyes; then
83
AC_PATH_PROG([PKGDATA], [pkgdata],[/usr/sbin/pkgdata],[$PATH:/usr/sbin:.])
84
AC_PATH_PROG([GENCCODE], [genccode], [/usr/sbin/genccode], [$PATH:/usr/sbin:.])
85
AC_PATH_PROG([GENCMN], [gencmn], [/usr/sbin/gencmn], [$PATH:/usr/sbin:.])
86
AC_PATH_PROG([GENRB], [genrb], [/usr/sbin/genrb], [$PATH:/usr/sbin:.])
88
AC_PATH_PROG(ICU_CONFIG, icu-config, no)
89
# The icu-config script was new in icu 2.2
90
if test "$ICU_CONFIG" = "no" ; then
91
echo "*** The icu-config script installed by icu could not be found"
92
echo "*** continuing anyway and assuming 2.1 or earlier"
94
ICU_LIBS="-licui18n -licuuc -licudata"
97
ICU_VER=`$ICU_CONFIG --version`
98
ICU_LIBS=`$ICU_CONFIG --ldflags`
99
ICU_IOLIBS=`$ICU_CONFIG --ldflags-ustdio`
103
# ---------------------------------------------------------------------
105
# ---------------------------------------------------------------------
107
CXXFLAGS="$CXXFLAGS -ftemplate-depth-25"
109
if test x$enable_debug = xyes; then
110
if test x$ac_cv_prog_cc_g = xyes; then
115
if test x$ac_cv_prog_cxx_g = xyes; then
120
CFLAGS="$CFLAGS -Werror"
121
CXXFLAGS="$CXXFLAGS -Werror"
128
if test x$enable_profile = xyes; then
130
CXXFLAGS="$CXXFLAGS -pg"
132
if test x$enable_profilefn = xyes; then
133
CFLAGS="$CFLAGS -g -finstrument-functions"
134
CXXFLAGS="$CXXFLAGS -g -finstrument-functions"
135
LIBS="$LIBS -g -finstrument-functions -lfnccheck"
138
# ---------------------------------------------------------------------
139
# Check for curl for installmgr suport
140
# ---------------------------------------------------------------------
144
if test x$with_curl = xyes; then
145
AC_PATH_PROG(CURL_CONFIG, curl-config, no)
146
if test "$CURL_CONFIG" = "no" ; then
147
echo "*** The curl-config script installed by curl could not be found"
148
echo "*** compiling without libcurl support"
151
echo "curl found - remote install options available"
152
CURL_CFLAGS=`$CURL_CONFIG --cflags`
153
CURL_LIBS=`$CURL_CONFIG --libs`
154
CXXFLAGS="$CXXFLAGS -DCURLAVAILABLE"
155
CFLAGS="$CFLAGS -DCURLAVAILABLE"
159
# ---------------------------------------------------------------------
160
# Check for clucene for lucene searching support
161
# ---------------------------------------------------------------------
163
#FIXME: always make lucene available without checking for lib and headers
164
if test x$with_lucene = xyes; then
165
echo "lucene found - lucene searching options available"
167
LUCENE_LIBS="-lclucene"
168
CXXFLAGS="$CXXFLAGS -DUSELUCENE"
169
CFLAGS="$CFLAGS -DUSELUCENE"
170
LIBS="$LIBS $LUCENE_LIBS"
173
# ---------------------------------------------------------------------
174
# Alter global conf directory only if not /etc
175
# ---------------------------------------------------------------------
177
if test "x$sysconfdir" = "x/etc"; then
184
# ---------------------------------------------------------------------
185
# Determine target system (obsolete?)
186
# ---------------------------------------------------------------------
187
case "$target_cpu" in
189
target_system="intel"
194
target_system="sparc_solaris"
197
target_system="gnu_bigendian"
202
target_system="$target_cpu"
211
target_system="$target_system"
224
# ---------------------------------------------------------------------
225
# Substitute variables into makefiles
226
# ---------------------------------------------------------------------
230
AC_SUBST(dir_confdef)
232
AC_SUBST(CURL_CFLAGS)
234
AC_SUBST(LUCENE_LIBS)
238
AC_SUBST(enable_debug)
239
AC_SUBST(enable_profile)
242
AC_SUBST(target_vendor)
245
AC_SUBST(target_system)
246
AC_SUBST(target_mingw32)
250
# ---------------------------------------------------------------------
251
# Conditional variables
252
# ---------------------------------------------------------------------
253
AM_CONDITIONAL(MINGW, test x$target_mingw32 = xyes)
254
AM_CONDITIONAL(ICU, test x$with_icu = xyes)
255
AM_CONDITIONAL(USELUCENE, test x$with_lucene = xyes)
256
AM_CONDITIONAL(ICUSWORD, test x$with_icu = xsword)
257
AM_CONDITIONAL(ZLIB, test x$with_zlib = xyes)
258
AM_CONDITIONAL(INSTCONF, test x$with_conf = xyes)
259
AM_CONDITIONAL(INSTALLMGR, test x$with_curl = xyes)
260
AM_CONDITIONAL(USELUCENE, test x$with_lucene = xyes)
261
AM_CONDITIONAL(CONFDEF, test x$dir_confdef = xyes)
262
AM_CONDITIONAL(USE_PKGCONF, test x$use_pkgconfig = xyes)
263
#AM_CONDITIONAL(DEBUG, test x$with_debug = xyes)
264
#AM_CONDITIONAL(PROFILE, test x$with_profile = xyes)
265
AM_CONDITIONAL(BUILDTESTS, test x$enable_tests = xyes)
266
AM_CONDITIONAL(BUILDUTILS, test x$enable_utilities = xyes)
267
AM_CONDITIONAL(BUILDEXAMPLES, test x$enable_examples = xyes)
269
# ---------------------------------------------------------------------
271
# ---------------------------------------------------------------------
272
AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile utilities/Makefile examples/Makefile \
273
examples/cmdline/Makefile \
274
utilities/diatheke/Makefile icu/Makefile sword.pc)