source: trunk/gsdl/configure.in@ 12601

Last change on this file since 12601 was 12492, checked in by kjdon, 18 years ago

added a new flag: disable-yaz. yaz is now compiled by default (for use with downloading in GLI), but z3950 support in greenstone library is still left under the control of --enable-z3950. the disable-yaz flag turns off the compilation of yaz for those compiling from source if they don't need it

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