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
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl Use autoconf-2.59 or later... it might not work anymore with
3dnl the older 2.1x versions - jrm21 12/2004
4AC_INIT()
5AC_CONFIG_HEADER(config.h)
6
7PACKAGE=gsdl
8VERSION=2.82-svn
9AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
10AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
11AC_SUBST(PACKAGE)
12AC_SUBST(VERSION)
13
14
15dnl
16dnl Set use of fast cgi
17dnl
18USE_FASTCGI=0
19if test USE_FASTCGI = 1; then
20AC_DEFINE(USE_FASTCGI)
21AC_SUBST(USE_FASTCGI)
22fi
23
24dnl
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
34dnl Set use of corba
35dnl
36AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
37AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
38AC_SUBST(USE_CORBA)
39
40AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
41AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
42AC_SUBST(MICO_DIR)
43
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)
48if test USE_Z3950 = 1; then
49AC_DEFINE(USE_Z3950, $USE_Z3950)
50AC_SUBST(USE_Z3950)
51fi
52
53dnl
54dnl Set use of yaz - now compiled by default even when z3950 support not required
55dnl
56AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=0, USE_YAZ=1)
57dnl if test USE_YAZ = 1; then
58AC_DEFINE(USE_YAZ, $USE_YAZ)
59AC_SUBST(USE_YAZ)
60dnl fi
61
62dnl
63dnl disable compilation of accent folding stuff for mgpp (and one day mg)
64dnl
65AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
66AC_DEFINE(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
67AC_SUBST(ENABLE_ACCENTFOLD)
68
69dnl
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
77dnl Set use of SQLite (enabled by default)
78dnl
79AC_ARG_ENABLE(sqlite, [ --disable-sqlite Disable SQLite support], USE_SQLITE=0, USE_SQLITE=1)
80AC_DEFINE(USE_SQLITE, $USE_SQLITE)
81AC_SUBST(USE_SQLITE)
82
83dnl
84dnl Set use of Apache httpd (disabled by default)
85dnl
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
91
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)
103
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
142dnl Checks for programs.
143LDFLAGS=$LDFLAGS
144AC_SUBST(LDFLAGS)
145dnl only set CFLAGS if not already set in environment
146if test -z "$CFLAGS"; then
147CFLAGS=-O2
148fi
149AC_SUBST(CFLAGS)
150
151
152AC_PROG_CC
153AC_PROG_CXX
154AC_PROG_AWK
155AC_PROG_YACC
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
161AC_PROG_INSTALL
162AC_PROG_LN_S
163AC_PROG_MAKE_SET
164AC_PROG_RANLIB
165
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
187#moved CORBA MICO directory test to get version of MICO
188if test $USE_CORBA = 1; then
189
190if test $MICO_DIR = "default"; then
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
204MICO_VER=`./micotest` || MICO_VER=2.3.5
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
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
242dnl Checks for libraries.
243dnl check for -lg:
244AC_HAVE_LIBRARY(g)
245dnl check for -lm:
246AC_HAVE_LIBRARY(m)
247dnl check for -lcrypt:
248AC_HAVE_LIBRARY(crypt)
249#if test $ENABLE_ACCENTFOLD = 1; then
250#AC_HAVE_LIBRARY(iconv)
251#fi
252
253dnl Checks for header files.
254AC_HEADER_DIRENT
255AC_HEADER_STDC
256AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
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))
260
261dnl Checks for library functions.
262AC_FUNC_ALLOCA
263AC_PROG_GCC_TRADITIONAL
264AC_TYPE_SIGNAL
265AC_FUNC_VPRINTF
266AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
267AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
268
269dnl see if gettext is in libc. (try the textdomain() function).
270AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
271
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)
277 AC_LIBOBJ([gmalloc])
278 AC_DEFINE(HAVE_VALLOC)
279else
280 AC_MSG_RESULT(no)
281 AC_CHECK_FUNCS(valloc)
282fi
283
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)
288 STATIC=""
289else
290 AC_MSG_RESULT(no)
291 STATIC="-static "
292fi
293AC_SUBST(STATIC)
294
295fp_WITH_DMALLOC
296fp_WITH_REGEX
297
298# ---------------------------------------------------------------------------
299if test "$ac_cv_func_alloca" = 'no'; then
300dnl support functions for alloca.c
301 AC_LIBOBJ([xmalloc])
302 AC_LIBOBJ([error])
303fi
304
305
306# ---------------------------------------------------------------------------
307
308dnl
309dnl Switch into C++
310dnl
311AC_LANG_CPLUSPLUS
312
313dnl
314dnl Now check that Perl is actually around, and can be found
315dnl
316AC_MSG_CHECKING(that Perl 5 is available)
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
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")
394AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
395fi
396
397gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
398# check for running bash under cygwin
399 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
400 then
401 gsdlos=windows
402 fi
403AC_SUBST(gsdlos)
404
405# check for endianness
406AC_C_BIGENDIAN
407# ---------------------------------------------------------------------------
408if test "$ac_cv_func_alloca" = 'no'; then
409dnl support functions for alloca.c
410 AC_LIBOBJ([xmalloc.o])
411 AC_LIBOBJ([error])
412fi
413
414# ---------------------------------------------------------------------------
415
416dnl
417dnl Locate all children of the modules folder
418dnl
419moduleDirs=""
420MODULEDIRS=""
421if test -d modules ; then
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
430 fi
431 done
432 echo "Making $moduleDirs in modules directory"
433 AC_SUBST(MODULEDIRS)
434fi
435
436
437# ---------------------------------------------------------------------------
438dnl for Darwin, as our packages don't (yet) correctly guess our system type.
439dnl not needed any more?
440dnl ac_configure_args="$ac_configure_args --build=$build --target=$target"
441
442# indexers needs a bindir option to get the binaries into the right place
443gsdlprefix=`pwd`
444ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos --libdir=$gsdlprefix/lib/$gsdlos"
445AC_CONFIG_SUBDIRS(common-src)
446AC_CONFIG_SUBDIRS(build-src)
447
448# the list of folders in the src folder
449srclist="common-src/Makefile \
450 build-src/Makefile"
451
452if test -d runtime-src; then
453 AC_CONFIG_SUBDIRS(runtime-src)
454 srclist="$srclist \
455 runtime-src/Makefile"
456fi
457
458AC_OUTPUT(Makefile $srclist $moduleDirs)
459
460
Note: See TracBrowser for help on using the repository browser.