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

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

GSDLARCH used in Linux makefiles when working out the cgi-bin path (now cgi-bin\GSDL_OS_ARCH) to install the binaries into.

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