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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.43 - (show annotations)
Fri Mar 10 16:40:20 2006 UTC (18 years ago) by nmav
Branch: MAIN
Changes since 1.42: +2 -2 lines
*** empty log message ***

1 dnl $Id: configure.in,v 1.42 2006-03-09 18:26:30 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.8"
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,
24 AS_HELP_STRING([--disable-smp],[Do not include SMP support]),
25 use_smp=$enableval)
26 AC_MSG_RESULT($use_smp)
27
28
29 dnl Checks for programs.
30 AM_PROG_LEX
31 AC_PROG_YACC
32 AC_PROG_CC
33 AC_PROG_CPP
34
35 dnl Checks for header files.
36 AC_HEADER_DIRENT
37 AC_HEADER_STDC
38 AC_HEADER_SYS_WAIT
39 AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
40 AC_CHECK_HEADERS(getopt.h netinet/tcp.h)
41
42 dnl Checks for typedefs, structures, and compiler characteristics.
43 AC_C_CONST
44 AC_C_INLINE
45 AC_TYPE_UID_T
46 AC_TYPE_PID_T
47 AC_HEADER_TIME
48
49 AC_CHECK_TYPE( off_t,
50 AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
51 )
52
53 AC_SYS_LARGEFILE
54
55 dnl Checks for library functions.
56 AC_FUNC_SETVBUF_REVERSED
57 AC_FUNC_MMAP
58 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
59 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
60 AC_CHECK_FUNCS(scandir alphasort qsort)
61 AC_CHECK_FUNCS(getrlimit setrlimit)
62 AC_CHECK_FUNCS(stat)
63
64 AC_CHECK_STRUCT_FOR([
65 #if TIME_WITH_SYS_TIME
66 # include <sys/time.h>
67 # include <time.h>
68 #else
69 # if HAVE_SYS_TIME_H
70 # include <sys/time.h>
71 # else
72 # include <time.h>
73 # endif
74 #endif
75 ],tm,tm_gmtoff)
76
77 if test $ac_cv_struct_tm_has_tm_gmtoff = yes; then
78 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
79 fi
80
81 AC_CHECK_STRUCT_FOR([
82
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_zone)
94
95 if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
96 AC_DEFINE(HAVE_TM_ZONE, 1, [Have tm_zone])
97 fi
98
99 AC_CHECK_STRUCT_FOR([
100 #include <sys/types.h>
101 #include <netinet/in.h>
102 ],sockaddr_in,sin_len)
103
104 if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
105 AC_DEFINE(HAVE_SIN_LEN,1, [Have sin_len])
106 fi
107
108 if test $ac_cv_func_socket = no; then
109 # socket is not in the default libraries.
110 AC_CHECK_LIB(socket, socket,
111 [ MYLIBS="$MYLIBS -lsocket" ])
112 fi
113
114 if test $ac_cv_func_inet_aton = no; then
115 # inet_aton is not in the default libraries.
116 AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
117 fi
118
119 if test $ac_cv_func_gethostname = no; then
120 AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
121 fi
122
123 dnl May end up with duplicate -lnsl -- oh well
124 if test $ac_cv_func_gethostbyname = no; then
125 AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
126 fi
127
128 LIBS="$LIBS $MYLIBS"
129
130 # Try to find TCP_CORK and use it if found.
131 AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
132 AC_TRY_COMPILE(
133 #include <sys/socket.h>
134 #include <netinet/tcp.h>
135 #include <netinet/in.h>
136 ,[
137 int one = 1, fd;
138 if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
139 (void *) &one, sizeof (one)) == -1)
140 return -1;
141 return 0;
142
143 ],
144 dnl *** FOUND
145 AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
146 AC_MSG_RESULT(yes),
147 dnl *** NOT FOUND
148 AC_MSG_RESULT(no)
149 )
150
151 use_sendfile=yes
152 AC_MSG_CHECKING([whether to enable sendfile(2) usage])
153 AC_ARG_ENABLE(sendfile,
154 AS_HELP_STRING([--disable-sendfile],[Disable the use of the sendfile(2) system call]),
155 use_sendfile=$enableval)
156 AC_MSG_RESULT($use_sendfile)
157
158 if test "$use_sendfile" = "yes"; then
159 case $host_os in
160 *linux*)
161 AC_CHECK_HEADERS(sys/sendfile.h)
162 AC_CHECK_FUNCS(sendfile)
163 AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
164 AC_DEFINE(HAVE_LINUXSENDFILE, 1, [whether to use Linux' sendfile])
165 ;;
166 *freebsd*)
167 AC_CHECK_HEADERS(sys/sendfile.h)
168 AC_CHECK_FUNCS(sendfile)
169 AC_DEFINE(HAVE_BSDSENDFILE, 1, [whether to use FreeBSD's sendfile])
170 AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
171 ;;
172 *) ;;
173 esac
174 fi
175
176
177
178 if test "$use_smp" = "yes"; then
179 dnl Check for pthreads and do not define ENABLE_SMP
180 dnl if not found
181
182 ACX_PTHREAD(
183 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
184 LIBS="$PTHREAD_LIBS $LIBS"
185 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
186 CC="$PTHREAD_CC"
187 )
188 fi
189
190
191 use_ssl=yes
192
193 AC_MSG_CHECKING(whether to include SSL and TLS support)
194 AC_ARG_ENABLE(ssl,
195 AS_HELP_STRING([--disable-ssl],[Disable SSL and TLS support]),
196 use_ssl=$enableval)
197 AC_MSG_RESULT($use_ssl)
198
199 if test "$use_ssl" = "yes"; then
200 AM_PATH_LIBGNUTLS( 1.0.9,
201 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
202 LIBS="$LIBS $LIBGNUTLS_LIBS"
203 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
204 AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
205 AC_MSG_WARN([[
206 ***
207 *** libgnutls was not found. You may want to get it from
208 *** ftp://ftp.gnutls.org/pub/gnutls/
209 ]]))
210
211 fi
212
213
214 AC_CHECK_FUNC( fnmatch,
215 AC_DEFINE( ENABLE_ACCESS_LISTS, 1, [whether to enable file access control lists]) ,
216 AC_MSG_WARN([[
217 ***
218 *** fnmatch() is not available in your system. File access control lists
219 *** will not be available.
220 ]])
221 )
222
223 if test -n "$GCC"; then
224 dnl if we are running gcc, use -pipe
225 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
226
227 AC_MSG_CHECKING(compile and link profiling code)
228 AC_ARG_ENABLE(profiling,
229 [ --enable-profiling Compile and link profiling code],
230 [
231 if test "$enableval" = "yes" ; then
232 AC_MSG_RESULT(yes)
233 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
234 if test x$FC_OK = xyes; then
235 CFLAGS="${CFLAGS} `fc-config --cflags`"
236 LIBS="$LIBS `fc-config --libs`"
237 else
238 AC_MSG_WARN(***
239 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
240 )
241 fi
242
243 else
244 AC_MSG_RESULT(no)
245 fi
246 ],
247 [
248 AC_MSG_RESULT(no)
249 ])
250 fi
251
252 AC_MSG_CHECKING(whether to compile and link debugging code)
253 AC_ARG_ENABLE(debug,
254 [ --disable-debug Compile and link debugging code],
255 [
256 if test "$enableval" = "yes" ; then
257 AC_MSG_RESULT(yes)
258 LDFLAGS="$LDFLAGS -g"
259 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
260 else
261 AC_MSG_RESULT(no)
262 fi
263 ],
264 [
265 AC_MSG_RESULT(yes)
266 LDFLAGS="$LDFLAGS -g"
267 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
268 ])
269
270 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
271 AC_ARG_WITH(dmalloc,
272 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
273 [
274 if test "$withval" = "yes"; then
275 AC_MSG_RESULT(trying)
276 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
277 else
278 AC_MSG_RESULT(no)
279 fi
280 ],
281 [
282 AC_MSG_RESULT(no)
283 ])
284
285 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
286 AC_ARG_WITH(efence,
287 [ --with-efence link with the Electric Fence memory debugger ],
288 [
289 if test "$withval" = "yes"; then
290 AC_MSG_RESULT(trying)
291 AC_CHECK_LIB(efence, main)
292 else
293 AC_MSG_RESULT(no)
294 fi
295 ],
296 [
297 AC_MSG_RESULT(no)
298 ])
299
300
301 POLL_OR_SELECT
302
303 if test "$BOA_ASYNC_IO" = "poll"; then
304 AC_DEFINE( USE_POLL, 1, [whether to use poll])
305 fi
306
307 # there are three scenarios
308 # GNU make is installed as "make"
309 # GNU make is installed as something else we detected
310 # GNU make is not installed
311 # Unfortunately, we can't deal with it one way or the other
312 # Trying multiple AC_OUTPUT confuses autoconf, and using variables
313 # *in* AC_OUTPUT is even worse.
314 # *so*, make a default makefile that just forces make to call gmake
315 # or whatever.
316
317 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile contrib/redhat/Makefile examples/Makefile docs/Makefile])
318
319 AC_OUTPUT
320
321 echo "**********************************************************"
322 echo ""
323 echo "An example configuration file for hydra can be found at"
324 echo "examples/hydra.conf."
325 echo ""
326 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26