source: gsdl/trunk/configure.in@ 20853

Last change on this file since 20853 was 20853, checked in by ak19, 15 years ago

Katherine has made changes to the toplevel configure.in and runtime-src configure.in (and their configure) files to fix the recent problem of Oran and Dr Bainbridge's code changes not working together: Oran's code successfully got the libexpat and libiconv libraries statically linked into library.cgi while Dr Bainbridge got the apache web server code to statically link successfully against the libiconv library in common-src. However, Oran's changes when included would cause compilation to fail to generate the apache-httpd output folder (it wasn't being compiled up in fact). Katherine's changes now allow it all to work together.

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