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

Contents of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Fri Sep 27 10:35:54 2002 UTC (21 years, 6 months ago) by nmav
Branch: MAIN
Changes since 1.4: +2 -1 lines
*** empty log message ***

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26