source: gs2build/configure.in@ 20741

Last change on this file since 20741 was 19844, checked in by kjdon, 15 years ago

removed runtime-src from list of subdirs

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