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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations)
Sun Oct 13 14:26:26 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.23: +12 -6 lines
better pthread detection using gcc.

1 dnl $Id: configure.in,v 1.23 2002/10/12 09:37:17 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 SERVER_VERSION="0.0.8"
8 AC_DEFINE_UNQUOTED(SERVER_VERSION, "$SERVER_VERSION", [Version of Hydra])
9 AC_DEFINE_UNQUOTED(SERVER_NAME, "Hydra", [Name of the server])
10
11 AM_INIT_AUTOMAKE(hydra, $SERVER_VERSION, [nothing here])
12
13 dnl Make config.h
14 AM_CONFIG_HEADER(config.h)
15
16 AM_MAINTAINER_MODE
17
18 dnl Checks for programs.
19 AM_PROG_LEX
20 AC_PROG_YACC
21 AC_PROG_CC
22 AC_PROG_CPP
23
24 dnl Checks for header files.
25 AC_HEADER_DIRENT
26 AC_HEADER_STDC
27 AC_HEADER_SYS_WAIT
28 AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
29 AC_CHECK_HEADERS(getopt.h netinet/tcp.h)
30
31 dnl Checks for typedefs, structures, and compiler characteristics.
32 AC_C_CONST
33 AC_C_INLINE
34 AC_TYPE_UID_T
35 AC_TYPE_PID_T
36 AC_HEADER_TIME
37
38 AC_CHECK_TYPE( off_t,
39 AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
40 )
41
42 dnl GNU Libc needs this.
43 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
44 AC_CHECK_TYPE( off64_t,
45 AC_DEFINE( HAVE_OFF64_T, 1, [have off64_t type]),,
46 )
47
48 dnl Checks for library functions.
49 AC_FUNC_SETVBUF_REVERSED
50 AC_FUNC_MMAP
51 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
52 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
53 AC_CHECK_FUNCS(scandir alphasort qsort)
54 AC_CHECK_FUNCS(getrlimit setrlimit)
55 AC_CHECK_FUNCS(stat stat64 atoll,,)
56 AC_CHECK_FUNCS(open64 read64 write64 lseek64,,)
57
58 AC_CHECK_STRUCT_FOR([
59 #if TIME_WITH_SYS_TIME
60 # include <sys/time.h>
61 # include <time.h>
62 #else
63 # if HAVE_SYS_TIME_H
64 # include <sys/time.h>
65 # else
66 # include <time.h>
67 # endif
68 #endif
69 ],tm,tm_gmtoff)
70
71 if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
72 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
73 fi
74
75 AC_CHECK_STRUCT_FOR([
76
77 #if TIME_WITH_SYS_TIME
78 # include <sys/time.h>
79 # include <time.h>
80 #else
81 # if HAVE_SYS_TIME_H
82 # include <sys/time.h>
83 # else
84 # include <time.h>
85 # endif
86 #endif
87 ],tm,tm_zone)
88
89 if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
90 AC_DEFINE(HAVE_TM_ZONE, 1, [Have tm_zone])
91 fi
92
93 AC_CHECK_STRUCT_FOR([
94 #include <sys/types.h>
95 #include <netinet/in.h>
96 ],sockaddr_in,sin_len)
97
98 if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
99 AC_DEFINE(HAVE_SIN_LEN,1, [Have sin_len])
100 fi
101
102 if test $ac_cv_func_socket = no; then
103 # socket is not in the default libraries.
104 AC_CHECK_LIB(socket, socket,
105 [ MYLIBS="$MYLIBS -lsocket" ])
106 fi
107
108 if test $ac_cv_func_inet_aton = no; then
109 # inet_aton is not in the default libraries.
110 AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
111 fi
112
113 if test $ac_cv_func_gethostname = no; then
114 AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
115 fi
116
117 dnl May end up with duplicate -lnsl -- oh well
118 if test $ac_cv_func_gethostbyname = no; then
119 AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
120 fi
121
122 LIBS="$LIBS $MYLIBS"
123
124 # Try to find TCP_CORK and use it if found.
125 AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
126 AC_TRY_COMPILE(
127 #include <sys/socket.h>
128 #include <netinet/tcp.h>
129 #include <netinet/in.h>
130 ,[
131 int one = 1, fd;
132 if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
133 (void *) &one, sizeof (one)) == -1)
134 return -1;
135 return 0;
136
137 ],
138 dnl *** FOUND
139 AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
140 AC_MSG_RESULT(yes),
141 dnl *** NOT FOUND
142 AC_MSG_RESULT(no)
143 )
144
145 use_ssl=yes
146
147 AC_MSG_CHECKING(whether to include SSL and TLS support)
148 AC_ARG_ENABLE(ssl, [ --disable-ssl Do not include SSL and TLS support],
149 [
150 if test "$enableval" = "yes" ; then
151 use_ssl=yes
152 else
153 use_ssl=no
154 fi
155 ]
156 )
157
158 AC_MSG_RESULT($use_ssl)
159
160 if test "$use_ssl" = "yes"; then
161 AM_PATH_LIBGNUTLS( 0.5.9,
162 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
163 LIBS="$LIBS $LIBGNUTLS_LIBS"
164 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
165 AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
166 AC_MSG_WARN([[
167 ***
168 *** libgnutls was not found. You may want to get it from
169 *** ftp://ftp.gnutls.org/pub/gnutls/
170 ]]))
171
172 fi
173
174 use_smp=yes
175
176 AC_MSG_CHECKING(whether to include SMP support)
177 AC_ARG_ENABLE(smp, [ --disable-smp Do not include SMP support],
178 [
179 if test "$enableval" = "yes" ; then
180 use_smp=yes
181 else
182 use_smp=no
183 fi
184 ]
185 )
186
187 AC_MSG_RESULT($use_smp)
188
189 if test "$use_smp" = "yes"; then
190 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
191 if test -n "$GCC"; then
192 CFLAGS="$CFLAGS -pthread"
193 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
194 CFLAGS="$CFLAGS -D_REENTRANT"
195 else
196 AC_CHECK_LIB( pthread, pthread_create, [
197 LIBS="-lpthread $LIBS"
198 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
199 CFLAGS="$CFLAGS -D_REENTRANT"
200 ])
201 fi
202 fi
203
204 if test "$use_smp" = "yes"; then use_hic=yes
205 else use_hic = no
206 fi
207
208 AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
209 AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
210 [
211 if test "$enableval" = "yes" ; then
212 if test "$use_smp" = "yes"; then use_hic=yes
213 else use_hic = no
214 fi
215 else
216 use_hic=no
217 fi
218 ]
219 )
220
221 AC_MSG_RESULT($use_hic)
222
223 if test "$use_hic" = "yes"; then
224 AC_CHECK_LIB(dl, dlopen,
225 LIBS="$LIBS -ldl"
226 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
227 )
228 fi
229
230
231 if test -n "$GCC"; then
232 dnl if we are running gcc, use -pipe
233 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
234
235 AC_MSG_CHECKING(compile and link profiling code)
236 AC_ARG_ENABLE(profiling,
237 [ --enable-profiling Compile and link profiling code],
238 [
239 if test "$enableval" = "yes" ; then
240 AC_MSG_RESULT(yes)
241 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
242 if test x$FC_OK = xyes; then
243 CFLAGS="${CFLAGS} `fc-config --cflags`"
244 LIBS="$LIBS `fc-config --libs`"
245 else
246 AC_MSG_WARN(***
247 *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
248 )
249 fi
250 else
251 AC_MSG_RESULT(no)
252 fi
253 ],
254 [
255 AC_MSG_RESULT(no)
256 ])
257 fi
258
259 AC_MSG_CHECKING(whether to compile and link debugging code)
260 AC_ARG_ENABLE(debug,
261 [ --disable-debug Compile and link debugging code],
262 [
263 if test "$enableval" = "yes" ; then
264 AC_MSG_RESULT(yes)
265 LDFLAGS="$LDFLAGS -g"
266 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
267 else
268 AC_MSG_RESULT(no)
269 fi
270 ],
271 [
272 AC_MSG_RESULT(yes)
273 LDFLAGS="$LDFLAGS -g"
274 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
275 ])
276
277 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
278 AC_ARG_WITH(dmalloc,
279 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
280 [
281 if test "$withval" = "yes"; then
282 AC_MSG_RESULT(trying)
283 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
284 else
285 AC_MSG_RESULT(no)
286 fi
287 ],
288 [
289 AC_MSG_RESULT(no)
290 ])
291
292 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
293 AC_ARG_WITH(efence,
294 [ --with-efence link with the Electric Fence memory debugger ],
295 [
296 if test "$withval" = "yes"; then
297 AC_MSG_RESULT(trying)
298 AC_CHECK_LIB(efence, main)
299 else
300 AC_MSG_RESULT(no)
301 fi
302 ],
303 [
304 AC_MSG_RESULT(no)
305 ])
306
307 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
308
309 AC_OUTPUT
310
311 echo "**********************************************************"
312 echo ""
313 echo "An example configuration file for hydra can be found at"
314 echo "examples/hydra.conf."
315 echo ""
316 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26