source: main/tags/2.35a/gsdl/configure.in@ 33178

Last change on this file since 33178 was 2521, checked in by sjboddie, 23 years ago

no longer compile src/phind/host separately (it no longer exists)

  • 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
21dnl
22dnl Set use of corba
23dnl
24AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
25AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
26AC_SUBST(USE_CORBA)
27
28AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
29AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
30AC_SUBST(MICO_DIR)
31
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)
36if test USE_Z3950 = 1; then
37AC_DEFINE(USE_Z3950, $USE_Z3950)
38AC_SUBST(USE_Z3950)
39fi
40
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
48dnl Checks for programs.
49LDFLAGS=
50dnl only set CFLAGS if not already set in environment
51if test -z "$CFLAGS"; then
52CFLAGS=-O2
53fi
54AC_SUBST(CFLAGS)
55
56AC_PROG_CC
57AC_PROG_CXX
58AC_PROG_AWK
59AC_PROG_YACC
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
65AC_PROG_INSTALL
66AC_PROG_LN_S
67AC_PROG_MAKE_SET
68AC_PROG_RANLIB
69
70
71#moved CORBA MICO directory test to get version of MICO
72if test $USE_CORBA = 1; then
73
74if test $MICO_DIR = "default"; then
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
88MICO_VER=`./micotest` || MICO_VER=2.3.5
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
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
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)
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)
137
138
139dnl Checks for header files.
140AC_HEADER_DIRENT
141AC_HEADER_STDC
142AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
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))
146
147dnl Checks for library functions.
148AC_FUNC_ALLOCA
149AC_PROG_GCC_TRADITIONAL
150AC_TYPE_SIGNAL
151AC_FUNC_VPRINTF
152AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
153AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
154
155
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
180dnl
181dnl Switch into C++
182dnl
183AC_LANG_CPLUSPLUS
184
185dnl
186dnl Check that the GDBM library is available
187dnl
188dnl check libgdbm manually, in case it's not in the standard location.
189
190AC_MSG_CHECKING(that the GDBM library is available)
191if test ! -z "$gdbmdir" ; then
192 # look in given directory for header file
193 if test -e $gdbmdir/include/gdbm.h ; then
194 GDBM_INCLUDE="-I$gdbmdir/include" ;
195 elif test -e $gdbmdir/gdbm.h ; then
196 GDBM_INCLUDE="-I$gdbmdir" ;
197 fi
198
199 # look in given directory for library
200 if test -e $gdbmdir/libgdbm.a ; then
201 GDBM_LIBPATH="-L$gdbmdir" ;
202 elif test -e $gdbmdir/lib/libgdbm.a ; then
203 GDBM_LIBPATH="-L$gdbmdir/lib" ;
204 elif test -e $gdbmdir/.libs/libgdbm.a ; then
205 GDBM_LIBPATH="-L$gdbmdir/.libs" ;
206 fi
207
208 if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
209 AC_MSG_RESULT($gdbmdir) ;
210 AC_DEFINE(HAVE_LIBGDBM , 1)
211 else
212 AC_MSG_RESULT(can't find both gdbm.h and libgdbm.a in $gdbmdir);
213 AC_MSG_CHECKING( looking for GDBM library in default locations)
214 fi
215fi
216
217if test -z "$GDBM_INCLUDE" ; then
218 # try in system directory
219 AC_TRY_COMPILE(
220 [#include <gdbm.h>
221],
222 [],
223 success=yes,
224 success=no
225 )
226 AC_MSG_RESULT($success)
227 if test $success = "no"; then
228 AC_MSG_ERROR(GDBM Library not available - cannot install)
229 fi
230 GDBM_LIBPATH=
231 GDBM_INCLUDE=
232fi
233
234AC_SUBST(GDBM_LIBPATH)
235AC_SUBST(GDBM_INCLUDE)
236
237dnl
238dnl Now check that Perl is actually around, and can be found
239dnl
240AC_MSG_CHECKING(that Perl 5 is available)
241success="no"
242pl_path="$PATH"
243IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
244for pl_dir in $pl_path; do
245 test -z "$pl_dir" && pl_dir=.
246 if test -x $pl_dir/perl; then
247 success="yes"
248 break
249 fi
250done
251IFS="$pl_save_ifs"
252
253dnl
254dnl Perl actually can be run; now we see if it is version 5 by
255dnl running a sample script (which returns a "clean" version number
256dnl and then tests the result using expr. If perl errors in some
257dnl way (eg. broken Perl executable, missing script), we set a failure
258dnl value ("0") and then proceed as best we can
259dnl
260if test $success = "yes"; then
261try=`perl configtest.pl` || try="0"
262try=`expr $try \> 5.000`
263if test $try = "1"; then
264AC_MSG_RESULT("yes")
265else
266success="no"
267fi
268fi
269
270if test $success = "no"; then
271AC_MSG_RESULT("no")
272AC_MSG_ERROR("Perl 5 not available - cannot install")
273fi
274
275dnl
276dnl Check if the STL library has any known faults;
277dnl In GCC 2.7.2.x series, some STL library headers are missing
278dnl a file called "new" which is referred to by other headers
279dnl (eg. vector/vector.h); if this applies, then all use of the
280dnl STL will cause a compile fail, so we'd better let the user
281dnl know now, before things really go wrong!
282dnl
283success=no
284AC_MSG_CHECKING("whether STL library has known faults")
285
286dnl - first shot, try simple good old vector on its own
287AC_TRY_COMPILE(
288[#include <vector>
289],
290[],
291success=yes,
292)
293
294dnl - try using the .h equivalent
295if test $success = "no"; then
296AC_TRY_COMPILE(
297[#include <vector.h>
298],
299[],
300success="yes",
301)
302fi
303
304dnl - now try for the objectspace headers
305if test $success = "no"; then
306AC_TRY_COMPILE(
307[#include <ospace\\std\\vector>
308],
309[],
310success="yes",
311)
312fi
313
314if test $success = yes; then
315AC_MSG_RESULT("no")
316else
317AC_MSG_RESULT("yes")
318AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
319fi
320
321gsdlos=`uname | tr A-Z a-z`
322AC_SUBST(gsdlos)
323
324# ---------------------------------------------------------------------------
325if test "$ac_cv_func_alloca" = 'no'; then
326dnl support functions for alloca.c
327 LIBOBJS="$LIBOBJS xmalloc.o error.o"
328fi
329
330
331# ---------------------------------------------------------------------------
332dnl for Darwin, as our packages don't (yet) correctly guess our system type.
333ac_configure_args="$ac_configure_args --host=$host --target=$target"
334AC_CONFIG_SUBDIRS(packages)
335
336AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
337 packages/mg/src/scripts/Makefile packages/mg/lib/Makefile src/mgpp/Makefile
338 src/mgpp/lib/Makefile src/mgpp/text/Makefile
339 src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile
340 src/db2txt/Makefile lib/Makefile Makefile src/getpw/Makefile
341 src/phind/generate/Makefile)
342
343
344
Note: See TracBrowser for help on using the repository browser.