source: gsdl/tags/2.81rc/common-src/configure.in@ 19320

Last change on this file since 19320 was 16595, checked in by oranfry, 16 years ago

Removed perl test as this in done in build-src's configure

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