root/main/tags/2.22/niupepa/configure.in

Revision 1077, 5.7 KB (checked in by sjboddie, 20 years ago)

added configuration stuff for niupepa collection receptionist

  • Property svn:keywords set to Author Date Id Revision
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/recpt/niupepalibrarymain.cpp)
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)
69dnl Replace `main' with a function in -lcrypt:
70AC_CHECK_LIB(crypt, main)
71
72
73dnl Checks for header files.
74AC_HEADER_DIRENT
75AC_HEADER_STDC
76AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
77AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
78AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
79AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
80
81dnl Checks for library functions.
82AC_FUNC_ALLOCA
83AC_PROG_GCC_TRADITIONAL
84AC_TYPE_SIGNAL
85AC_FUNC_VPRINTF
86AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
87AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
88
89
90# *** Custom checking (based on GNU tar configure.in) ***
91# ---------------------------------------------------------------------------
92AC_MSG_CHECKING(for HP-UX needing gmalloc)
93if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
94  AC_MSG_RESULT(yes)
95  LIBOBJS="$LIBOBJS gmalloc.o"
96  AC_DEFINE(HAVE_VALLOC)
97else
98  AC_MSG_RESULT(no)
99  AC_CHECK_FUNCS(valloc)
100fi
101
102fp_WITH_DMALLOC
103fp_WITH_REGEX
104
105# ---------------------------------------------------------------------------
106if test "$ac_cv_func_alloca" = 'no'; then
107dnl    support functions for alloca.c
108  LIBOBJS="$LIBOBJS xmalloc.o error.o"
109fi
110
111
112# ---------------------------------------------------------------------------
113
114dnl
115dnl Switch into C++
116dnl
117AC_LANG_CPLUSPLUS
118
119dnl
120dnl Check that the GDBM library is available
121dnl
122AC_MSG_CHECKING("that the GDBM library is available")
123AC_TRY_COMPILE(
124[#include <gdbm.h>
125],
126[],
127success=yes,
128success=no
129)
130AC_MSG_RESULT($success)
131if test $success = "no"; then
132AC_MSG_ERROR("GDBM Library not available - cannot install")
133fi
134
135dnl
136dnl Now check that Perl is actually around, and can be found
137dnl
138AC_MSG_CHECKING("that Perl 5 is available")
139success="no"
140pl_path="$PATH"
141IFS="${IFS=   }"; pl_save_ifs="$IFS"; IFS=":"
142for 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
148done
149IFS="$pl_save_ifs"
150
151dnl
152dnl Perl actually can be run; now we see if it is version 5 by
153dnl running a sample script (which returns a "clean" version number
154dnl and then tests the result using expr.  If perl errors in some
155dnl way (eg. broken Perl executable, missing script), we set a failure
156dnl value ("0") and then proceed as best we can
157dnl
158if test $success = "yes"; then
159try=`perl configtest.pl` || try="0"
160try=`expr $try \> 5.000`
161if test $try = "1"; then
162AC_MSG_RESULT("yes")
163else
164success="no"
165fi
166fi
167
168if test $success = "no"; then
169AC_MSG_RESULT("no")
170AC_MSG_ERROR("Perl 5 not available - cannot install")
171fi
172
173dnl
174dnl Check if the STL library has any known faults;
175dnl In GCC 2.7.2.x series, some STL library headers are missing
176dnl a file called "new" which is referred to by other headers
177dnl (eg. vector/vector.h); if this applies, then all use of the
178dnl STL will cause a compile fail, so we'd better let the user
179dnl know now, before things really go wrong!
180dnl
181success=no
182AC_MSG_CHECKING("whether STL library has known faults")
183
184dnl - first shot, try simple good old vector on its own
185AC_TRY_COMPILE(
186[#include <vector>
187],
188[],
189success=yes,
190)
191
192dnl - try using the .h equivalent
193if test $success = "no"; then
194AC_TRY_COMPILE(
195[#include <vector.h>
196],
197[],
198success="yes",
199)
200fi
201
202dnl - now try for the objectspace headers
203if test $success = "no"; then
204AC_TRY_COMPILE(
205[#include <ospace\\std\\vector>
206],
207[],
208success="yes",
209)
210fi
211
212if test $success = yes; then
213AC_MSG_RESULT("no")
214else
215AC_MSG_RESULT("yes")
216AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
217fi
218
219gsdlos=`uname | tr A-Z a-z`
220AC_SUBST(gsdlos)
221
222AC_MSG_CHECKING(for HP-UX needing gmalloc)
223if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
224  AC_MSG_RESULT(yes)
225  LIBOBJS="$LIBOBJS gmalloc.o"
226  AC_DEFINE(HAVE_VALLOC)
227else
228  AC_MSG_RESULT(no)
229  AC_CHECK_FUNCS(valloc)
230fi
231
232fp_WITH_DMALLOC
233fp_WITH_REGEX
234
235# ---------------------------------------------------------------------------
236if test "$ac_cv_func_alloca" = 'no'; then
237dnl    support functions for alloca.c
238  LIBOBJS="$LIBOBJS xmalloc.o error.o"
239fi
240
241
242# ---------------------------------------------------------------------------
243
244AC_OUTPUT(src/recpt/Makefile Makefile)
245
246
Note: See TracBrowser for help on using the browser.