source: trunk/gsdl/configure.in@ 8756

Last change on this file since 8756 was 8756, checked in by jrm21, 19 years ago

fixes for autoconf v2.59, remove libstdc++ from ACLIBS since we don't
want it passed to $CC for c things like mg

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