source: gsdl/trunk/common-src/configure.in@ 18375

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