source: trunk/gsdl/configure.in@ 12601

Last change on this file since 12601 was 12492, checked in by kjdon, 18 years ago

added a new flag: disable-yaz. yaz is now compiled by default (for use with downloading in GLI), but z3950 support in greenstone library is still left under the control of --enable-z3950. the disable-yaz flag turns off the compilation of yaz for those compiling from source if they don't need it

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