source: main/trunk/greenstone2/configure.in@ 21409

Last change on this file since 21409 was 21409, checked in by davidb, 14 years ago

Introduction of --enable-jdbm flag

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