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 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
60 | AC_AIX
|
---|
61 | AC_ISC_POSIX
|
---|
62 | AC_MINIX
|
---|
63 | fp_C_PROTOTYPES
|
---|
64 | AC_C_CONST
|
---|
65 | AC_TYPE_OFF_T
|
---|
66 | AC_TYPE_SIZE_T
|
---|
67 | AC_HEADER_TIME
|
---|
68 | AC_STRUCT_TM
|
---|
69 |
|
---|
70 | dnl --- This should be in the stdc checking -----------------
|
---|
71 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
72 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
73 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
74 | dnl XOPEN extensions (like popen).
|
---|
75 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
76 | dnl needs. So drop back to -Xa
|
---|
77 | AC_TRY_COMPILE(
|
---|
78 | [#include <stdio.h>
|
---|
79 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
80 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
81 | fi
|
---|
82 | dnl ----------------------
|
---|
83 |
|
---|
84 |
|
---|
85 | dnl Checks for libraries.
|
---|
86 | dnl Replace `main' with a function in -lg:
|
---|
87 | AC_CHECK_LIB(g, main)
|
---|
88 | dnl Replace `main' with a function in -lgdbm:
|
---|
89 | AC_CHECK_LIB(gdbm, main)
|
---|
90 | dnl Replace `main' with a function in -lm:
|
---|
91 | AC_CHECK_LIB(m, main)
|
---|
92 | dnl Replace `main' with a function in -lstdc++:
|
---|
93 | AC_CHECK_LIB(stdc++, main)
|
---|
94 | dnl Replace `main' with a function in -lcrypt:
|
---|
95 | AC_CHECK_LIB(crypt, main)
|
---|
96 |
|
---|
97 |
|
---|
98 | dnl Checks for header files.
|
---|
99 | AC_HEADER_DIRENT
|
---|
100 | AC_HEADER_STDC
|
---|
101 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
|
---|
102 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
103 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
104 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
105 |
|
---|
106 | dnl Checks for library functions.
|
---|
107 | AC_FUNC_ALLOCA
|
---|
108 | AC_PROG_GCC_TRADITIONAL
|
---|
109 | AC_TYPE_SIGNAL
|
---|
110 | AC_FUNC_VPRINTF
|
---|
111 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
112 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
113 |
|
---|
114 |
|
---|
115 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
116 | # ---------------------------------------------------------------------------
|
---|
117 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
118 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
119 | AC_MSG_RESULT(yes)
|
---|
120 | LIBOBJS="$LIBOBJS gmalloc.o"
|
---|
121 | AC_DEFINE(HAVE_VALLOC)
|
---|
122 | else
|
---|
123 | AC_MSG_RESULT(no)
|
---|
124 | AC_CHECK_FUNCS(valloc)
|
---|
125 | fi
|
---|
126 |
|
---|
127 | fp_WITH_DMALLOC
|
---|
128 | fp_WITH_REGEX
|
---|
129 |
|
---|
130 | # ---------------------------------------------------------------------------
|
---|
131 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
132 | dnl support functions for alloca.c
|
---|
133 | LIBOBJS="$LIBOBJS xmalloc.o error.o"
|
---|
134 | fi
|
---|
135 |
|
---|
136 |
|
---|
137 | # ---------------------------------------------------------------------------
|
---|
138 |
|
---|
139 | dnl
|
---|
140 | dnl Switch into C++
|
---|
141 | dnl
|
---|
142 | AC_LANG_CPLUSPLUS
|
---|
143 |
|
---|
144 | dnl
|
---|
145 | dnl Check that the GDBM library is available
|
---|
146 | dnl
|
---|
147 | AC_MSG_CHECKING("that the GDBM library is available")
|
---|
148 | AC_TRY_COMPILE(
|
---|
149 | [#include <gdbm.h>
|
---|
150 | ],
|
---|
151 | [],
|
---|
152 | success=yes,
|
---|
153 | success=no
|
---|
154 | )
|
---|
155 | AC_MSG_RESULT($success)
|
---|
156 | if test $success = "no"; then
|
---|
157 | AC_MSG_ERROR("GDBM Library not available - cannot install")
|
---|
158 | fi
|
---|
159 |
|
---|
160 | dnl
|
---|
161 | dnl Now check that Perl is actually around, and can be found
|
---|
162 | dnl
|
---|
163 | AC_MSG_CHECKING("that Perl 5 is available")
|
---|
164 | success="no"
|
---|
165 | pl_path="$PATH"
|
---|
166 | IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
|
---|
167 | for pl_dir in $pl_path; do
|
---|
168 | test -z "$pl_dir" && pl_dir=.
|
---|
169 | if test -x $pl_dir/perl; then
|
---|
170 | success="yes"
|
---|
171 | break
|
---|
172 | fi
|
---|
173 | done
|
---|
174 | IFS="$pl_save_ifs"
|
---|
175 |
|
---|
176 | dnl
|
---|
177 | dnl Perl actually can be run; now we see if it is version 5 by
|
---|
178 | dnl running a sample script (which returns a "clean" version number
|
---|
179 | dnl and then tests the result using expr. If perl errors in some
|
---|
180 | dnl way (eg. broken Perl executable, missing script), we set a failure
|
---|
181 | dnl value ("0") and then proceed as best we can
|
---|
182 | dnl
|
---|
183 | if test $success = "yes"; then
|
---|
184 | try=`perl configtest.pl` || try="0"
|
---|
185 | try=`expr $try \> 5.000`
|
---|
186 | if test $try = "1"; then
|
---|
187 | AC_MSG_RESULT("yes")
|
---|
188 | else
|
---|
189 | success="no"
|
---|
190 | fi
|
---|
191 | fi
|
---|
192 |
|
---|
193 | if test $success = "no"; then
|
---|
194 | AC_MSG_RESULT("no")
|
---|
195 | AC_MSG_ERROR("Perl 5 not available - cannot install")
|
---|
196 | fi
|
---|
197 |
|
---|
198 | dnl
|
---|
199 | dnl Check if the STL library has any known faults;
|
---|
200 | dnl In GCC 2.7.2.x series, some STL library headers are missing
|
---|
201 | dnl a file called "new" which is referred to by other headers
|
---|
202 | dnl (eg. vector/vector.h); if this applies, then all use of the
|
---|
203 | dnl STL will cause a compile fail, so we'd better let the user
|
---|
204 | dnl know now, before things really go wrong!
|
---|
205 | dnl
|
---|
206 | success=no
|
---|
207 | AC_MSG_CHECKING("whether STL library has known faults")
|
---|
208 |
|
---|
209 | dnl - first shot, try simple good old vector on its own
|
---|
210 | AC_TRY_COMPILE(
|
---|
211 | [#include <vector>
|
---|
212 | ],
|
---|
213 | [],
|
---|
214 | success=yes,
|
---|
215 | )
|
---|
216 |
|
---|
217 | dnl - try using the .h equivalent
|
---|
218 | if test $success = "no"; then
|
---|
219 | AC_TRY_COMPILE(
|
---|
220 | [#include <vector.h>
|
---|
221 | ],
|
---|
222 | [],
|
---|
223 | success="yes",
|
---|
224 | )
|
---|
225 | fi
|
---|
226 |
|
---|
227 | dnl - now try for the objectspace headers
|
---|
228 | if test $success = "no"; then
|
---|
229 | AC_TRY_COMPILE(
|
---|
230 | [#include <ospace\\std\\vector>
|
---|
231 | ],
|
---|
232 | [],
|
---|
233 | success="yes",
|
---|
234 | )
|
---|
235 | fi
|
---|
236 |
|
---|
237 | if test $success = yes; then
|
---|
238 | AC_MSG_RESULT("no")
|
---|
239 | else
|
---|
240 | AC_MSG_RESULT("yes")
|
---|
241 | AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
|
---|
242 | fi
|
---|
243 |
|
---|
244 | gsdlos=`uname | tr A-Z a-z`
|
---|
245 | AC_SUBST(gsdlos)
|
---|
246 |
|
---|
247 | # ---------------------------------------------------------------------------
|
---|
248 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
249 | dnl support functions for alloca.c
|
---|
250 | LIBOBJS="$LIBOBJS xmalloc.o error.o"
|
---|
251 | fi
|
---|
252 |
|
---|
253 |
|
---|
254 | # ---------------------------------------------------------------------------
|
---|
255 |
|
---|
256 | AC_CONFIG_SUBDIRS(packages)
|
---|
257 |
|
---|
258 | AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
|
---|
259 | packages/mg/src/scripts/Makefile packages/mg/lib/Makefile src/mgpp/Makefile
|
---|
260 | src/mgpp/lib/Makefile src/mgpp/text/Makefile
|
---|
261 | src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile
|
---|
262 | src/db2txt/Makefile lib/Makefile Makefile src/getpw/Makefile
|
---|
263 | src/phind/generate/Makefile src/phind/host/Makefile)
|
---|
264 |
|
---|
265 |
|
---|
266 |
|
---|