source: main/trunk/greenstone2/runtime-src/configure.in@ 22067

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