source: gsdl/trunk/configure.in@ 18214

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