source: trunk/gsdl/configure.in@ 1722

Last change on this file since 1722 was 1722, checked in by jrm21, 23 years ago

Check to see if CFLAGS is already set in environment, and if so, don't
override

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