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