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