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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (show annotations)
Sat Oct 26 20:58:48 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.29: +33 -10 lines
Long offsets are not used by default.
Use of pipes instead of temporary files, if the post data sent
are less than PIPE_BUF.

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26