source: main/tags/2.53/gsdl/configure.in@ 32727

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

added a comment at the top about autoconf versions

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