/[hydra]/hydra/configure.in
ViewVC logotype

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (show annotations)
Mon Oct 21 18:46:25 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.24: +43 -1 lines
Added several stuff from Boa 0.94.14rc1

1 dnl $Id: configure.in,v 1.24 2002/10/13 14:26:26 nmav Exp $
2 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.50)
4
5 AC_INIT
6
7 AC_CANONICAL_HOST
8
9 SERVER_VERSION="0.0.8"
10 AC_DEFINE_UNQUOTED(SERVER_VERSION, "$SERVER_VERSION", [Version of Hydra])
11 AC_DEFINE_UNQUOTED(SERVER_NAME, "Hydra", [Name of the server])
12
13 AM_INIT_AUTOMAKE(hydra, $SERVER_VERSION, [nothing here])
14
15 dnl Make config.h
16 AM_CONFIG_HEADER(config.h)
17
18 AM_MAINTAINER_MODE
19
20 dnl Checks for programs.
21 AM_PROG_LEX
22 AC_PROG_YACC
23 AC_PROG_CC
24 AC_PROG_CPP
25
26 dnl Checks for header files.
27 AC_HEADER_DIRENT
28 AC_HEADER_STDC
29 AC_HEADER_SYS_WAIT
30 AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
31 AC_CHECK_HEADERS(getopt.h netinet/tcp.h)
32
33 dnl Checks for typedefs, structures, and compiler characteristics.
34 AC_C_CONST
35 AC_C_INLINE
36 AC_TYPE_UID_T
37 AC_TYPE_PID_T
38 AC_HEADER_TIME
39
40 AC_CHECK_TYPE( off_t,
41 AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
42 )
43
44 dnl GNU Libc needs this.
45 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
46 AC_CHECK_TYPE( off64_t,
47 AC_DEFINE( HAVE_OFF64_T, 1, [have off64_t type]),,
48 )
49
50 dnl Checks for library functions.
51 AC_FUNC_SETVBUF_REVERSED
52 AC_FUNC_MMAP
53 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
54 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
55 AC_CHECK_FUNCS(scandir alphasort qsort)
56 AC_CHECK_FUNCS(getrlimit setrlimit)
57 AC_CHECK_FUNCS(stat stat64 atoll,,)
58 AC_CHECK_FUNCS(open64 read64 write64 lseek64,,)
59
60 AC_CHECK_STRUCT_FOR([
61 #if TIME_WITH_SYS_TIME
62 # include <sys/time.h>
63 # include <time.h>
64 #else
65 # if HAVE_SYS_TIME_H
66 # include <sys/time.h>
67 # else
68 # include <time.h>
69 # endif
70 #endif
71 ],tm,tm_gmtoff)
72
73 if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
74 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
75 fi
76
77 AC_CHECK_STRUCT_FOR([
78
79 #if TIME_WITH_SYS_TIME
80 # include <sys/time.h>
81 # include <time.h>
82 #else
83 # if HAVE_SYS_TIME_H
84 # include <sys/time.h>
85 # else
86 # include <time.h>
87 # endif
88 #endif
89 ],tm,tm_zone)
90
91 if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
92 AC_DEFINE(HAVE_TM_ZONE, 1, [Have tm_zone])
93 fi
94
95 AC_CHECK_STRUCT_FOR([
96 #include <sys/types.h>
97 #include <netinet/in.h>
98 ],sockaddr_in,sin_len)
99
100 if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
101 AC_DEFINE(HAVE_SIN_LEN,1, [Have sin_len])
102 fi
103
104 if test $ac_cv_func_socket = no; then
105 # socket is not in the default libraries.
106 AC_CHECK_LIB(socket, socket,
107 [ MYLIBS="$MYLIBS -lsocket" ])
108 fi
109
110 if test $ac_cv_func_inet_aton = no; then
111 # inet_aton is not in the default libraries.
112 AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
113 fi
114
115 if test $ac_cv_func_gethostname = no; then
116 AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
117 fi
118
119 dnl May end up with duplicate -lnsl -- oh well
120 if test $ac_cv_func_gethostbyname = no; then
121 AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
122 fi
123
124 LIBS="$LIBS $MYLIBS"
125
126 # Try to find TCP_CORK and use it if found.
127 AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
128 AC_TRY_COMPILE(
129 #include <sys/socket.h>
130 #include <netinet/tcp.h>
131 #include <netinet/in.h>
132 ,[
133 int one = 1, fd;
134 if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
135 (void *) &one, sizeof (one)) == -1)
136 return -1;
137 return 0;
138
139 ],
140 dnl *** FOUND
141 AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
142 AC_MSG_RESULT(yes),
143 dnl *** NOT FOUND
144 AC_MSG_RESULT(no)
145 )
146
147 use_ssl=yes
148
149 AC_MSG_CHECKING(whether to include SSL and TLS support)
150 AC_ARG_ENABLE(ssl, [ --disable-ssl Do not include SSL and TLS support],
151 [
152 if test "$enableval" = "yes" ; then
153 use_ssl=yes
154 else
155 use_ssl=no
156 fi
157 ]
158 )
159
160 AC_MSG_RESULT($use_ssl)
161
162 if test "$use_ssl" = "yes"; then
163 AM_PATH_LIBGNUTLS( 0.5.9,
164 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
165 LIBS="$LIBS $LIBGNUTLS_LIBS"
166 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
167 AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
168 AC_MSG_WARN([[
169 ***
170 *** libgnutls was not found. You may want to get it from
171 *** ftp://ftp.gnutls.org/pub/gnutls/
172 ]]))
173
174 fi
175
176 use_smp=yes
177
178 AC_MSG_CHECKING(whether to include SMP support)
179 AC_ARG_ENABLE(smp, [ --disable-smp Do not include SMP support],
180 [
181 if test "$enableval" = "yes" ; then
182 use_smp=yes
183 else
184 use_smp=no
185 fi
186 ]
187 )
188
189 AC_MSG_RESULT($use_smp)
190
191 if test "$use_smp" = "yes"; then
192 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
193 if test -n "$GCC"; then
194 CFLAGS="$CFLAGS -pthread"
195 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
196 CFLAGS="$CFLAGS -D_REENTRANT"
197 else
198 AC_CHECK_LIB( pthread, pthread_create, [
199 LIBS="-lpthread $LIBS"
200 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
201 CFLAGS="$CFLAGS -D_REENTRANT"
202 ])
203 fi
204 fi
205
206 if test "$use_smp" = "yes"; then use_hic=yes
207 else use_hic = no
208 fi
209
210 AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
211 AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
212 [
213 if test "$enableval" = "yes" ; then
214 if test "$use_smp" = "yes"; then use_hic=yes
215 else use_hic = no
216 fi
217 else
218 use_hic=no
219 fi
220 ]
221 )
222
223 AC_MSG_RESULT($use_hic)
224
225 if test "$use_hic" = "yes"; then
226 AC_CHECK_LIB(dl, dlopen,
227 LIBS="$LIBS -ldl"
228 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
229 )
230 fi
231
232
233 if test -n "$GCC"; then
234 dnl if we are running gcc, use -pipe
235 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
236
237 AC_MSG_CHECKING(compile and link profiling code)
238 AC_ARG_ENABLE(profiling,
239 [ --enable-profiling Compile and link profiling code],
240 [
241 if test "$enableval" = "yes" ; then
242 AC_MSG_RESULT(yes)
243 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
244 if test x$FC_OK = xyes; then
245 CFLAGS="${CFLAGS} `fc-config --cflags`"
246 LIBS="$LIBS `fc-config --libs`"
247 else
248 AC_MSG_WARN(***
249 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
250 )
251 fi
252 else
253 AC_MSG_RESULT(no)
254 fi
255 ],
256 [
257 AC_MSG_RESULT(no)
258 ])
259 fi
260
261 AC_MSG_CHECKING(whether to compile and link debugging code)
262 AC_ARG_ENABLE(debug,
263 [ --disable-debug Compile and link debugging code],
264 [
265 if test "$enableval" = "yes" ; then
266 AC_MSG_RESULT(yes)
267 LDFLAGS="$LDFLAGS -g"
268 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
269 else
270 AC_MSG_RESULT(no)
271 fi
272 ],
273 [
274 AC_MSG_RESULT(yes)
275 LDFLAGS="$LDFLAGS -g"
276 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
277 ])
278
279 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
280 AC_ARG_WITH(dmalloc,
281 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
282 [
283 if test "$withval" = "yes"; then
284 AC_MSG_RESULT(trying)
285 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
286 else
287 AC_MSG_RESULT(no)
288 fi
289 ],
290 [
291 AC_MSG_RESULT(no)
292 ])
293
294 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
295 AC_ARG_WITH(efence,
296 [ --with-efence link with the Electric Fence memory debugger ],
297 [
298 if test "$withval" = "yes"; then
299 AC_MSG_RESULT(trying)
300 AC_CHECK_LIB(efence, main)
301 else
302 AC_MSG_RESULT(no)
303 fi
304 ],
305 [
306 AC_MSG_RESULT(no)
307 ])
308
309 case $host_os in
310 *linux*)
311 AC_MSG_CHECKING(whether to enable the use of the sendfile(2) system call)
312 AC_ARG_ENABLE(sendfile,
313 [ --disable-sendfile disable the use of the sendfile(2) system call],
314 [
315 if test "$enableval" = "no" ; then
316 AC_MSG_RESULT(no)
317 else
318 AC_MSG_RESULT(yes)
319 AC_CHECK_HEADERS(sys/sendfile.h)
320 AC_CHECK_FUNCS(sendfile)
321 fi
322 ],
323 [
324 AC_MSG_RESULT(yes)
325 AC_CHECK_HEADERS(sys/sendfile.h)
326 AC_CHECK_FUNCS(sendfile)
327 ])
328 ;;
329 *) ;;
330 esac
331
332 POLL_OR_SELECT
333
334 if test "$BOA_ASYNC_IO" = "poll"; then
335 AC_DEFINE( USE_POLL, 1, [whether to use poll])
336 fi
337 AC_SUBST(ASYNCIO_SOURCE)
338
339 # there are three scenarios
340 # GNU make is installed as "make"
341 # GNU make is installed as something else we detected
342 # GNU make is not installed
343 # Unfortunately, we can't deal with it one way or the other
344 # Trying multiple AC_OUTPUT confuses autoconf, and using variables
345 # *in* AC_OUTPUT is even worse.
346 # *so*, make a default makefile that just forces make to call gmake
347 # or whatever.
348
349 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
350
351 AC_OUTPUT
352
353 echo "**********************************************************"
354 echo ""
355 echo "An example configuration file for hydra can be found at"
356 echo "examples/hydra.conf."
357 echo ""
358 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26