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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (hide annotations)
Mon Oct 21 20:33:30 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.27: +2 -1 lines
Removed some optimizations from Boa, that made the code harder
to read. Added the hash.c from Boa.

1 nmav 1.28 dnl $Id: configure.in,v 1.27 2002/10/21 19:47:04 nmav Exp $
2 nmav 1.1 dnl Process this file with autoconf to produce a configure script.
3     AC_PREREQ(2.50)
4    
5 nmav 1.4 AC_INIT
6    
7 nmav 1.25 AC_CANONICAL_HOST
8    
9 nmav 1.22 SERVER_VERSION="0.0.8"
10 nmav 1.4 AC_DEFINE_UNQUOTED(SERVER_VERSION, "$SERVER_VERSION", [Version of Hydra])
11 nmav 1.1 AC_DEFINE_UNQUOTED(SERVER_NAME, "Hydra", [Name of the server])
12    
13 nmav 1.4 AM_INIT_AUTOMAKE(hydra, $SERVER_VERSION, [nothing here])
14 nmav 1.1
15     dnl Make config.h
16     AM_CONFIG_HEADER(config.h)
17    
18 nmav 1.4 AM_MAINTAINER_MODE
19    
20 nmav 1.1 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 nmav 1.12 AC_C_INLINE
36 nmav 1.1 AC_TYPE_UID_T
37     AC_TYPE_PID_T
38     AC_HEADER_TIME
39    
40 nmav 1.18 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 nmav 1.1 dnl Checks for library functions.
51     AC_FUNC_SETVBUF_REVERSED
52     AC_FUNC_MMAP
53 nmav 1.20 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
54 nmav 1.1 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
55 nmav 1.15 AC_CHECK_FUNCS(scandir alphasort qsort)
56 nmav 1.16 AC_CHECK_FUNCS(getrlimit setrlimit)
57 nmav 1.18 AC_CHECK_FUNCS(stat stat64 atoll,,)
58     AC_CHECK_FUNCS(open64 read64 write64 lseek64,,)
59 nmav 1.1
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 nmav 1.27 use_sendfile=yes
148 nmav 1.28 AC_MSG_CHECKING([whether to enable sendfile(2) usage])
149 nmav 1.27 AC_ARG_ENABLE(sendfile,
150     [ --disable-sendfile disable the use of the sendfile(2) system call],
151     [
152     if test "$enableval" = "no" ; then
153     use_sendfile=no
154     AC_MSG_RESULT(no)
155     else
156     use_sendfile=yes
157     AC_MSG_RESULT(yes)
158     fi
159     ]
160     )
161    
162     if test "$use_sendfile" = "yes"; then
163     case $host_os in
164     *linux*)
165     AC_CHECK_HEADERS(sys/sendfile.h)
166     AC_CHECK_FUNCS(sendfile)
167     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
168     AC_DEFINE(HAVE_LINUXSENDFILE, 1, [whether to use Linux' sendfile])
169     ;;
170     *freebsd*)
171     AC_CHECK_HEADERS(sys/sendfile.h)
172     AC_CHECK_FUNCS(sendfile)
173     AC_DEFINE(HAVE_BSDSENDFILE, 1, [whether to use FreeBSD's sendfile])
174     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
175     ;;
176     *) ;;
177     esac
178     fi
179    
180 nmav 1.1 use_ssl=yes
181    
182     AC_MSG_CHECKING(whether to include SSL and TLS support)
183     AC_ARG_ENABLE(ssl, [ --disable-ssl Do not include SSL and TLS support],
184     [
185     if test "$enableval" = "yes" ; then
186     use_ssl=yes
187     else
188     use_ssl=no
189     fi
190     ]
191     )
192    
193     AC_MSG_RESULT($use_ssl)
194    
195     if test "$use_ssl" = "yes"; then
196 nmav 1.19 AM_PATH_LIBGNUTLS( 0.5.9,
197 nmav 1.11 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
198 nmav 1.10 LIBS="$LIBS $LIBGNUTLS_LIBS"
199     CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
200     AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
201 nmav 1.11 AC_MSG_WARN([[
202 nmav 1.1 ***
203     *** libgnutls was not found. You may want to get it from
204     *** ftp://ftp.gnutls.org/pub/gnutls/
205     ]]))
206    
207     fi
208    
209     use_smp=yes
210    
211     AC_MSG_CHECKING(whether to include SMP support)
212     AC_ARG_ENABLE(smp, [ --disable-smp Do not include SMP support],
213     [
214     if test "$enableval" = "yes" ; then
215     use_smp=yes
216     else
217     use_smp=no
218     fi
219     ]
220     )
221    
222     AC_MSG_RESULT($use_smp)
223    
224     if test "$use_smp" = "yes"; then
225     AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
226 nmav 1.24 if test -n "$GCC"; then
227     CFLAGS="$CFLAGS -pthread"
228     AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
229     CFLAGS="$CFLAGS -D_REENTRANT"
230     else
231     AC_CHECK_LIB( pthread, pthread_create, [
232     LIBS="-lpthread $LIBS"
233     AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
234     CFLAGS="$CFLAGS -D_REENTRANT"
235     ])
236     fi
237 nmav 1.6 fi
238    
239 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
240     else use_hic = no
241     fi
242 nmav 1.6
243     AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
244     AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
245     [
246     if test "$enableval" = "yes" ; then
247 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
248     else use_hic = no
249     fi
250 nmav 1.6 else
251     use_hic=no
252     fi
253     ]
254     )
255    
256     AC_MSG_RESULT($use_hic)
257    
258     if test "$use_hic" = "yes"; then
259     AC_CHECK_LIB(dl, dlopen,
260     LIBS="$LIBS -ldl"
261     AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
262     )
263 nmav 1.1 fi
264 nmav 1.23
265 nmav 1.1
266     if test -n "$GCC"; then
267     dnl if we are running gcc, use -pipe
268     test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
269    
270     AC_MSG_CHECKING(compile and link profiling code)
271     AC_ARG_ENABLE(profiling,
272     [ --enable-profiling Compile and link profiling code],
273     [
274     if test "$enableval" = "yes" ; then
275     AC_MSG_RESULT(yes)
276 nmav 1.21 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
277     if test x$FC_OK = xyes; then
278     CFLAGS="${CFLAGS} `fc-config --cflags`"
279     LIBS="$LIBS `fc-config --libs`"
280     else
281     AC_MSG_WARN(***
282     *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
283     )
284     fi
285 nmav 1.1 else
286     AC_MSG_RESULT(no)
287     fi
288     ],
289     [
290     AC_MSG_RESULT(no)
291     ])
292     fi
293    
294     AC_MSG_CHECKING(whether to compile and link debugging code)
295     AC_ARG_ENABLE(debug,
296     [ --disable-debug Compile and link debugging code],
297     [
298     if test "$enableval" = "yes" ; then
299     AC_MSG_RESULT(yes)
300     LDFLAGS="$LDFLAGS -g"
301     test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
302     else
303     AC_MSG_RESULT(no)
304     fi
305     ],
306     [
307     AC_MSG_RESULT(yes)
308     LDFLAGS="$LDFLAGS -g"
309     test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
310     ])
311    
312     AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
313     AC_ARG_WITH(dmalloc,
314     [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
315     [
316     if test "$withval" = "yes"; then
317     AC_MSG_RESULT(trying)
318     AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
319     else
320     AC_MSG_RESULT(no)
321     fi
322     ],
323     [
324     AC_MSG_RESULT(no)
325     ])
326    
327     AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
328     AC_ARG_WITH(efence,
329     [ --with-efence link with the Electric Fence memory debugger ],
330     [
331     if test "$withval" = "yes"; then
332     AC_MSG_RESULT(trying)
333     AC_CHECK_LIB(efence, main)
334     else
335     AC_MSG_RESULT(no)
336     fi
337     ],
338     [
339     AC_MSG_RESULT(no)
340     ])
341 nmav 1.25
342    
343     POLL_OR_SELECT
344    
345     if test "$BOA_ASYNC_IO" = "poll"; then
346     AC_DEFINE( USE_POLL, 1, [whether to use poll])
347     fi
348    
349     # there are three scenarios
350     # GNU make is installed as "make"
351     # GNU make is installed as something else we detected
352     # GNU make is not installed
353     # Unfortunately, we can't deal with it one way or the other
354     # Trying multiple AC_OUTPUT confuses autoconf, and using variables
355     # *in* AC_OUTPUT is even worse.
356     # *so*, make a default makefile that just forces make to call gmake
357     # or whatever.
358 nmav 1.1
359 nmav 1.15 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
360 nmav 1.3
361     AC_OUTPUT
362 nmav 1.4
363     echo "**********************************************************"
364     echo ""
365     echo "An example configuration file for hydra can be found at"
366     echo "examples/hydra.conf."
367     echo ""
368     echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26