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