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