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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.34.2.2 - (hide annotations)
Sat Jan 4 12:07:04 2003 UTC (21 years, 2 months ago) by nmav
Branch: hydra_0_1_0_patches
Changes since 1.34.2.1: +29 -31 lines
Better pthread detection (using acx_pthread.m4 macros).

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26