source: main/trunk/greenstone2/runtime-src/packages/security/gs-code-changes/configure_scripts/runtime-src/configure.in@ 28886

Last change on this file since 28886 was 28886, checked in by ak19, 10 years ago

Additions to the OWASP-for-C++ security package, even though we are no longer using this now. Adding Dr Bainbridge's new files esapitools.cpp and .h, in case we use this in future, along with its Makefile.in. Adding configure files to enable/disable the security package. (The Makefile in runtime-src/packages is not yet complete.)

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