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