source: main/trunk/gs2runtime/configure.in@ 21444

Last change on this file since 21444 was 21444, checked in by davidb, 14 years ago

If statement should use 'test' not '[...]' in autoconfigure file

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