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