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