source: trunk/gsdl/configure.in@ 686

Last change on this file since 686 was 684, checked in by cs025, 25 years ago

Changes to build MG into autoconfiguration.

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