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

Last change on this file since 21330 was 21330, checked in by ak19, 14 years ago

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene).

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