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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (hide annotations)
Mon Oct 21 19:36:54 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.25: +22 -16 lines
some fixes in the sendfile(2) support. Added support for FreeBSD's sendfile (currently untested).

1 nmav 1.26 dnl $Id: configure.in,v 1.25 2002/10/21 18:46:25 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     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 nmav 1.19 AM_PATH_LIBGNUTLS( 0.5.9,
164 nmav 1.11 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
165 nmav 1.10 LIBS="$LIBS $LIBGNUTLS_LIBS"
166     CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
167     AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
168 nmav 1.11 AC_MSG_WARN([[
169 nmav 1.1 ***
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 nmav 1.24 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 nmav 1.6 fi
205    
206 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
207     else use_hic = no
208     fi
209 nmav 1.6
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 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
215     else use_hic = no
216     fi
217 nmav 1.6 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 nmav 1.1 fi
231 nmav 1.23
232 nmav 1.1
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 nmav 1.21 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 nmav 1.1 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 nmav 1.25
309 nmav 1.26 use_sendfile=yes
310     AC_ARG_ENABLE(sendfile,
311     [ --disable-sendfile disable the use of the sendfile(2) system call],
312     [
313 nmav 1.25 if test "$enableval" = "no" ; then
314 nmav 1.26 use_sendfile=no
315 nmav 1.25 AC_MSG_RESULT(no)
316     else
317 nmav 1.26 use_sendfile=yes
318 nmav 1.25 AC_MSG_RESULT(yes)
319     fi
320 nmav 1.26 ])
321    
322     if test "$use_sendfile" = "yes"; then
323     case $host_os in
324     *linux*)
325     AC_CHECK_HEADERS(sys/sendfile.h)
326     AC_CHECK_FUNCS(sendfile)
327     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
328     AC_DEFINE(HAVE_LINUXSENDFILE, 1, [whether to use Linux' sendfile])
329     ;;
330     *freebsd*)
331     AC_CHECK_HEADERS(sys/sendfile.h)
332     AC_CHECK_FUNCS(sendfile)
333     AC_DEFINE(HAVE_BSDSENDFILE, 1, [whether to use FreeBSD's sendfile])
334     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
335 nmav 1.25 ;;
336     esac
337    
338     POLL_OR_SELECT
339    
340     if test "$BOA_ASYNC_IO" = "poll"; then
341     AC_DEFINE( USE_POLL, 1, [whether to use poll])
342     fi
343     AC_SUBST(ASYNCIO_SOURCE)
344    
345     # there are three scenarios
346     # GNU make is installed as "make"
347     # GNU make is installed as something else we detected
348     # GNU make is not installed
349     # Unfortunately, we can't deal with it one way or the other
350     # Trying multiple AC_OUTPUT confuses autoconf, and using variables
351     # *in* AC_OUTPUT is even worse.
352     # *so*, make a default makefile that just forces make to call gmake
353     # or whatever.
354 nmav 1.1
355 nmav 1.15 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
356 nmav 1.3
357     AC_OUTPUT
358 nmav 1.4
359     echo "**********************************************************"
360     echo ""
361     echo "An example configuration file for hydra can be found at"
362     echo "examples/hydra.conf."
363     echo ""
364     echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26