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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Thu Sep 26 14:52:17 2002 UTC (21 years, 6 months ago) by nmav
Branch: MAIN
CVS Tags: hydra_0_0_2
Changes since 1.3: +15 -4 lines
last changes for 0.0.2

1 dnl $Id: configure.in,v 1.3 2002/09/26 14:20:20 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 fi
191
192
193 if test $ac_cv_func_strdup = no -o $ac_cv_func_strstr = no; then
194 # strdup or strstr not defined
195 STRUTIL="strutil.o"
196 fi
197
198 if test -n "$GCC"; then
199 dnl if we are running gcc, use -pipe
200 test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
201
202 AC_MSG_CHECKING(compile and link profiling code)
203 AC_ARG_ENABLE(profiling,
204 [ --enable-profiling Compile and link profiling code],
205 [
206 if test "$enableval" = "yes" ; then
207 AC_MSG_RESULT(yes)
208 CFLAGS="$CFLAGS -pg -fprofile-arcs"
209 else
210 AC_MSG_RESULT(no)
211 fi
212 ],
213 [
214 AC_MSG_RESULT(no)
215 ])
216 fi
217
218 AC_MSG_CHECKING(whether to compile and link debugging code)
219 AC_ARG_ENABLE(debug,
220 [ --disable-debug Compile and link debugging code],
221 [
222 if test "$enableval" = "yes" ; then
223 AC_MSG_RESULT(yes)
224 LDFLAGS="$LDFLAGS -g"
225 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
226 else
227 AC_MSG_RESULT(no)
228 fi
229 ],
230 [
231 AC_MSG_RESULT(yes)
232 LDFLAGS="$LDFLAGS -g"
233 test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
234 ])
235
236 AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
237 AC_ARG_WITH(dmalloc,
238 [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
239 [
240 if test "$withval" = "yes"; then
241 AC_MSG_RESULT(trying)
242 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
243 else
244 AC_MSG_RESULT(no)
245 fi
246 ],
247 [
248 AC_MSG_RESULT(no)
249 ])
250
251 AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
252 AC_ARG_WITH(efence,
253 [ --with-efence link with the Electric Fence memory debugger ],
254 [
255 if test "$withval" = "yes"; then
256 AC_MSG_RESULT(trying)
257 AC_CHECK_LIB(efence, main)
258 else
259 AC_MSG_RESULT(no)
260 fi
261 ],
262 [
263 AC_MSG_RESULT(no)
264 ])
265
266 dnl For anything that wasn't found but we have source for
267 AC_SUBST(STRUTIL)
268 AC_SUBST(ALPHASORT)
269 AC_SUBST(SCANDIR)
270
271 AC_CONFIG_FILES([Makefile src/Makefile extras/Makefile contrib/Makefile examples/Makefile docs/Makefile])
272
273 AC_OUTPUT
274
275 echo "**********************************************************"
276 echo ""
277 echo "An example configuration file for hydra can be found at"
278 echo "examples/hydra.conf."
279 echo ""
280 echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26