~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ---------------------------------------------------------------------
 
2
# Initialisation
 
3
# ---------------------------------------------------------------------
 
4
 
 
5
AC_INIT(sword, 1.5.7, sword-bugs@crosswire.org)
 
6
AC_CONFIG_SRCDIR(sword.bmp)
 
7
AC_PREREQ(2.52)
 
8
AC_REVISION($Revision: 1.31 $)
 
9
 
 
10
AC_CANONICAL_TARGET
 
11
AM_INIT_AUTOMAKE(sword, 1.5.7)
 
12
 
 
13
AM_CONFIG_HEADER(config.h)
 
14
 
 
15
 
 
16
# ---------------------------------------------------------------------
 
17
# Check Programs
 
18
# ---------------------------------------------------------------------
 
19
AC_LANG(C++)
 
20
AC_PROG_CC
 
21
AC_PROG_CXX
 
22
AC_PROG_INSTALL
 
23
AC_LIBTOOL_WIN32_DLL
 
24
AC_PROG_LIBTOOL
 
25
 
 
26
AC_C_BIGENDIAN
 
27
 
 
28
# ---------------------------------------------------------------------
 
29
# With options
 
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)
 
36
 
 
37
 
 
38
# ---------------------------------------------------------------------
 
39
# Enable options
 
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)
 
47
AM_MAINTAINER_MODE
 
48
 
 
49
# ---------------------------------------------------------------------
 
50
# Check libraries
 
51
# ---------------------------------------------------------------------
 
52
if test x$with_zlib  = xyes; then
 
53
        AC_CHECK_LIB(z, compress)
 
54
fi
 
55
 
 
56
# ---------------------------------------------------------------------
 
57
# Find pkg-config
 
58
# ---------------------------------------------------------------------
 
59
use_pkgconfig=yes
 
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])
 
64
  use_pkgconfig=no
 
65
fi
 
66
 
 
67
if $PKG_CONFIG --atleast-pkgconfig-version 0.14 ; then
 
68
  :
 
69
else
 
70
  AC_MSG_WARN([*** pkg-config too old; version 0.14 or better required.])
 
71
  AC_MSG_WARN([not using pkg-config])
 
72
  use_pkgconfig=no
 
73
fi
 
74
 
 
75
 
 
76
# ---------------------------------------------------------------------
 
77
# Find ICU tools
 
78
# ---------------------------------------------------------------------
 
79
ICU_VER=
 
80
ICU_LIBS=
 
81
ICU_IOLIBS=
 
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:.])
 
87
        
 
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"
 
93
           ICU_VER="2.1"
 
94
           ICU_LIBS="-licui18n -licuuc -licudata"
 
95
           ICU_IOLIBS="-lustdio"
 
96
        else
 
97
           ICU_VER=`$ICU_CONFIG --version`
 
98
           ICU_LIBS=`$ICU_CONFIG --ldflags`
 
99
           ICU_IOLIBS=`$ICU_CONFIG --ldflags-ustdio`
 
100
        fi
 
101
fi
 
102
 
 
103
# ---------------------------------------------------------------------
 
104
# Debug and profile
 
105
# ---------------------------------------------------------------------
 
106
 
 
107
CXXFLAGS="$CXXFLAGS -ftemplate-depth-25"
 
108
 
 
109
if test x$enable_debug = xyes; then
 
110
  if test x$ac_cv_prog_cc_g = xyes; then
 
111
    CFLAGS="-g3 -O0"
 
112
  else
 
113
    CFLAGS="-O0"
 
114
  fi
 
115
  if test x$ac_cv_prog_cxx_g = xyes; then
 
116
    CXXFLAGS="-g3 -O0"
 
117
  else
 
118
    CXXFLAGS="-O0"
 
119
  fi
 
120
  CFLAGS="$CFLAGS -Werror"
 
121
  CXXFLAGS="$CXXFLAGS -Werror"
 
122
fi
 
123
#  AC_DEFINE(DEBUG)
 
124
#else
 
125
#  AC_DEFINE(NDEBUG)
 
126
#fi
 
127
 
 
128
if test x$enable_profile = xyes; then
 
129
  CFLAGS="$CFLAGS -pg"
 
130
  CXXFLAGS="$CXXFLAGS -pg"
 
131
fi
 
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"
 
136
fi
 
137
 
 
138
# ---------------------------------------------------------------------
 
139
# Check for curl for installmgr suport
 
140
# ---------------------------------------------------------------------
 
141
 
 
142
CURL_CFLAGS=
 
143
CURL_LIBS=
 
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"
 
149
        with_curl=no
 
150
    else
 
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"
 
156
    fi
 
157
fi
 
158
 
 
159
# ---------------------------------------------------------------------
 
160
# Check for clucene for lucene searching support
 
161
# ---------------------------------------------------------------------
 
162
 
 
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"
 
166
   LUCENE_CFLAGS=""
 
167
   LUCENE_LIBS="-lclucene"
 
168
   CXXFLAGS="$CXXFLAGS -DUSELUCENE"
 
169
   CFLAGS="$CFLAGS -DUSELUCENE"
 
170
   LIBS="$LIBS $LUCENE_LIBS"
 
171
fi
 
172
 
 
173
# ---------------------------------------------------------------------
 
174
# Alter global conf directory only if not /etc
 
175
# ---------------------------------------------------------------------
 
176
 
 
177
if test "x$sysconfdir" = "x/etc"; then
 
178
  dir_confdef="no"
 
179
else
 
180
  dir_confdef="yes"
 
181
fi
 
182
 
 
183
 
 
184
# ---------------------------------------------------------------------
 
185
# Determine target system (obsolete?)
 
186
# ---------------------------------------------------------------------
 
187
case "$target_cpu" in
 
188
  i?86)
 
189
    target_system="intel"
 
190
    ;;
 
191
  sparc)
 
192
        case "$target_os" in
 
193
        solaris*)
 
194
        target_system="sparc_solaris"
 
195
        ;;
 
196
        *)
 
197
        target_system="gnu_bigendian"
 
198
        ;;
 
199
        esac
 
200
    ;;
 
201
  *)
 
202
    target_system="$target_cpu"
 
203
    ;;
 
204
esac
 
205
 
 
206
case "$target_os" in
 
207
  beos)
 
208
    target_system="beos"
 
209
    ;;
 
210
  *)
 
211
    target_system="$target_system"
 
212
    ;;
 
213
esac
 
214
 
 
215
case "$target_os" in
 
216
  mingw*)
 
217
    target_mingw32="yes"
 
218
    ;;
 
219
  *)
 
220
    target_mingw32="no"
 
221
    ;;
 
222
esac
 
223
 
 
224
# ---------------------------------------------------------------------
 
225
# Substitute variables into makefiles
 
226
# ---------------------------------------------------------------------
 
227
AC_SUBST(with_zlib)
 
228
AC_SUBST(with_icu)
 
229
AC_SUBST(with_conf)
 
230
AC_SUBST(dir_confdef)
 
231
AC_SUBST(CC)
 
232
AC_SUBST(CURL_CFLAGS)
 
233
AC_SUBST(CURL_LIBS)
 
234
AC_SUBST(LUCENE_LIBS)
 
235
AC_SUBST(ICU_LIBS)
 
236
AC_SUBST(ICU_IOLIBS)
 
237
AC_SUBST(ICU_VER)
 
238
AC_SUBST(enable_debug)
 
239
AC_SUBST(enable_profile)
 
240
 
 
241
AC_SUBST(target_cpu)
 
242
AC_SUBST(target_vendor)
 
243
AC_SUBST(target_os)
 
244
 
 
245
AC_SUBST(target_system)
 
246
AC_SUBST(target_mingw32)
 
247
 
 
248
 
 
249
 
 
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)
 
268
 
 
269
# ---------------------------------------------------------------------
 
270
# Final output
 
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)
 
275
AC_OUTPUT
 
276