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