source: trunk/gsdl/configure.in@ 13928

Last change on this file since 13928 was 13777, checked in by kjdon, 17 years ago

merged the indexers branch. mg, mgpp, lucene and unac now live in indexers repository

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