source: main/trunk/greenstone2/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 *
  • Property svn:keywords set to Author Date Id Revision
File size: 12.4 KB
RevLine 
[552]1dnl Process this file with autoconf to produce a configure script.
[8758]2dnl Use autoconf-2.59 or later... it might not work anymore with
3dnl the older 2.1x versions - jrm21 12/2004
[16563]4AC_INIT()
[684]5AC_CONFIG_HEADER(config.h)
[552]6
[554]7PACKAGE=gsdl
[16563]8VERSION=2.82-svn
[552]9AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
10AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
11AC_SUBST(PACKAGE)
12AC_SUBST(VERSION)
[567]13
[18483]14
[1860]15dnl
16dnl Set use of fast cgi
17dnl
[566]18USE_FASTCGI=0
19if test USE_FASTCGI = 1; then
20AC_DEFINE(USE_FASTCGI)
21AC_SUBST(USE_FASTCGI)
22fi
[552]23
[1860]24dnl
[3631]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
[1860]34dnl Set use of corba
35dnl
[21446]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
[2051]43AC_SUBST(USE_CORBA)
[1860]44
[21330]45AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
[2296]46AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
[2051]47AC_SUBST(MICO_DIR)
[1860]48
[1938]49dnl
50dnl Set use of z39.50
51dnl
[21446]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
[1938]59AC_SUBST(USE_Z3950)
60
[2279]61dnl
[12492]62dnl Set use of yaz - now compiled by default even when z3950 support not required
63dnl
[21446]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
[12492]71AC_SUBST(USE_YAZ)
72
[22058]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
[12922]97dnl
98dnl disable compilation of accent folding stuff for mgpp (and one day mg)
99dnl
[21446]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
[12922]107AC_SUBST(ENABLE_ACCENTFOLD)
108
[15901]109dnl
[16288]110dnl Set use of SQLite (enabled by default)
[15901]111dnl
[21446]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
[15901]119AC_SUBST(USE_SQLITE)
120
[18483]121dnl
[20853]122dnl Set use of Apache httpd (disabled by default)
[18483]123dnl
[21377]124if test -d runtime-src; then
[21446]125 AC_ARG_ENABLE(apache-httpd, [ --enable-apache-httpd Enable Apache httpd support], USE_APACHE_HTTPD=$enableval, USE_APACHE_HTTPD=no)
126 if test $USE_APACHE_HTTPD = "yes" -o $USE_APACHE_HTTPD = "1" ; then
127 USE_APACHE_HTTPD=1
128 AC_DEFINE(USE_APACHE_HTTPD,[])
129 else
130 USE_APACHE_HTTPD=0
131 fi
[21377]132 AC_SUBST(USE_APACHE_HTTPD)
133fi
[18483]134
[21366]135dnl
136dnl Set compilation of JNI parts of MG and MGPP indexers (disabled by default, which is GS2's default behaviour)
137dnl
138AC_ARG_ENABLE(jni, [ --enable-jni Enable JNI compilation], ENABLE_JNI=$enableval, ENABLE_JNI=no)
139if test $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" ; then
140 ENABLE_JNI=1
141 AC_DEFINE(ENABLE_JNI,[])
142else
143 ENABLE_JNI=0
144fi
145AC_SUBST(ENABLE_JNI)
[18483]146
[21330]147dnl
148dnl Set compilation of MG (enabled by default)
149dnl
150AC_ARG_ENABLE(mg, [ --disable-mg Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
151if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
152 ENABLE_MG=1
153 AC_DEFINE(ENABLE_MG,[])
154 else
155 ENABLE_MG=0
156 fi
157AC_SUBST(ENABLE_MG)
158
159
160dnl
161dnl Set compilation of MGPP (enabled by default)
162dnl
163AC_ARG_ENABLE(mgpp, [ --disable-mgpp Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
164if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
165 ENABLE_MGPP=1
166 AC_DEFINE(ENABLE_MGPP,[])
167else
168 ENABLE_MGPP=0
169fi
170AC_SUBST(ENABLE_MGPP)
171
172dnl
173dnl Set compilation of lucene (enabled by default)
174dnl
175AC_ARG_ENABLE(lucene, [ --disable-lucene Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
176if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
177 ENABLE_LUCENE=1
[21446]178 AC_DEFINE(ENABLE_LUCENE,[])
[21330]179else
180 ENABLE_LUCENE=0
181fi
182AC_SUBST(ENABLE_LUCENE)
183
184
[552]185dnl Checks for programs.
[14169]186LDFLAGS=$LDFLAGS
[15551]187AC_SUBST(LDFLAGS)
[1722]188dnl only set CFLAGS if not already set in environment
189if test -z "$CFLAGS"; then
[794]190CFLAGS=-O2
[1722]191fi
[575]192AC_SUBST(CFLAGS)
193
[15551]194
[552]195AC_PROG_CC
196AC_PROG_CXX
[684]197AC_PROG_AWK
198AC_PROG_YACC
[2279]199dnl get $target_cpu, $target_vendor, and $target_os
200dnl (as well as host_*)
201AC_CANONICAL_SYSTEM
202dnl do we actually want this? It adds a prefix based on host, system etc
203dnl AC_ARG_PROGRAM
[703]204AC_PROG_INSTALL
[552]205AC_PROG_LN_S
206AC_PROG_MAKE_SET
207AC_PROG_RANLIB
208
[15551]209AC_MSG_CHECKING(to see if architecture is 64-bit)
210arch_64bit=no
211case "$host_cpu" in
212x86_64) arch_64bit=yes ;;
213esac
214
215if test "$arch_64bit" = yes; then
216 AC_MSG_RESULT(yes)
217 if test -z "$COMPAT32BITFLAGS" ; then
218 COMPAT32BITFLAGS="-m32"
219 fi
220else
221 AC_MSG_RESULT(no)
222 if test -z "$COMPAT32BITFLAGS" ; then
223 COMPAT32BITFLAGS=
224 fi
225fi
[21432]226
227# Only need compat32bitflag if using MG or MGPP
228if test "$ENABLE_MG" = "0" ; then
229 COMPAT32BITFLAGS=
230else
231 if test "$ENABLE_MGPP" = "0" ; then
232 COMPAT32BITFLAGS=
233 fi
234fi
235
[15551]236export COMPAT32BITFLAGS
237AC_SUBST(COMPAT32BITFLAGS)
238
239
[2173]240#moved CORBA MICO directory test to get version of MICO
241if test $USE_CORBA = 1; then
242
[2213]243if test $MICO_DIR = "default"; then
[2173]244#do something
245MICO_INC="-I packages/mico/mico/include"
246else
247#build the micotest program
248MICO_INC= ""
249if test $MICO_DIR != yes; then
250MICO_INC="-I $MICO_DIR"
251fi
252fi
253
254#get MICO_VER value
255sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
256sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
[2214]257MICO_VER=`./micotest` || MICO_VER=2.3.5
[2173]258sh -c "rm micotest"
259sh -c "rm micotest.o"
260
261#do test of MICO_VER
262if test MICO_VER != 0; then
263AC_DEFINE(MICO_VER)
264AC_SUBST(MICO_VER)
265fi
266#end USE_CORBA test
267fi
268
[684]269dnl Checks for typedefs, structures, and compiler characteristics.
270AC_AIX
271AC_ISC_POSIX
272AC_MINIX
273fp_C_PROTOTYPES
274AC_C_CONST
275AC_TYPE_OFF_T
276AC_TYPE_SIZE_T
277AC_HEADER_TIME
278AC_STRUCT_TM
279
280dnl --- This should be in the stdc checking -----------------
281if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
282dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
283dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
284dnl XOPEN extensions (like popen).
285dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
286dnl needs. So drop back to -Xa
287AC_TRY_COMPILE(
288[#include <stdio.h>
289], [ FILE *rubbish = popen("yes", "r"); ],,
290[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
291fi
292dnl ----------------------
293
294
[552]295dnl Checks for libraries.
[8756]296dnl check for -lg:
297AC_HAVE_LIBRARY(g)
298dnl check for -lm:
299AC_HAVE_LIBRARY(m)
300dnl check for -lcrypt:
301AC_HAVE_LIBRARY(crypt)
[20842]302#if test $ENABLE_ACCENTFOLD = 1; then
303#AC_HAVE_LIBRARY(iconv)
304#fi
[552]305
306dnl Checks for header files.
[684]307AC_HEADER_DIRENT
[552]308AC_HEADER_STDC
[10181]309AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
[684]310AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
311AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
312AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
[552]313
[684]314dnl Checks for library functions.
315AC_FUNC_ALLOCA
316AC_PROG_GCC_TRADITIONAL
317AC_TYPE_SIGNAL
318AC_FUNC_VPRINTF
[786]319AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
[684]320AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
[552]321
[3705]322dnl see if gettext is in libc. (try the textdomain() function).
[8202]323AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
[552]324
[684]325# *** Custom checking (based on GNU tar configure.in) ***
326# ---------------------------------------------------------------------------
327AC_MSG_CHECKING(for HP-UX needing gmalloc)
328if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
329 AC_MSG_RESULT(yes)
[8756]330 AC_LIBOBJ([gmalloc])
[684]331 AC_DEFINE(HAVE_VALLOC)
332else
333 AC_MSG_RESULT(no)
334 AC_CHECK_FUNCS(valloc)
335fi
336
[8183]337# we cannot generate static libraries under Darwin
338AC_MSG_CHECKING(for Apple MacOS X/Darwin)
339if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
340 AC_MSG_RESULT(yes)
[8199]341 STATIC=""
[8183]342else
343 AC_MSG_RESULT(no)
[8199]344 STATIC="-static "
[8183]345fi
346AC_SUBST(STATIC)
347
[684]348fp_WITH_DMALLOC
349fp_WITH_REGEX
350
351# ---------------------------------------------------------------------------
352if test "$ac_cv_func_alloca" = 'no'; then
353dnl support functions for alloca.c
[8756]354 AC_LIBOBJ([xmalloc])
355 AC_LIBOBJ([error])
[684]356fi
357
358
359# ---------------------------------------------------------------------------
360
[552]361dnl
[684]362dnl Switch into C++
363dnl
364AC_LANG_CPLUSPLUS
365
366dnl
367dnl Now check that Perl is actually around, and can be found
368dnl
[2279]369AC_MSG_CHECKING(that Perl 5 is available)
[684]370success="no"
371pl_path="$PATH"
372IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
373for pl_dir in $pl_path; do
374 test -z "$pl_dir" && pl_dir=.
375 if test -x $pl_dir/perl; then
376 success="yes"
377 break
378 fi
379done
380IFS="$pl_save_ifs"
381
382dnl
383dnl Perl actually can be run; now we see if it is version 5 by
384dnl running a sample script (which returns a "clean" version number
385dnl and then tests the result using expr. If perl errors in some
386dnl way (eg. broken Perl executable, missing script), we set a failure
387dnl value ("0") and then proceed as best we can
388dnl
389if test $success = "yes"; then
390try=`perl configtest.pl` || try="0"
391try=`expr $try \> 5.000`
392if test $try = "1"; then
393AC_MSG_RESULT("yes")
394else
395success="no"
396fi
397fi
398
399if test $success = "no"; then
400AC_MSG_RESULT("no")
401AC_MSG_ERROR("Perl 5 not available - cannot install")
402fi
403
404dnl
[552]405dnl Check if the STL library has any known faults;
406dnl In GCC 2.7.2.x series, some STL library headers are missing
407dnl a file called "new" which is referred to by other headers
408dnl (eg. vector/vector.h); if this applies, then all use of the
409dnl STL will cause a compile fail, so we'd better let the user
410dnl know now, before things really go wrong!
411dnl
412success=no
413AC_MSG_CHECKING("whether STL library has known faults")
414
415dnl - first shot, try simple good old vector on its own
416AC_TRY_COMPILE(
417[#include <vector>
418],
419[],
420success=yes,
421)
422
423dnl - try using the .h equivalent
424if test $success = "no"; then
425AC_TRY_COMPILE(
426[#include <vector.h>
427],
428[],
429success="yes",
430)
431fi
432
433dnl - now try for the objectspace headers
434if test $success = "no"; then
435AC_TRY_COMPILE(
436[#include <ospace\\std\\vector>
437],
438[],
439success="yes",
440)
441fi
442
443if test $success = yes; then
444AC_MSG_RESULT("no")
445else
446AC_MSG_RESULT("yes")
[684]447AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
[552]448fi
449
[2950]450gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
[2951]451# check for running bash under cygwin
452 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
453 then
454 gsdlos=windows
455 fi
[557]456AC_SUBST(gsdlos)
457
[10856]458# check for endianness
459AC_C_BIGENDIAN
[684]460# ---------------------------------------------------------------------------
461if test "$ac_cv_func_alloca" = 'no'; then
462dnl support functions for alloca.c
[8756]463 AC_LIBOBJ([xmalloc.o])
464 AC_LIBOBJ([error])
[684]465fi
[552]466
[3062]467# ---------------------------------------------------------------------------
[552]468
[3062]469dnl
470dnl Locate all children of the modules folder
471dnl
472moduleDirs=""
473MODULEDIRS=""
[16619]474if test -d modules ; then
[15300]475 for x in `find modules -mindepth 1 -maxdepth 2`; do
476 if test -d "$x"; then
477 d="$x/Makefile.in"
478 if test -e "$d"; then
479 dnl echo $d
480 moduleDirs="$moduleDirs $x/Makefile"
481 MODULEDIRS="$MODULEDIRS $x"
482 fi
[3062]483 fi
[15300]484 done
485 echo "Making $moduleDirs in modules directory"
486 AC_SUBST(MODULEDIRS)
487fi
[3062]488
[15300]489
[684]490# ---------------------------------------------------------------------------
[2279]491dnl for Darwin, as our packages don't (yet) correctly guess our system type.
[8202]492dnl not needed any more?
493dnl ac_configure_args="$ac_configure_args --build=$build --target=$target"
[1668]494
[13777]495# indexers needs a bindir option to get the binaries into the right place
496gsdlprefix=`pwd`
[19264]497ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos --libdir=$gsdlprefix/lib/$gsdlos"
[21377]498AC_CONFIG_SUBDIRS(common-src)
499AC_CONFIG_SUBDIRS(build-src)
[13777]500
[3062]501# the list of folders in the src folder
[16572]502srclist="common-src/Makefile \
[21377]503 build-src/Makefile"
504
505if test -d runtime-src; then
506 AC_CONFIG_SUBDIRS(runtime-src)
507 srclist="$srclist \
[16572]508 runtime-src/Makefile"
[21377]509fi
[3062]510
[16561]511AC_OUTPUT(Makefile $srclist $moduleDirs)
[684]512
513
Note: See TracBrowser for help on using the repository browser.