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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.36 - (show annotations)
Sun Jan 26 11:25:39 2003 UTC (21 years, 2 months ago) by nmav
Branch: MAIN
Changes since 1.35: +2 -34 lines
Better large file support (now uses the included autoconf macros).
(++some indentation)

1 dnl $Id: configure.in,v 1.35 2003/01/22 07:51:49 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.2.0"
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 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 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 AC_C_INLINE
63 AC_TYPE_UID_T
64 AC_TYPE_PID_T
65 AC_HEADER_TIME
66
67 AC_CHECK_TYPE( off_t,
68 AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
69 )
70
71 AC_SYS_LARGEFILE
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.8.0,
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
232 if test "$use_smp" = "yes"; then use_hic=yes
233 else use_hic = no
234 fi
235
236 AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
237 AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
238 [
239 if test "$enableval" = "yes" ; then
240 if test "$use_smp" = "yes"; then use_hic=yes
241 else use_hic = no
242 fi
243 else
244 use_hic=no
245 fi
246 ]
247 )
248
249 AC_MSG_RESULT($use_hic)
250
251 if test "$use_hic" = "yes"; then
252 AC_CHECK_FUNC( dlopen,
253 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
254 )
255 AC_CHECK_LIB(dl, dlopen,
256 LIBS="$LIBS -ldl"
257 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
258 )
259 fi
260
261 AC_CHECK_FUNC( fnmatch,
262 AC_DEFINE( ENABLE_ACCESS_LISTS, 1, [whether to enable file access control lists]) ,
263 AC_MSG_WARN([[
264 ***
265 *** fnmatch() is not available in your system. File access control lists
266 *** will not be available.
267 ]])
268 )
269
270 if test -n "$GCC"; then
271 dnl if we are running gcc, use -pipe
272 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
273
274 AC_MSG_CHECKING(compile and link profiling code)
275 AC_ARG_ENABLE(profiling,
276 [ --enable-profiling Compile and link profiling code],
277 [
278 if test "$enableval" = "yes" ; then
279 AC_MSG_RESULT(yes)
280 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
281 if test x$FC_OK = xyes; then
282 CFLAGS="${CFLAGS} `fc-config --cflags`"
283 LIBS="$LIBS `fc-config --libs`"
284 else
285 AC_MSG_WARN(***
286 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
287 )
288 fi
289
290 else
291 AC_MSG_RESULT(no)
292 fi
293 ],
294 [
295 AC_MSG_RESULT(no)
296 ])
297 fi
298
299 AC_MSG_CHECKING(whether to compile and link debugging code)
300 AC_ARG_ENABLE(debug,
301 [ --disable-debug Compile and link debugging code],
302 [
303 if test "$enableval" = "yes" ; then
304 AC_MSG_RESULT(yes)
305 LDFLAGS="$LDFLAGS -g"
306 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
307 else
308 AC_MSG_RESULT(no)
309 fi
310 ],
311 [
312 AC_MSG_RESULT(yes)
313 LDFLAGS="$LDFLAGS -g"
314 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
315 ])
316
317 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
318 AC_ARG_WITH(dmalloc,
319 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
320 [
321 if test "$withval" = "yes"; then
322 AC_MSG_RESULT(trying)
323 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
324 else
325 AC_MSG_RESULT(no)
326 fi
327 ],
328 [
329 AC_MSG_RESULT(no)
330 ])
331
332 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
333 AC_ARG_WITH(efence,
334 [ --with-efence link with the Electric Fence memory debugger ],
335 [
336 if test "$withval" = "yes"; then
337 AC_MSG_RESULT(trying)
338 AC_CHECK_LIB(efence, main)
339 else
340 AC_MSG_RESULT(no)
341 fi
342 ],
343 [
344 AC_MSG_RESULT(no)
345 ])
346
347
348 POLL_OR_SELECT
349
350 if test "$BOA_ASYNC_IO" = "poll"; then
351 AC_DEFINE( USE_POLL, 1, [whether to use poll])
352 fi
353
354 # there are three scenarios
355 # GNU make is installed as "make"
356 # GNU make is installed as something else we detected
357 # GNU make is not installed
358 # Unfortunately, we can't deal with it one way or the other
359 # Trying multiple AC_OUTPUT confuses autoconf, and using variables
360 # *in* AC_OUTPUT is even worse.
361 # *so*, make a default makefile that just forces make to call gmake
362 # or whatever.
363
364 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile contrib/redhat/Makefile examples/Makefile docs/Makefile])
365
366 AC_OUTPUT
367
368 echo "**********************************************************"
369 echo ""
370 echo "An example configuration file for hydra can be found at"
371 echo "examples/hydra.conf."
372 echo ""
373 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26