source: main/tags/3.03/gsdl/configure.in@ 21154

Last change on this file since 21154 was 14169, checked in by mdewsnip, 17 years ago

Changed ICONV to iconv so this works on Solaris and other non-Linux machines, and fixed LDFLAGS so you can set it as an option to ./configure.

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