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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations)
Fri Sep 27 23:40:28 2002 UTC (21 years, 6 months ago) by nmav
Branch: MAIN
Changes since 1.5: +23 -1 lines
Improvements on HIC support.

1 dnl $Id: configure.in,v 1.5 2002/09/27 10:35:54 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.2"
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_TYPE_UID_T
34 AC_TYPE_PID_T
35 AC_HEADER_TIME
36
37 dnl Checks for library functions.
38 AC_FUNC_SETVBUF_REVERSED
39 AC_FUNC_MMAP
40 AC_CHECK_FUNCS(getcwd strdup strstr)
41 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
42 AC_CHECK_FUNCS(scandir alphasort)
43
44 AC_CHECK_STRUCT_FOR([
45 #if TIME_WITH_SYS_TIME
46 # include <sys/time.h>
47 # include <time.h>
48 #else
49 # if HAVE_SYS_TIME_H
50 # include <sys/time.h>
51 # else
52 # include <time.h>
53 # endif
54 #endif
55 ],tm,tm_gmtoff)
56
57 if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
58 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
59 fi
60
61 AC_CHECK_STRUCT_FOR([
62
63 #if TIME_WITH_SYS_TIME
64 # include <sys/time.h>
65 # include <time.h>
66 #else
67 # if HAVE_SYS_TIME_H
68 # include <sys/time.h>
69 # else
70 # include <time.h>
71 # endif
72 #endif
73 ],tm,tm_zone)
74
75 if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
76 AC_DEFINE(HAVE_TM_ZONE, 1, [Have tm_zone])
77 fi
78
79 AC_CHECK_STRUCT_FOR([
80 #include <sys/types.h>
81 #include <netinet/in.h>
82 ],sockaddr_in,sin_len)
83
84 if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
85 AC_DEFINE(HAVE_SIN_LEN,1, [Have sin_len])
86 fi
87
88 if test $ac_cv_func_socket = no; then
89 # socket is not in the default libraries.
90 AC_CHECK_LIB(socket, socket,
91 [ MYLIBS="$MYLIBS -lsocket" ])
92 fi
93
94 if test $ac_cv_func_inet_aton = no; then
95 # inet_aton is not in the default libraries.
96 AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
97 fi
98
99 if test $ac_cv_func_gethostname = no; then
100 AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
101 fi
102
103 dnl May end up with duplicate -lnsl -- oh well
104 if test $ac_cv_func_gethostbyname = no; then
105 AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
106 fi
107
108 LIBS="$LIBS $MYLIBS"
109
110 if test $ac_cv_func_scandir = no; then
111 # scandir not defined, add it
112 SCANDIR="scandir.o"
113 fi
114
115 if test $ac_cv_func_alphasort = no; then
116 # alphasort not defined, add it
117 ALPHASORT="alphasort.o"
118 fi
119
120 # Try to find TCP_CORK and use it if found.
121 AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
122 AC_TRY_COMPILE(
123 #include <sys/socket.h>
124 #include <netinet/tcp.h>
125 #include <netinet/in.h>
126 ,[
127 int one = 1, fd;
128 if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
129 (void *) &one, sizeof (one)) == -1)
130 return -1;
131 return 0;
132
133 ],
134 dnl *** FOUND
135 AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
136 AC_MSG_RESULT(yes),
137 dnl *** NOT FOUND
138 AC_MSG_RESULT(no)
139 )
140
141 use_ssl=yes
142
143 AC_MSG_CHECKING(whether to include SSL and TLS support)
144 AC_ARG_ENABLE(ssl, [ --disable-ssl Do not include SSL and TLS support],
145 [
146 if test "$enableval" = "yes" ; then
147 use_ssl=yes
148 else
149 use_ssl=no
150 fi
151 ]
152 )
153
154 AC_MSG_RESULT($use_ssl)
155
156 if test "$use_ssl" = "yes"; then
157 AM_PATH_LIBGNUTLS( 0.5.8,
158 AC_DEFINE(HAVE_LIBGNUTLS,1, [Have libgnutls]),
159 AC_MSG_WARN([[
160 ***
161 *** libgnutls was not found. You may want to get it from
162 *** ftp://ftp.gnutls.org/pub/gnutls/
163 ]]))
164
165 LIBS="$LIBS $LIBGNUTLS_LIBS"
166 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
167 AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl])
168 fi
169
170 use_smp=yes
171
172 AC_MSG_CHECKING(whether to include SMP support)
173 AC_ARG_ENABLE(smp, [ --disable-smp Do not include SMP support],
174 [
175 if test "$enableval" = "yes" ; then
176 use_smp=yes
177 else
178 use_smp=no
179 fi
180 ]
181 )
182
183 AC_MSG_RESULT($use_smp)
184
185 if test "$use_smp" = "yes"; then
186 AC_CHECK_LIB( pthread, pthread_create, [
187 AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
188 LIBS="-lpthread $LIBS"
189 ])
190 CFLAGS="$CFLAGS -D_REENTRANT"
191 fi
192
193 use_hic=yes
194
195 AC_MSG_CHECKING(whether to include HIC (internally handled CGIs) support)
196 AC_ARG_ENABLE(hic, [ --disable-hic Do not include HIC support],
197 [
198 if test "$enableval" = "yes" ; then
199 use_hic=yes
200 else
201 use_hic=no
202 fi
203 ]
204 )
205
206 AC_MSG_RESULT($use_hic)
207
208 if test "$use_hic" = "yes"; then
209 AC_CHECK_LIB(dl, dlopen,
210 LIBS="$LIBS -ldl"
211 AC_DEFINE( ENABLE_HIC, 1, [whether to use HIC code])
212 )
213 fi
214
215
216 if test $ac_cv_func_strdup = no -o $ac_cv_func_strstr = no; then
217 # strdup or strstr not defined
218 STRUTIL="strutil.o"
219 fi
220
221 if test -n "$GCC"; then
222 dnl if we are running gcc, use -pipe
223 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
224
225 AC_MSG_CHECKING(compile and link profiling code)
226 AC_ARG_ENABLE(profiling,
227 [ --enable-profiling Compile and link profiling code],
228 [
229 if test "$enableval" = "yes" ; then
230 AC_MSG_RESULT(yes)
231 CFLAGS="$CFLAGS -pg -fprofile-arcs"
232 else
233 AC_MSG_RESULT(no)
234 fi
235 ],
236 [
237 AC_MSG_RESULT(no)
238 ])
239 fi
240
241 AC_MSG_CHECKING(whether to compile and link debugging code)
242 AC_ARG_ENABLE(debug,
243 [ --disable-debug Compile and link debugging code],
244 [
245 if test "$enableval" = "yes" ; then
246 AC_MSG_RESULT(yes)
247 LDFLAGS="$LDFLAGS -g"
248 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
249 else
250 AC_MSG_RESULT(no)
251 fi
252 ],
253 [
254 AC_MSG_RESULT(yes)
255 LDFLAGS="$LDFLAGS -g"
256 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
257 ])
258
259 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
260 AC_ARG_WITH(dmalloc,
261 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
262 [
263 if test "$withval" = "yes"; then
264 AC_MSG_RESULT(trying)
265 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
266 else
267 AC_MSG_RESULT(no)
268 fi
269 ],
270 [
271 AC_MSG_RESULT(no)
272 ])
273
274 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
275 AC_ARG_WITH(efence,
276 [ --with-efence link with the Electric Fence memory debugger ],
277 [
278 if test "$withval" = "yes"; then
279 AC_MSG_RESULT(trying)
280 AC_CHECK_LIB(efence, main)
281 else
282 AC_MSG_RESULT(no)
283 fi
284 ],
285 [
286 AC_MSG_RESULT(no)
287 ])
288
289 dnl For anything that wasn't found but we have source for
290 AC_SUBST(STRUTIL)
291 AC_SUBST(ALPHASORT)
292 AC_SUBST(SCANDIR)
293
294 AC_CONFIG_FILES([Makefile src/Makefile extras/Makefile contrib/Makefile examples/Makefile docs/Makefile])
295
296 AC_OUTPUT
297
298 echo "**********************************************************"
299 echo ""
300 echo "An example configuration file for hydra can be found at"
301 echo "examples/hydra.conf."
302 echo ""
303 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26