source: main/trunk/greenstone2/build-src/configure.in@ 22144

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