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