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

Last change on this file since 21446 was 21446, checked in by ak19, 14 years ago

Configure files updated to correctly set all the variables that can be ENABLED/DISABLED.

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