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

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

Changes to makefiles to 1. incorporate USE_GDBM and USE_JDBM flags (and USE_SQLITE) in most places so that the DEFINES variable is set at all times. This is necessary to ensure that all classes that contain objects with gdbm and jdbm members are of a consistent size. Else we've had experience with Greenstone crashing with memory errors (to do with the similar ENABLE_indexer flags). 2. ENABLE_JDBM is now USE_JDBM. 3. Not everything works now. It still compiles the default way, but the disable-gdbm flag is causing trouble when compiling argdb in recpt since it uses that.

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