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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (show annotations)
Sun Oct 6 09:42:50 2002 UTC (18 years, 11 months ago) by nmav
Branch: MAIN
CVS Tags: hydra_0_0_7
Changes since 1.20: +10 -2 lines
The headers of HIC-CGIs are now parsed by the server.

1 dnl $Id: configure.in,v 1.20 2002/10/05 09:39:36 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.7"
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_CHECK_LIB( pthread, pthread_create, [
191 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
192 LIBS="-lpthread $LIBS"
193 ])
194 CFLAGS="$CFLAGS -D_REENTRANT"
195 fi
196
197 if test "$use_smp" = "yes"; then use_hic=yes
198 else use_hic = no
199 fi
200
201 AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
202 AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
203 [
204 if test "$enableval" = "yes" ; then
205 if test "$use_smp" = "yes"; then use_hic=yes
206 else use_hic = no
207 fi
208 else
209 use_hic=no
210 fi
211 ]
212 )
213
214 AC_MSG_RESULT($use_hic)
215
216 if test "$use_hic" = "yes"; then
217 AC_CHECK_LIB(dl, dlopen,
218 LIBS="$LIBS -ldl"
219 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
220 )
221 fi
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 else
243 AC_MSG_RESULT(no)
244 fi
245 ],
246 [
247 AC_MSG_RESULT(no)
248 ])
249 fi
250
251 AC_MSG_CHECKING(whether to compile and link debugging code)
252 AC_ARG_ENABLE(debug,
253 [ --disable-debug Compile and link debugging code],
254 [
255 if test "$enableval" = "yes" ; then
256 AC_MSG_RESULT(yes)
257 LDFLAGS="$LDFLAGS -g"
258 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
259 else
260 AC_MSG_RESULT(no)
261 fi
262 ],
263 [
264 AC_MSG_RESULT(yes)
265 LDFLAGS="$LDFLAGS -g"
266 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
267 ])
268
269 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
270 AC_ARG_WITH(dmalloc,
271 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
272 [
273 if test "$withval" = "yes"; then
274 AC_MSG_RESULT(trying)
275 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
276 else
277 AC_MSG_RESULT(no)
278 fi
279 ],
280 [
281 AC_MSG_RESULT(no)
282 ])
283
284 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
285 AC_ARG_WITH(efence,
286 [ --with-efence link with the Electric Fence memory debugger ],
287 [
288 if test "$withval" = "yes"; then
289 AC_MSG_RESULT(trying)
290 AC_CHECK_LIB(efence, main)
291 else
292 AC_MSG_RESULT(no)
293 fi
294 ],
295 [
296 AC_MSG_RESULT(no)
297 ])
298
299 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
300
301 AC_OUTPUT
302
303 echo "**********************************************************"
304 echo ""
305 echo "An example configuration file for hydra can be found at"
306 echo "examples/hydra.conf."
307 echo ""
308 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26