source: gsdl/trunk/runtime-src/configure.in@ 18379

Last change on this file since 18379 was 18214, checked in by mdewsnip, 15 years ago

Removed --with-gdbm option and no longer checks for GDBM library existing, because we know we have it.

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