source: main/trunk/greenstone2/runtime-src/configure.in@ 28909

Last change on this file since 28909 was 25189, checked in by ak19, 12 years ago

Added new version of mico. The older version 2.3.5 does not work on the 64 bit linux. The latest official binary was 2.3.13 which required a modification to orb/fast_array.cc where it needs to hash include limits.h (include file in diamond brackets). Then the runtime-src's configure.in (and configure) files need to be updated to set the Mico minimum version to 2.3.13. Finally, the make install was not succeeding in Mico. Dr Bainbridge modified runtime-src/packages/configure to both get rid of some config flags that may not be necessary and because a sed replacement operation now needed to be case insensitive.

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