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

Last change on this file since 21417 was 21417, checked in by davidb, 14 years ago

Correction to how --enable-jdbm flag is implemented

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