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

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

New configuration and compilation flag ENABLE_JNI added which will be disabled by default for GS2 since in general GS doesn't need mg and mgpp compiled up with jni. GS3's build.xml will need to explicitly set ENABLE_JNI to compile mg and mgpp with jni.

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