source: main/tags/2.11/gsdl/configure.in@ 21107

Last change on this file since 21107 was 794, checked in by sjboddie, 24 years ago

turned on optimization, added LDFLAGS in case required

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