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

Last change on this file since 24305 was 23801, checked in by ak19, 13 years ago

Added enable/disable-wvware flag to affected configure and Makefiles files in build-src, build-src/packages and top-level GS2, so we can turn off wvware compiling (such as for 64 bit Mac OS Snow Leopard Update 3 machines - MacOS 10.6.3 and over). By default wvware compilation is enabled.

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