source: trunk/gsdl/configure.in@ 2279

Last change on this file since 2279 was 2279, checked in by jrm21, 23 years ago

configure now allows an argument to give a path to non-std location of gdbm library.
Other changes to allow darwin (Mac OS X) support include adding config.* to guess the system type.

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