source: tags/gsdl-2_52-distribution/gsdl/configure.in@ 8390

Last change on this file since 8390 was 8202, checked in by jrm21, 20 years ago

don't need host and target set anymore (since it works properly on darwin
now).

remove spaces around ' gettext ' in a test.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.4 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 Replace `main' with a function in -lg:
134AC_CHECK_LIB(g, main)
135dnl Replace `main' with a function in -lgdbm:
136AC_CHECK_LIB(gdbm, main)
137dnl Replace `main' with a function in -lm:
138AC_CHECK_LIB(m, main)
139dnl Replace `main' with a function in -lstdc++:
140AC_CHECK_LIB(stdc++, main)
141dnl Replace `main' with a function in -lcrypt:
142AC_CHECK_LIB(crypt, main)
143
144
145dnl Checks for header files.
146AC_HEADER_DIRENT
147AC_HEADER_STDC
148AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
149AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
150AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
151AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
152
153dnl Checks for library functions.
154AC_FUNC_ALLOCA
155AC_PROG_GCC_TRADITIONAL
156AC_TYPE_SIGNAL
157AC_FUNC_VPRINTF
158AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
159AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
160
161dnl see if gettext is in libc. (try the textdomain() function).
162AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
163
164# *** Custom checking (based on GNU tar configure.in) ***
165# ---------------------------------------------------------------------------
166AC_MSG_CHECKING(for HP-UX needing gmalloc)
167if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
168 AC_MSG_RESULT(yes)
169 LIBOBJS="$LIBOBJS gmalloc.o"
170 AC_DEFINE(HAVE_VALLOC)
171else
172 AC_MSG_RESULT(no)
173 AC_CHECK_FUNCS(valloc)
174fi
175
176# we cannot generate static libraries under Darwin
177AC_MSG_CHECKING(for Apple MacOS X/Darwin)
178if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
179 AC_MSG_RESULT(yes)
180 STATIC=""
181else
182 AC_MSG_RESULT(no)
183 STATIC="-static "
184fi
185AC_SUBST(STATIC)
186
187fp_WITH_DMALLOC
188fp_WITH_REGEX
189
190# ---------------------------------------------------------------------------
191if test "$ac_cv_func_alloca" = 'no'; then
192dnl support functions for alloca.c
193 LIBOBJS="$LIBOBJS xmalloc.o error.o"
194fi
195
196
197# ---------------------------------------------------------------------------
198
199dnl
200dnl Switch into C++
201dnl
202AC_LANG_CPLUSPLUS
203
204dnl
205dnl Check that the GDBM library is available
206dnl
207dnl check libgdbm manually, in case it's not in the standard location.
208
209AC_MSG_CHECKING(that the GDBM library is available)
210if test ! -z "$gdbmdir" ; then
211 # look in given directory for header file
212 if test -r $gdbmdir/include/gdbm.h ; then
213 GDBM_INCLUDE="-I$gdbmdir/include" ;
214 elif test -r $gdbmdir/gdbm.h ; then
215 GDBM_INCLUDE="-I$gdbmdir" ;
216 fi
217
218 # look in given directory for library
219 if test -r $gdbmdir/libgdbm.a ; then
220 GDBM_LIBPATH="-L$gdbmdir" ;
221 elif test -r $gdbmdir/lib/libgdbm.a ; then
222 GDBM_LIBPATH="-L$gdbmdir/lib" ;
223 elif test -r $gdbmdir/.libs/libgdbm.a ; then
224 GDBM_LIBPATH="-L$gdbmdir/.libs" ;
225 fi
226
227 if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
228 AC_MSG_RESULT($gdbmdir) ;
229 else
230 AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
231 AC_MSG_CHECKING( looking for GDBM library in default locations)
232 fi
233fi
234
235# look in default path and in /usr/local
236if test -z "$GDBM_INCLUDE" ; then
237 # try in system directory
238 AC_TRY_COMPILE(
239 [#include <gdbm.h>
240],
241 [],
242 success=yes,
243 success=no
244 )
245
246 if test $success = "no"; then
247# last chance - look in /usr/local (eg FreeBSD)
248 GDBM_LIBPATH=-L/usr/local/lib
249 GDBM_INCLUDE=-I/usr/local/include
250 ac_save_CXXFLAGS="$CXXFLAGS"
251 ac_save_LIBS="$LIBS"
252 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
253 LIBS="$LIBS -L/usr/local/lib -lgdbm"
254 AC_TRY_LINK(
255 [#include <gdbm.h>
256#include <stdio.h>
257 ],
258 [printf("%s",gdbm_version);],
259 success=/usr/local,
260 success=no
261 )
262 CXXFLAGS=$ac_save_CXXFLAGS
263 LIBS=$ac_save_LIBS
264 fi
265
266 AC_MSG_RESULT($success)
267 if test $success = "no"; then
268 AC_MSG_ERROR(GDBM Library not available - cannot install)
269 fi
270fi
271dnl I don't think anything actually checks this define, but...
272AC_DEFINE(HAVE_LIBGDBM , 1)
273
274AC_SUBST(GDBM_LIBPATH)
275AC_SUBST(GDBM_INCLUDE)
276
277dnl
278dnl Now check that Perl is actually around, and can be found
279dnl
280AC_MSG_CHECKING(that Perl 5 is available)
281success="no"
282pl_path="$PATH"
283IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
284for pl_dir in $pl_path; do
285 test -z "$pl_dir" && pl_dir=.
286 if test -x $pl_dir/perl; then
287 success="yes"
288 break
289 fi
290done
291IFS="$pl_save_ifs"
292
293dnl
294dnl Perl actually can be run; now we see if it is version 5 by
295dnl running a sample script (which returns a "clean" version number
296dnl and then tests the result using expr. If perl errors in some
297dnl way (eg. broken Perl executable, missing script), we set a failure
298dnl value ("0") and then proceed as best we can
299dnl
300if test $success = "yes"; then
301try=`perl configtest.pl` || try="0"
302try=`expr $try \> 5.000`
303if test $try = "1"; then
304AC_MSG_RESULT("yes")
305else
306success="no"
307fi
308fi
309
310if test $success = "no"; then
311AC_MSG_RESULT("no")
312AC_MSG_ERROR("Perl 5 not available - cannot install")
313fi
314
315dnl
316dnl Check if the STL library has any known faults;
317dnl In GCC 2.7.2.x series, some STL library headers are missing
318dnl a file called "new" which is referred to by other headers
319dnl (eg. vector/vector.h); if this applies, then all use of the
320dnl STL will cause a compile fail, so we'd better let the user
321dnl know now, before things really go wrong!
322dnl
323success=no
324AC_MSG_CHECKING("whether STL library has known faults")
325
326dnl - first shot, try simple good old vector on its own
327AC_TRY_COMPILE(
328[#include <vector>
329],
330[],
331success=yes,
332)
333
334dnl - try using the .h equivalent
335if test $success = "no"; then
336AC_TRY_COMPILE(
337[#include <vector.h>
338],
339[],
340success="yes",
341)
342fi
343
344dnl - now try for the objectspace headers
345if test $success = "no"; then
346AC_TRY_COMPILE(
347[#include <ospace\\std\\vector>
348],
349[],
350success="yes",
351)
352fi
353
354if test $success = yes; then
355AC_MSG_RESULT("no")
356else
357AC_MSG_RESULT("yes")
358AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
359fi
360
361gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
362# check for running bash under cygwin
363 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
364 then
365 gsdlos=windows
366 fi
367AC_SUBST(gsdlos)
368
369# ---------------------------------------------------------------------------
370if test "$ac_cv_func_alloca" = 'no'; then
371dnl support functions for alloca.c
372 LIBOBJS="$LIBOBJS xmalloc.o error.o"
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.