source: main/trunk/greenstone2/common-src/configure.in@ 21446

Last change on this file since 21446 was 21446, checked in by ak19, 14 years ago

Configure files updated to correctly set all the variables that can be ENABLED/DISABLED.

  • Property svn:executable set to *
File size: 10.7 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl Use autoconf-2.59 or later... it might not work anymore with
3dnl the older 2.1x versions - jrm21 12/2004
4AC_INIT(src/lib/text_t.h)
5AC_CONFIG_HEADER(config.h)
6
7
8
9
10PACKAGE=gsdl
11VERSION=2.82-svn
12AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
13AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
14AC_SUBST(PACKAGE)
15AC_SUBST(VERSION)
16
17dnl
18dnl Set use of fast cgi
19dnl
20USE_FASTCGI=0
21if test USE_FASTCGI = 1; then
22AC_DEFINE(USE_FASTCGI)
23AC_SUBST(USE_FASTCGI)
24fi
25
26dnl
27dnl Set use of langaction
28dnl
29dnl USE_LANGACTION=0
30if test USE_LANGACTION = 1; then
31AC_DEFINE(USE_LANGACTION)
32AC_SUBST(USE_LANGACTION)
33fi
34
35dnl
36dnl Set use of corba
37dnl
38AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=$enableval, USE_CORBA=no)
39if test $USE_CORBA = "yes" -o $USE_CORBA = "1" ; then
40 USE_CORBA=1
41 AC_DEFINE(USE_CORBA,[])
42else
43 USE_CORBA=0
44fi
45AC_SUBST(USE_CORBA)
46
47AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
48AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
49AC_SUBST(MICO_DIR)
50
51dnl
52dnl Set use of z39.50
53dnl
54AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=$enableval, USE_Z3950=no)
55if test $USE_Z3950 = "yes" -o $USE_Z3950 = "1" ; then
56 USE_Z3950=1
57 AC_DEFINE(USE_Z3950,[])
58else
59 USE_Z3950=0
60fi
61AC_SUBST(USE_Z3950)
62
63dnl
64dnl Set use of yaz - now compiled by default even when z3950 support not required
65dnl
66AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=$enableval, USE_YAZ=yes)
67if test $USE_YAZ = "yes" -o $USE_YAZ = "1" ; then
68 USE_YAZ=1
69 AC_DEFINE(USE_YAZ,[])
70else
71 USE_YAZ=0
72fi
73AC_SUBST(USE_YAZ)
74
75dnl
76dnl disable compilation of accent folding stuff for mgpp (and one day mg)
77dnl
78AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes)
79if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then
80 ENABLE_ACCENTFOLD=1
81 AC_DEFINE(ENABLE_ACCENTFOLD,[])
82else
83 ENABLE_ACCENTFOLD=0
84fi
85AC_SUBST(ENABLE_ACCENTFOLD)
86
87dnl
88dnl Set use of JDBM (enabled by default)
89dnl
90AC_ARG_ENABLE(jdbm, [ --disable-jdbm Disable JDBM compilation], ENABLE_JDBM=$enableval, ENABLE_JDBM=yes)
91if test $ENABLE_JDBM = "yes" -o $ENABLE_JDBM = "1" ; then
92 ENABLE_JDBM=1
93 AC_DEFINE(ENABLE_JDBM,[])
94else
95 ENABLE_JDBM=0
96fi
97AC_SUBST(ENABLE_JDBM)
98
99dnl
100dnl Set use of SQLite (enabled by default)
101dnl
102AC_ARG_ENABLE(sqlite, [ --disable-sqlite Disable SQLite support], USE_SQLITE=$enableval, USE_SQLITE=yes)
103if test $USE_SQLITE = "yes" -o $USE_SQLITE = "1" ; then
104 USE_SQLITE=1
105 AC_DEFINE(USE_SQLITE,[])
106else
107 USE_SQLITE=0
108fi
109AC_SUBST(USE_SQLITE)
110
111dnl
112dnl Set compilation of JNI parts of MG and MGPP indexers (disabled by default, which is GS2's default behaviour)
113dnl
114AC_ARG_ENABLE(jni, [ --enable-jni Enable JNI compilation], ENABLE_JNI=$enableval, ENABLE_JNI=no)
115if test $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" ; then
116 ENABLE_JNI=1
117 AC_DEFINE(ENABLE_JNI,[])
118else
119 ENABLE_JNI=0
120fi
121AC_SUBST(ENABLE_JNI)
122
123dnl
124dnl Set compilation of MG (enabled by default)
125dnl
126AC_ARG_ENABLE(mg, [ --disable-mg Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
127if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
128 ENABLE_MG=1
129 AC_DEFINE(ENABLE_MG,[])
130else
131 ENABLE_MG=0
132fi
133AC_SUBST(ENABLE_MG)
134
135dnl
136dnl Set compilation of MGPP (enabled by default)
137dnl
138AC_ARG_ENABLE(mgpp, [ --disable-mgpp Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
139if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
140 ENABLE_MGPP=1
141 AC_DEFINE(ENABLE_MGPP,[])
142else
143 ENABLE_MGPP=0
144fi
145AC_SUBST(ENABLE_MGPP)
146
147dnl
148dnl Set compilation of lucene (enabled by default)
149dnl
150AC_ARG_ENABLE(lucene, [ --disable-lucene Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
151if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
152 ENABLE_LUCENE=1
153 AC_DEFINE(ENABLE_LUCENE,[])
154else
155 ENABLE_LUCENE=0
156fi
157AC_SUBST(ENABLE_LUCENE)
158
159
160dnl Checks for programs.
161LDFLAGS=$LDFLAGS
162AC_SUBST(LDFLAGS)
163dnl only set CFLAGS if not already set in environment
164if test -z "$CFLAGS"; then
165CFLAGS=-O2
166fi
167AC_SUBST(CFLAGS)
168
169
170AC_PROG_CC
171AC_PROG_CXX
172AC_PROG_AWK
173AC_PROG_YACC
174dnl get $target_cpu, $target_vendor, and $target_os
175dnl (as well as host_*)
176AC_CANONICAL_SYSTEM
177dnl do we actually want this? It adds a prefix based on host, system etc
178dnl AC_ARG_PROGRAM
179AC_PROG_INSTALL
180AC_PROG_LN_S
181AC_PROG_MAKE_SET
182AC_PROG_RANLIB
183
184AC_MSG_CHECKING(to see if architecture is 64-bit)
185arch_64bit=no
186case "$host_cpu" in
187x86_64) arch_64bit=yes ;;
188esac
189
190if test "$arch_64bit" = yes; then
191 AC_MSG_RESULT(yes)
192 if test -z "$COMPAT32BITFLAGS" ; then
193 COMPAT32BITFLAGS="-m32"
194 fi
195else
196 AC_MSG_RESULT(no)
197 if test -z "$COMPAT32BITFLAGS" ; then
198 COMPAT32BITFLAGS=
199 fi
200fi
201
202# Only need compat32bitflag if using MG or MGPP
203if test "$ENABLE_MG" = "0" ; then
204 COMPAT32BITFLAGS=
205else
206 if test "$ENABLE_MGPP" = "0" ; then
207 COMPAT32BITFLAGS=
208 fi
209fi
210
211export COMPAT32BITFLAGS
212AC_SUBST(COMPAT32BITFLAGS)
213
214
215#moved CORBA MICO directory test to get version of MICO
216if test $USE_CORBA = 1; then
217
218if test $MICO_DIR = "default"; then
219#do something
220MICO_INC="-I packages/mico/mico/include"
221else
222#build the micotest program
223MICO_INC= ""
224if test $MICO_DIR != yes; then
225MICO_INC="-I $MICO_DIR"
226fi
227fi
228
229#get MICO_VER value
230sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
231sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
232MICO_VER=`./micotest` || MICO_VER=2.3.5
233sh -c "rm micotest"
234sh -c "rm micotest.o"
235
236#do test of MICO_VER
237if test MICO_VER != 0; then
238AC_DEFINE(MICO_VER)
239AC_SUBST(MICO_VER)
240fi
241#end USE_CORBA test
242fi
243
244dnl Checks for typedefs, structures, and compiler characteristics.
245AC_AIX
246AC_ISC_POSIX
247AC_MINIX
248fp_C_PROTOTYPES
249AC_C_CONST
250AC_TYPE_OFF_T
251AC_TYPE_SIZE_T
252AC_HEADER_TIME
253AC_STRUCT_TM
254
255dnl --- This should be in the stdc checking -----------------
256if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
257dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
258dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
259dnl XOPEN extensions (like popen).
260dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
261dnl needs. So drop back to -Xa
262AC_TRY_COMPILE(
263[#include <stdio.h>
264], [ FILE *rubbish = popen("yes", "r"); ],,
265[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
266fi
267dnl ----------------------
268
269
270dnl Checks for libraries.
271dnl check for -lg:
272AC_HAVE_LIBRARY(g)
273dnl check for -lm:
274AC_HAVE_LIBRARY(m)
275dnl check for -lcrypt:
276AC_HAVE_LIBRARY(crypt)
277#if test $ENABLE_ACCENTFOLD = 1; then
278#AC_HAVE_LIBRARY(iconv)
279#fi
280
281dnl Checks for header files.
282AC_HEADER_DIRENT
283AC_HEADER_STDC
284AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
285AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
286AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
287AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
288
289dnl Checks for library functions.
290AC_FUNC_ALLOCA
291AC_PROG_GCC_TRADITIONAL
292AC_TYPE_SIGNAL
293AC_FUNC_VPRINTF
294AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
295AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
296
297dnl see if gettext is in libc. (try the textdomain() function).
298AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
299
300# *** Custom checking (based on GNU tar configure.in) ***
301# ---------------------------------------------------------------------------
302AC_MSG_CHECKING(for HP-UX needing gmalloc)
303if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
304 AC_MSG_RESULT(yes)
305 AC_LIBOBJ([gmalloc])
306 AC_DEFINE(HAVE_VALLOC)
307else
308 AC_MSG_RESULT(no)
309 AC_CHECK_FUNCS(valloc)
310fi
311
312# we cannot generate static libraries under Darwin
313AC_MSG_CHECKING(for Apple MacOS X/Darwin)
314if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
315 AC_MSG_RESULT(yes)
316 STATIC=""
317else
318 AC_MSG_RESULT(no)
319 STATIC="-static "
320fi
321AC_SUBST(STATIC)
322
323fp_WITH_DMALLOC
324fp_WITH_REGEX
325
326# ---------------------------------------------------------------------------
327if test "$ac_cv_func_alloca" = 'no'; then
328dnl support functions for alloca.c
329 AC_LIBOBJ([xmalloc])
330 AC_LIBOBJ([error])
331fi
332
333
334# ---------------------------------------------------------------------------
335
336dnl
337dnl Switch into C++
338dnl
339AC_LANG_CPLUSPLUS
340
341dnl
342dnl Check if the STL library has any known faults;
343dnl In GCC 2.7.2.x series, some STL library headers are missing
344dnl a file called "new" which is referred to by other headers
345dnl (eg. vector/vector.h); if this applies, then all use of the
346dnl STL will cause a compile fail, so we'd better let the user
347dnl know now, before things really go wrong!
348dnl
349success=no
350AC_MSG_CHECKING("whether STL library has known faults")
351
352dnl - first shot, try simple good old vector on its own
353AC_TRY_COMPILE(
354[#include <vector>
355],
356[],
357success=yes,
358)
359
360dnl - try using the .h equivalent
361if test $success = "no"; then
362AC_TRY_COMPILE(
363[#include <vector.h>
364],
365[],
366success="yes",
367)
368fi
369
370dnl - now try for the objectspace headers
371if test $success = "no"; then
372AC_TRY_COMPILE(
373[#include <ospace\\std\\vector>
374],
375[],
376success="yes",
377)
378fi
379
380if test $success = yes; then
381AC_MSG_RESULT("no")
382else
383AC_MSG_RESULT("yes")
384AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
385fi
386
387gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
388# check for running bash under cygwin
389 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
390 then
391 gsdlos=windows
392 fi
393AC_SUBST(gsdlos)
394
395# check for endianness
396AC_C_BIGENDIAN
397# ---------------------------------------------------------------------------
398if test "$ac_cv_func_alloca" = 'no'; then
399dnl support functions for alloca.c
400 AC_LIBOBJ([xmalloc.o])
401 AC_LIBOBJ([error])
402fi
403
404# ---------------------------------------------------------------------------
405
406
407dnl
408dnl Locate all children of the modules folder
409dnl
410moduleDirs=""
411MODULEDIRS=""
412if test -d modules ; then
413 for x in `find modules -mindepth 1 -maxdepth 2`; do
414 if test -d "$x"; then
415 d="$x/Makefile.in"
416 if test -e "$d"; then
417 dnl echo $d
418 moduleDirs="$moduleDirs $x/Makefile"
419 MODULEDIRS="$MODULEDIRS $x"
420 fi
421 fi
422 done
423 echo "Making $moduleDirs in modules directory"
424 AC_SUBST(MODULEDIRS)
425fi
426
427
428# ---------------------------------------------------------------------------
429
430AC_CONFIG_SUBDIRS(packages)
431
432commonsrcprefix=`pwd`
433ac_configure_args="$ac_configure_args --with-libiconv-prefix=$commonsrcprefix/packages/iconv"
434AC_CONFIG_SUBDIRS(indexers)
435
436# the list of folders in the src folder
437srclist="src/lib/Makefile \
438 src/gdbmedit/db2txt/Makefile \
439 src/gdbmedit/txt2db/Makefile \
440 src/gdbmedit/gdbmget/Makefile \
441 src/gdbmedit/gdbmset/Makefile \
442 src/gdbmedit/gdbmkeys/Makefile \
443 src/gdbmedit/gdbmdel/Makefile \
444 src/getpw/Makefile"
445
446AC_OUTPUT(packages/Makefile Makefile $srclist $moduleDirs)
447
448
Note: See TracBrowser for help on using the repository browser.