source: trunk/gsdl/configure.in@ 2907

Last change on this file since 2907 was 2884, checked in by jrm21, 22 years ago

replaced "test -e" with "test -r" as some versions of solaris test don't
have the -e option. (In added tests for gdbm).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 9.2 KB
RevLine 
[552]1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(lib/text_t.h)
[684]3AC_CONFIG_HEADER(config.h)
[552]4
[554]5PACKAGE=gsdl
[674]6VERSION=2.1
[552]7AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
8AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
9AC_SUBST(PACKAGE)
10AC_SUBST(VERSION)
[567]11
[1860]12dnl
13dnl Set use of fast cgi
14dnl
[566]15USE_FASTCGI=0
16if test USE_FASTCGI = 1; then
17AC_DEFINE(USE_FASTCGI)
18AC_SUBST(USE_FASTCGI)
19fi
[552]20
[1860]21dnl
22dnl Set use of corba
23dnl
[2470]24AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
[2296]25AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
[2051]26AC_SUBST(USE_CORBA)
[1860]27
[2470]28AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
[2296]29AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
[2051]30AC_SUBST(MICO_DIR)
[1860]31
[1938]32dnl
33dnl Set use of z39.50
34dnl
35AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=1, USE_Z3950=0)
[2296]36if test USE_Z3950 = 1; then
37AC_DEFINE(USE_Z3950, $USE_Z3950)
[1938]38AC_SUBST(USE_Z3950)
[2296]39fi
[1938]40
[2279]41dnl
42dnl look for libgdbm if not in standard location
43dnl
44AC_ARG_WITH(gdbm, [ --with-gdbm=dir Use local gdbm library and headers], gdbmdir=$withval)
45
46
47
[552]48dnl Checks for programs.
[794]49LDFLAGS=
[1722]50dnl only set CFLAGS if not already set in environment
51if test -z "$CFLAGS"; then
[794]52CFLAGS=-O2
[1722]53fi
[575]54AC_SUBST(CFLAGS)
55
[552]56AC_PROG_CC
57AC_PROG_CXX
[684]58AC_PROG_AWK
59AC_PROG_YACC
[2279]60dnl get $target_cpu, $target_vendor, and $target_os
61dnl (as well as host_*)
62AC_CANONICAL_SYSTEM
63dnl do we actually want this? It adds a prefix based on host, system etc
64dnl AC_ARG_PROGRAM
[703]65AC_PROG_INSTALL
[552]66AC_PROG_LN_S
67AC_PROG_MAKE_SET
68AC_PROG_RANLIB
69
[684]70
[2173]71#moved CORBA MICO directory test to get version of MICO
72if test $USE_CORBA = 1; then
73
[2213]74if test $MICO_DIR = "default"; then
[2173]75#do something
76MICO_INC="-I packages/mico/mico/include"
77else
78#build the micotest program
79MICO_INC= ""
80if test $MICO_DIR != yes; then
81MICO_INC="-I $MICO_DIR"
82fi
83fi
84
85#get MICO_VER value
86sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
87sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
[2214]88MICO_VER=`./micotest` || MICO_VER=2.3.5
[2173]89sh -c "rm micotest"
90sh -c "rm micotest.o"
91
92#do test of MICO_VER
93if test MICO_VER != 0; then
94AC_DEFINE(MICO_VER)
95AC_SUBST(MICO_VER)
96fi
97#end USE_CORBA test
98fi
99
[684]100dnl Checks for typedefs, structures, and compiler characteristics.
101AC_AIX
102AC_ISC_POSIX
103AC_MINIX
104fp_C_PROTOTYPES
105AC_C_CONST
106AC_TYPE_OFF_T
107AC_TYPE_SIZE_T
108AC_HEADER_TIME
109AC_STRUCT_TM
110
111dnl --- This should be in the stdc checking -----------------
112if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
113dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
114dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
115dnl XOPEN extensions (like popen).
116dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
117dnl needs. So drop back to -Xa
118AC_TRY_COMPILE(
119[#include <stdio.h>
120], [ FILE *rubbish = popen("yes", "r"); ],,
121[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
122fi
123dnl ----------------------
124
125
[552]126dnl Checks for libraries.
127dnl Replace `main' with a function in -lg:
128AC_CHECK_LIB(g, main)
129dnl Replace `main' with a function in -lgdbm:
130AC_CHECK_LIB(gdbm, main)
131dnl Replace `main' with a function in -lm:
132AC_CHECK_LIB(m, main)
[986]133dnl Replace `main' with a function in -lstdc++:
134AC_CHECK_LIB(stdc++, main)
135dnl Replace `main' with a function in -lcrypt:
136AC_CHECK_LIB(crypt, main)
[552]137
[986]138
[552]139dnl Checks for header files.
[684]140AC_HEADER_DIRENT
[552]141AC_HEADER_STDC
[998]142AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
[684]143AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
144AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
145AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
[552]146
[684]147dnl Checks for library functions.
148AC_FUNC_ALLOCA
149AC_PROG_GCC_TRADITIONAL
150AC_TYPE_SIGNAL
151AC_FUNC_VPRINTF
[786]152AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
[684]153AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
[552]154
155
[684]156# *** Custom checking (based on GNU tar configure.in) ***
157# ---------------------------------------------------------------------------
158AC_MSG_CHECKING(for HP-UX needing gmalloc)
159if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
160 AC_MSG_RESULT(yes)
161 LIBOBJS="$LIBOBJS gmalloc.o"
162 AC_DEFINE(HAVE_VALLOC)
163else
164 AC_MSG_RESULT(no)
165 AC_CHECK_FUNCS(valloc)
166fi
167
168fp_WITH_DMALLOC
169fp_WITH_REGEX
170
171# ---------------------------------------------------------------------------
172if test "$ac_cv_func_alloca" = 'no'; then
173dnl support functions for alloca.c
174 LIBOBJS="$LIBOBJS xmalloc.o error.o"
175fi
176
177
178# ---------------------------------------------------------------------------
179
[552]180dnl
[684]181dnl Switch into C++
182dnl
183AC_LANG_CPLUSPLUS
184
185dnl
186dnl Check that the GDBM library is available
187dnl
[2279]188dnl check libgdbm manually, in case it's not in the standard location.
189
190AC_MSG_CHECKING(that the GDBM library is available)
[2470]191if test ! -z "$gdbmdir" ; then
[2279]192 # look in given directory for header file
[2884]193 if test -r $gdbmdir/include/gdbm.h ; then
[2279]194 GDBM_INCLUDE="-I$gdbmdir/include" ;
[2884]195 elif test -r $gdbmdir/gdbm.h ; then
[2279]196 GDBM_INCLUDE="-I$gdbmdir" ;
197 fi
198
199 # look in given directory for library
[2884]200 if test -r $gdbmdir/libgdbm.a ; then
[2279]201 GDBM_LIBPATH="-L$gdbmdir" ;
[2884]202 elif test -r $gdbmdir/lib/libgdbm.a ; then
[2279]203 GDBM_LIBPATH="-L$gdbmdir/lib" ;
[2884]204 elif test -r $gdbmdir/.libs/libgdbm.a ; then
[2279]205 GDBM_LIBPATH="-L$gdbmdir/.libs" ;
206 fi
207
[2470]208 if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
[2279]209 AC_MSG_RESULT($gdbmdir) ;
210 else
[2603]211 AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
[2279]212 AC_MSG_CHECKING( looking for GDBM library in default locations)
213 fi
214fi
215
[2603]216# look in default path and in /usr/local
[2470]217if test -z "$GDBM_INCLUDE" ; then
[2279]218 # try in system directory
219 AC_TRY_COMPILE(
220 [#include <gdbm.h>
[684]221],
[2279]222 [],
223 success=yes,
224 success=no
225 )
[2603]226
227 if test $success = "no"; then
228# last chance - look in /usr/local (eg FreeBSD)
229 GDBM_LIBPATH=-L/usr/local/lib
230 GDBM_INCLUDE=-I/usr/local/include
231 ac_save_CXXFLAGS="$CXXFLAGS"
232 ac_save_LIBS="$LIBS"
233 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
234 LIBS="$LIBS -L/usr/local/lib -lgdbm"
235 AC_TRY_LINK(
236 [#include <gdbm.h>
237#include <stdio.h>
238 ],
239 [printf("%s",gdbm_version);],
240 success=/usr/local,
241 success=no
242 )
243 CXXFLAGS=$ac_save_CXXFLAGS
244 LIBS=$ac_save_LIBS
245 fi
246
[2279]247 AC_MSG_RESULT($success)
248 if test $success = "no"; then
249 AC_MSG_ERROR(GDBM Library not available - cannot install)
250 fi
[684]251fi
[2603]252dnl I don't think anything actually checks this define, but...
253AC_DEFINE(HAVE_LIBGDBM , 1)
[684]254
[2279]255AC_SUBST(GDBM_LIBPATH)
256AC_SUBST(GDBM_INCLUDE)
257
[684]258dnl
259dnl Now check that Perl is actually around, and can be found
260dnl
[2279]261AC_MSG_CHECKING(that Perl 5 is available)
[684]262success="no"
263pl_path="$PATH"
264IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
265for pl_dir in $pl_path; do
266 test -z "$pl_dir" && pl_dir=.
267 if test -x $pl_dir/perl; then
268 success="yes"
269 break
270 fi
271done
272IFS="$pl_save_ifs"
273
274dnl
275dnl Perl actually can be run; now we see if it is version 5 by
276dnl running a sample script (which returns a "clean" version number
277dnl and then tests the result using expr. If perl errors in some
278dnl way (eg. broken Perl executable, missing script), we set a failure
279dnl value ("0") and then proceed as best we can
280dnl
281if test $success = "yes"; then
282try=`perl configtest.pl` || try="0"
283try=`expr $try \> 5.000`
284if test $try = "1"; then
285AC_MSG_RESULT("yes")
286else
287success="no"
288fi
289fi
290
291if test $success = "no"; then
292AC_MSG_RESULT("no")
293AC_MSG_ERROR("Perl 5 not available - cannot install")
294fi
295
296dnl
[552]297dnl Check if the STL library has any known faults;
298dnl In GCC 2.7.2.x series, some STL library headers are missing
299dnl a file called "new" which is referred to by other headers
300dnl (eg. vector/vector.h); if this applies, then all use of the
301dnl STL will cause a compile fail, so we'd better let the user
302dnl know now, before things really go wrong!
303dnl
304success=no
305AC_MSG_CHECKING("whether STL library has known faults")
306
307dnl - first shot, try simple good old vector on its own
308AC_TRY_COMPILE(
309[#include <vector>
310],
311[],
312success=yes,
313)
314
315dnl - try using the .h equivalent
316if test $success = "no"; then
317AC_TRY_COMPILE(
318[#include <vector.h>
319],
320[],
321success="yes",
322)
323fi
324
325dnl - now try for the objectspace headers
326if test $success = "no"; then
327AC_TRY_COMPILE(
328[#include <ospace\\std\\vector>
329],
330[],
331success="yes",
332)
333fi
334
335if test $success = yes; then
336AC_MSG_RESULT("no")
337else
338AC_MSG_RESULT("yes")
[684]339AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
[552]340fi
341
[557]342gsdlos=`uname | tr A-Z a-z`
343AC_SUBST(gsdlos)
344
[684]345# ---------------------------------------------------------------------------
346if test "$ac_cv_func_alloca" = 'no'; then
347dnl support functions for alloca.c
348 LIBOBJS="$LIBOBJS xmalloc.o error.o"
349fi
[552]350
351
[684]352# ---------------------------------------------------------------------------
[2279]353dnl for Darwin, as our packages don't (yet) correctly guess our system type.
354ac_configure_args="$ac_configure_args --host=$host --target=$target"
[1668]355AC_CONFIG_SUBDIRS(packages)
356
[1938]357AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
[1332]358 packages/mg/src/scripts/Makefile packages/mg/lib/Makefile src/mgpp/Makefile
359 src/mgpp/lib/Makefile src/mgpp/text/Makefile
[684]360 src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile
[1568]361 src/db2txt/Makefile lib/Makefile Makefile src/getpw/Makefile
[2521]362 src/phind/generate/Makefile)
[684]363
364
[1568]365
Note: See TracBrowser for help on using the repository browser.