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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.34.2.1 - (show annotations)
Sat Dec 14 08:50:24 2002 UTC (18 years, 6 months ago) by nmav
Branch: hydra_0_1_0_patches
CVS Tags: hydra_0_1_1
Changes since 1.34: +4 -4 lines
Large file support is now enabled by default, since it does not
affect performance.

1 dnl $Id: configure.in,v 1.34 2002/11/16 19:29:58 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.1.1"
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=yes
45 AC_MSG_CHECKING([whether to enable long offsets usage])
46 AC_ARG_ENABLE(long-offsets,
47 [ --disable-long-offsets disable 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 AC_CHECK_FUNC( fnmatch,
291 AC_DEFINE( ENABLE_ACCESS_LISTS, 1, [whether to enable file access control lists]) ,
292 AC_MSG_WARN([[
293 ***
294 *** fnmatch() is not available in your system. File access control lists
295 *** will not be available.
296 ]])
297 )
298
299 if test -n "$GCC"; then
300 dnl if we are running gcc, use -pipe
301 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
302
303 AC_MSG_CHECKING(compile and link profiling code)
304 AC_ARG_ENABLE(profiling,
305 [ --enable-profiling Compile and link profiling code],
306 [
307 if test "$enableval" = "yes" ; then
308 AC_MSG_RESULT(yes)
309 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
310 if test x$FC_OK = xyes; then
311 CFLAGS="${CFLAGS} `fc-config --cflags`"
312 LIBS="$LIBS `fc-config --libs`"
313 else
314 AC_MSG_WARN(***
315 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
316 )
317 fi
318
319 else
320 AC_MSG_RESULT(no)
321 fi
322 ],
323 [
324 AC_MSG_RESULT(no)
325 ])
326 fi
327
328 AC_MSG_CHECKING(whether to compile and link debugging code)
329 AC_ARG_ENABLE(debug,
330 [ --disable-debug Compile and link debugging code],
331 [
332 if test "$enableval" = "yes" ; then
333 AC_MSG_RESULT(yes)
334 LDFLAGS="$LDFLAGS -g"
335 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
336 else
337 AC_MSG_RESULT(no)
338 fi
339 ],
340 [
341 AC_MSG_RESULT(yes)
342 LDFLAGS="$LDFLAGS -g"
343 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
344 ])
345
346 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
347 AC_ARG_WITH(dmalloc,
348 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
349 [
350 if test "$withval" = "yes"; then
351 AC_MSG_RESULT(trying)
352 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
353 else
354 AC_MSG_RESULT(no)
355 fi
356 ],
357 [
358 AC_MSG_RESULT(no)
359 ])
360
361 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
362 AC_ARG_WITH(efence,
363 [ --with-efence link with the Electric Fence memory debugger ],
364 [
365 if test "$withval" = "yes"; then
366 AC_MSG_RESULT(trying)
367 AC_CHECK_LIB(efence, main)
368 else
369 AC_MSG_RESULT(no)
370 fi
371 ],
372 [
373 AC_MSG_RESULT(no)
374 ])
375
376
377 POLL_OR_SELECT
378
379 if test "$BOA_ASYNC_IO" = "poll"; then
380 AC_DEFINE( USE_POLL, 1, [whether to use poll])
381 fi
382
383 # there are three scenarios
384 # GNU make is installed as "make"
385 # GNU make is installed as something else we detected
386 # GNU make is not installed
387 # Unfortunately, we can't deal with it one way or the other
388 # Trying multiple AC_OUTPUT confuses autoconf, and using variables
389 # *in* AC_OUTPUT is even worse.
390 # *so*, make a default makefile that just forces make to call gmake
391 # or whatever.
392
393 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
394
395 AC_OUTPUT
396
397 echo "**********************************************************"
398 echo ""
399 echo "An example configuration file for hydra can be found at"
400 echo "examples/hydra.conf."
401 echo ""
402 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26