source: gsdl/trunk/configure.in@ 15908

Last change on this file since 15908 was 15908, checked in by mdewsnip, 16 years ago

Fix for "lib" -> "src/lib" change.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 11.7 KB
RevLine 
[552]1dnl Process this file with autoconf to produce a configure script.
[8758]2dnl Use autoconf-2.59 or later... it might not work anymore with
3dnl the older 2.1x versions - jrm21 12/2004
[15908]4AC_INIT(src/lib/text_t.h)
[684]5AC_CONFIG_HEADER(config.h)
[552]6
[554]7PACKAGE=gsdl
[674]8VERSION=2.1
[552]9AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
10AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
11AC_SUBST(PACKAGE)
12AC_SUBST(VERSION)
[567]13
[1860]14dnl
15dnl Set use of fast cgi
16dnl
[566]17USE_FASTCGI=0
18if test USE_FASTCGI = 1; then
19AC_DEFINE(USE_FASTCGI)
20AC_SUBST(USE_FASTCGI)
21fi
[552]22
[1860]23dnl
[3631]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
[1860]33dnl Set use of corba
34dnl
[2470]35AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
[2296]36AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
[2051]37AC_SUBST(USE_CORBA)
[1860]38
[2470]39AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
[2296]40AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
[2051]41AC_SUBST(MICO_DIR)
[1860]42
[1938]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)
[2296]47if test USE_Z3950 = 1; then
48AC_DEFINE(USE_Z3950, $USE_Z3950)
[1938]49AC_SUBST(USE_Z3950)
[2296]50fi
[1938]51
[2279]52dnl
[12492]53dnl Set use of yaz - now compiled by default even when z3950 support not required
54dnl
[15901]55AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=0, USE_YAZ=1)
[12492]56dnl if test USE_YAZ = 1; then
57AC_DEFINE(USE_YAZ, $USE_YAZ)
58AC_SUBST(USE_YAZ)
59dnl fi
60
61dnl
[2279]62dnl look for libgdbm if not in standard location
63dnl
64AC_ARG_WITH(gdbm, [ --with-gdbm=dir Use local gdbm library and headers], gdbmdir=$withval)
65
[12922]66dnl
67dnl disable compilation of accent folding stuff for mgpp (and one day mg)
68dnl
[15901]69AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
[12922]70AC_DEFINE(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
71AC_SUBST(ENABLE_ACCENTFOLD)
72
[15901]73dnl
74dnl Set use of SQLite
75dnl
76AC_ARG_ENABLE(sqlite, [ --enable-sqlite Enable SQLite support], USE_SQLITE=1, USE_SQLITE=0)
77AC_DEFINE(USE_SQLITE, $USE_SQLITE)
78AC_SUBST(USE_SQLITE)
79
[552]80dnl Checks for programs.
[14169]81LDFLAGS=$LDFLAGS
[15551]82AC_SUBST(LDFLAGS)
[1722]83dnl only set CFLAGS if not already set in environment
84if test -z "$CFLAGS"; then
[794]85CFLAGS=-O2
[1722]86fi
[575]87AC_SUBST(CFLAGS)
88
[15551]89
[552]90AC_PROG_CC
91AC_PROG_CXX
[684]92AC_PROG_AWK
93AC_PROG_YACC
[2279]94dnl get $target_cpu, $target_vendor, and $target_os
95dnl (as well as host_*)
96AC_CANONICAL_SYSTEM
97dnl do we actually want this? It adds a prefix based on host, system etc
98dnl AC_ARG_PROGRAM
[703]99AC_PROG_INSTALL
[552]100AC_PROG_LN_S
101AC_PROG_MAKE_SET
102AC_PROG_RANLIB
103
[15551]104AC_MSG_CHECKING(to see if architecture is 64-bit)
105arch_64bit=no
106case "$host_cpu" in
107x86_64) arch_64bit=yes ;;
108esac
109
110if test "$arch_64bit" = yes; then
111 AC_MSG_RESULT(yes)
112 if test -z "$COMPAT32BITFLAGS" ; then
113 COMPAT32BITFLAGS="-m32"
114 fi
115else
116 AC_MSG_RESULT(no)
117 if test -z "$COMPAT32BITFLAGS" ; then
118 COMPAT32BITFLAGS=
119 fi
120fi
121export COMPAT32BITFLAGS
122AC_SUBST(COMPAT32BITFLAGS)
123
124
[2173]125#moved CORBA MICO directory test to get version of MICO
126if test $USE_CORBA = 1; then
127
[2213]128if test $MICO_DIR = "default"; then
[2173]129#do something
130MICO_INC="-I packages/mico/mico/include"
131else
132#build the micotest program
133MICO_INC= ""
134if test $MICO_DIR != yes; then
135MICO_INC="-I $MICO_DIR"
136fi
137fi
138
139#get MICO_VER value
140sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
141sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
[2214]142MICO_VER=`./micotest` || MICO_VER=2.3.5
[2173]143sh -c "rm micotest"
144sh -c "rm micotest.o"
145
146#do test of MICO_VER
147if test MICO_VER != 0; then
148AC_DEFINE(MICO_VER)
149AC_SUBST(MICO_VER)
150fi
151#end USE_CORBA test
152fi
153
[684]154dnl Checks for typedefs, structures, and compiler characteristics.
155AC_AIX
156AC_ISC_POSIX
157AC_MINIX
158fp_C_PROTOTYPES
159AC_C_CONST
160AC_TYPE_OFF_T
161AC_TYPE_SIZE_T
162AC_HEADER_TIME
163AC_STRUCT_TM
164
165dnl --- This should be in the stdc checking -----------------
166if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
167dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
168dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
169dnl XOPEN extensions (like popen).
170dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
171dnl needs. So drop back to -Xa
172AC_TRY_COMPILE(
173[#include <stdio.h>
174], [ FILE *rubbish = popen("yes", "r"); ],,
175[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
176fi
177dnl ----------------------
178
179
[552]180dnl Checks for libraries.
[8756]181dnl check for -lg:
182AC_HAVE_LIBRARY(g)
183dnl check for -lm:
184AC_HAVE_LIBRARY(m)
185dnl check for -lcrypt:
186AC_HAVE_LIBRARY(crypt)
[12922]187if test $ENABLE_ACCENTFOLD = 1; then
[14169]188AC_HAVE_LIBRARY(iconv)
[12922]189fi
[552]190
191dnl Checks for header files.
[684]192AC_HEADER_DIRENT
[552]193AC_HEADER_STDC
[10181]194AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
[684]195AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
196AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
197AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
[552]198
[684]199dnl Checks for library functions.
200AC_FUNC_ALLOCA
201AC_PROG_GCC_TRADITIONAL
202AC_TYPE_SIGNAL
203AC_FUNC_VPRINTF
[786]204AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
[684]205AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
[552]206
[3705]207dnl see if gettext is in libc. (try the textdomain() function).
[8202]208AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
[552]209
[684]210# *** Custom checking (based on GNU tar configure.in) ***
211# ---------------------------------------------------------------------------
212AC_MSG_CHECKING(for HP-UX needing gmalloc)
213if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
214 AC_MSG_RESULT(yes)
[8756]215 AC_LIBOBJ([gmalloc])
[684]216 AC_DEFINE(HAVE_VALLOC)
217else
218 AC_MSG_RESULT(no)
219 AC_CHECK_FUNCS(valloc)
220fi
221
[8183]222# we cannot generate static libraries under Darwin
223AC_MSG_CHECKING(for Apple MacOS X/Darwin)
224if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
225 AC_MSG_RESULT(yes)
[8199]226 STATIC=""
[8183]227else
228 AC_MSG_RESULT(no)
[8199]229 STATIC="-static "
[8183]230fi
231AC_SUBST(STATIC)
232
[684]233fp_WITH_DMALLOC
234fp_WITH_REGEX
235
236# ---------------------------------------------------------------------------
237if test "$ac_cv_func_alloca" = 'no'; then
238dnl support functions for alloca.c
[8756]239 AC_LIBOBJ([xmalloc])
240 AC_LIBOBJ([error])
[684]241fi
242
243
244# ---------------------------------------------------------------------------
245
[552]246dnl
[684]247dnl Switch into C++
248dnl
249AC_LANG_CPLUSPLUS
250
251dnl
252dnl Check that the GDBM library is available
253dnl
[2279]254dnl check libgdbm manually, in case it's not in the standard location.
255
256AC_MSG_CHECKING(that the GDBM library is available)
[2470]257if test ! -z "$gdbmdir" ; then
[2279]258 # look in given directory for header file
[2884]259 if test -r $gdbmdir/include/gdbm.h ; then
[2279]260 GDBM_INCLUDE="-I$gdbmdir/include" ;
[2884]261 elif test -r $gdbmdir/gdbm.h ; then
[2279]262 GDBM_INCLUDE="-I$gdbmdir" ;
263 fi
264
265 # look in given directory for library
[2884]266 if test -r $gdbmdir/libgdbm.a ; then
[2279]267 GDBM_LIBPATH="-L$gdbmdir" ;
[2884]268 elif test -r $gdbmdir/lib/libgdbm.a ; then
[2279]269 GDBM_LIBPATH="-L$gdbmdir/lib" ;
[2884]270 elif test -r $gdbmdir/.libs/libgdbm.a ; then
[2279]271 GDBM_LIBPATH="-L$gdbmdir/.libs" ;
272 fi
273
[2470]274 if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
[2279]275 AC_MSG_RESULT($gdbmdir) ;
276 else
[2603]277 AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
[2279]278 AC_MSG_CHECKING( looking for GDBM library in default locations)
279 fi
280fi
281
[2603]282# look in default path and in /usr/local
[2470]283if test -z "$GDBM_INCLUDE" ; then
[2279]284 # try in system directory
285 AC_TRY_COMPILE(
286 [#include <gdbm.h>
[684]287],
[2279]288 [],
289 success=yes,
290 success=no
291 )
[2603]292
293 if test $success = "no"; then
294# last chance - look in /usr/local (eg FreeBSD)
295 GDBM_LIBPATH=-L/usr/local/lib
296 GDBM_INCLUDE=-I/usr/local/include
297 ac_save_CXXFLAGS="$CXXFLAGS"
298 ac_save_LIBS="$LIBS"
299 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
300 LIBS="$LIBS -L/usr/local/lib -lgdbm"
301 AC_TRY_LINK(
302 [#include <gdbm.h>
303#include <stdio.h>
304 ],
305 [printf("%s",gdbm_version);],
306 success=/usr/local,
307 success=no
308 )
309 CXXFLAGS=$ac_save_CXXFLAGS
310 LIBS=$ac_save_LIBS
311 fi
312
[2279]313 AC_MSG_RESULT($success)
314 if test $success = "no"; then
315 AC_MSG_ERROR(GDBM Library not available - cannot install)
316 fi
[684]317fi
[2603]318dnl I don't think anything actually checks this define, but...
319AC_DEFINE(HAVE_LIBGDBM , 1)
[684]320
[2279]321AC_SUBST(GDBM_LIBPATH)
322AC_SUBST(GDBM_INCLUDE)
323
[684]324dnl
325dnl Now check that Perl is actually around, and can be found
326dnl
[2279]327AC_MSG_CHECKING(that Perl 5 is available)
[684]328success="no"
329pl_path="$PATH"
330IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
331for pl_dir in $pl_path; do
332 test -z "$pl_dir" && pl_dir=.
333 if test -x $pl_dir/perl; then
334 success="yes"
335 break
336 fi
337done
338IFS="$pl_save_ifs"
339
340dnl
341dnl Perl actually can be run; now we see if it is version 5 by
342dnl running a sample script (which returns a "clean" version number
343dnl and then tests the result using expr. If perl errors in some
344dnl way (eg. broken Perl executable, missing script), we set a failure
345dnl value ("0") and then proceed as best we can
346dnl
347if test $success = "yes"; then
348try=`perl configtest.pl` || try="0"
349try=`expr $try \> 5.000`
350if test $try = "1"; then
351AC_MSG_RESULT("yes")
352else
353success="no"
354fi
355fi
356
357if test $success = "no"; then
358AC_MSG_RESULT("no")
359AC_MSG_ERROR("Perl 5 not available - cannot install")
360fi
361
362dnl
[552]363dnl Check if the STL library has any known faults;
364dnl In GCC 2.7.2.x series, some STL library headers are missing
365dnl a file called "new" which is referred to by other headers
366dnl (eg. vector/vector.h); if this applies, then all use of the
367dnl STL will cause a compile fail, so we'd better let the user
368dnl know now, before things really go wrong!
369dnl
370success=no
371AC_MSG_CHECKING("whether STL library has known faults")
372
373dnl - first shot, try simple good old vector on its own
374AC_TRY_COMPILE(
375[#include <vector>
376],
377[],
378success=yes,
379)
380
381dnl - try using the .h equivalent
382if test $success = "no"; then
383AC_TRY_COMPILE(
384[#include <vector.h>
385],
386[],
387success="yes",
388)
389fi
390
391dnl - now try for the objectspace headers
392if test $success = "no"; then
393AC_TRY_COMPILE(
394[#include <ospace\\std\\vector>
395],
396[],
397success="yes",
398)
399fi
400
401if test $success = yes; then
402AC_MSG_RESULT("no")
403else
404AC_MSG_RESULT("yes")
[684]405AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
[552]406fi
407
[2950]408gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
[2951]409# check for running bash under cygwin
410 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
411 then
412 gsdlos=windows
413 fi
[557]414AC_SUBST(gsdlos)
415
[10856]416# check for endianness
417AC_C_BIGENDIAN
[684]418# ---------------------------------------------------------------------------
419if test "$ac_cv_func_alloca" = 'no'; then
420dnl support functions for alloca.c
[8756]421 AC_LIBOBJ([xmalloc.o])
422 AC_LIBOBJ([error])
[684]423fi
[552]424
[3062]425# ---------------------------------------------------------------------------
[552]426
[3062]427dnl
428dnl Locate all children of the modules folder
429dnl
430moduleDirs=""
431MODULEDIRS=""
[15300]432if [ -d modules ] ; then
433 for x in `find modules -mindepth 1 -maxdepth 2`; do
434 if test -d "$x"; then
435 d="$x/Makefile.in"
436 if test -e "$d"; then
437 dnl echo $d
438 moduleDirs="$moduleDirs $x/Makefile"
439 MODULEDIRS="$MODULEDIRS $x"
440 fi
[3062]441 fi
[15300]442 done
443 echo "Making $moduleDirs in modules directory"
444 AC_SUBST(MODULEDIRS)
445fi
[3062]446
[15300]447
[684]448# ---------------------------------------------------------------------------
[2279]449dnl for Darwin, as our packages don't (yet) correctly guess our system type.
[8202]450dnl not needed any more?
451dnl ac_configure_args="$ac_configure_args --build=$build --target=$target"
[1668]452
[13777]453# indexers needs a bindir option to get the binaries into the right place
454gsdlprefix=`pwd`
455ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos "
456AC_CONFIG_SUBDIRS(packages indexers)
457
[3062]458# the list of folders in the src folder
[15907]459srclist="src/lib/Makefile \
460 src/hashfile/Makefile \
461 src/colservr/Makefile \
462 src/corba/Makefile \
463 src/protocol/Makefile \
464 src/recpt/Makefile \
465 src/gdbmedit/db2txt/Makefile \
466 src/gdbmedit/txt2db/Makefile \
467 src/oaiservr/Makefile \
468 src/z3950/Makefile \
469 src/getpw/Makefile \
470 src/phind/generate/Makefile"
[3062]471
[15907]472AC_OUTPUT(packages/Makefile Makefile $srclist $moduleDirs)
[684]473
474
Note: See TracBrowser for help on using the repository browser.