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