source: main/trunk/greenstone2/build-src/configure.in@ 21440

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

MICO_DIR should be set to withval not enableval, this was already corrected in the toplevel configure file previously.

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