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