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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.40 - (hide annotations)
Thu Mar 9 18:11:49 2006 UTC (18 years ago) by nmav
Branch: MAIN
CVS Tags: hydra_0_1_6_without_hic
Changes since 1.39: +1 -26 lines
Removed the HIC support.

1 nmav 1.40 dnl $Id: configure.in,v 1.39 2004/12/10 20:09:22 nmav Exp $
2 nmav 1.1 dnl Process this file with autoconf to produce a configure script.
3     AC_PREREQ(2.50)
4    
5 nmav 1.4 AC_INIT
6    
7 nmav 1.25 AC_CANONICAL_HOST
8    
9 nmav 1.39 SERVER_VERSION="0.1.7"
10 nmav 1.4 AC_DEFINE_UNQUOTED(SERVER_VERSION, "$SERVER_VERSION", [Version of Hydra])
11 nmav 1.1 AC_DEFINE_UNQUOTED(SERVER_NAME, "Hydra", [Name of the server])
12    
13 nmav 1.4 AM_INIT_AUTOMAKE(hydra, $SERVER_VERSION, [nothing here])
14 nmav 1.1
15     dnl Make config.h
16     AM_CONFIG_HEADER(config.h)
17    
18 nmav 1.4 AM_MAINTAINER_MODE
19    
20 nmav 1.35 use_smp=yes
21    
22     AC_MSG_CHECKING(whether to include SMP support)
23     AC_ARG_ENABLE(smp, [ --disable-smp Do not include SMP support],
24     [
25     if test "$enableval" = "yes" ; then
26     use_smp=yes
27     else
28     use_smp=no
29     fi
30     ]
31     )
32    
33     AC_MSG_RESULT($use_smp)
34    
35     if test "$use_smp" = "yes"; then
36     dnl Check for pthreads and do not define ENABLE_SMP
37     dnl if not found
38    
39     ACX_PTHREAD(
40     AC_DEFINE( ENABLE_SMP, 1, [whether to enable SMP code])
41     LIBS="$PTHREAD_LIBS $LIBS"
42     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
43     CC="$PTHREAD_CC"
44     )
45     fi
46    
47 nmav 1.1 dnl Checks for programs.
48     AM_PROG_LEX
49     AC_PROG_YACC
50     AC_PROG_CC
51     AC_PROG_CPP
52    
53     dnl Checks for header files.
54     AC_HEADER_DIRENT
55     AC_HEADER_STDC
56     AC_HEADER_SYS_WAIT
57     AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
58     AC_CHECK_HEADERS(getopt.h netinet/tcp.h)
59    
60     dnl Checks for typedefs, structures, and compiler characteristics.
61     AC_C_CONST
62 nmav 1.12 AC_C_INLINE
63 nmav 1.1 AC_TYPE_UID_T
64     AC_TYPE_PID_T
65     AC_HEADER_TIME
66    
67 nmav 1.18 AC_CHECK_TYPE( off_t,
68     AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
69     )
70    
71 nmav 1.36 AC_SYS_LARGEFILE
72 nmav 1.30
73 nmav 1.1 dnl Checks for library functions.
74     AC_FUNC_SETVBUF_REVERSED
75     AC_FUNC_MMAP
76 nmav 1.20 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
77 nmav 1.1 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
78 nmav 1.15 AC_CHECK_FUNCS(scandir alphasort qsort)
79 nmav 1.16 AC_CHECK_FUNCS(getrlimit setrlimit)
80 nmav 1.30 AC_CHECK_FUNCS(stat)
81 nmav 1.1
82     AC_CHECK_STRUCT_FOR([
83     #if TIME_WITH_SYS_TIME
84     # include <sys/time.h>
85     # include <time.h>
86     #else
87     # if HAVE_SYS_TIME_H
88     # include <sys/time.h>
89     # else
90     # include <time.h>
91     # endif
92     #endif
93     ],tm,tm_gmtoff)
94    
95 nmav 1.30 if test $ac_cv_struct_tm_has_tm_gmtoff = yes; then
96 nmav 1.1 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
97     fi
98    
99     AC_CHECK_STRUCT_FOR([
100    
101     #if TIME_WITH_SYS_TIME
102     # include <sys/time.h>
103     # include <time.h>
104     #else
105     # if HAVE_SYS_TIME_H
106     # include <sys/time.h>
107     # else
108     # include <time.h>
109     # endif
110     #endif
111     ],tm,tm_zone)
112    
113     if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
114     AC_DEFINE(HAVE_TM_ZONE, 1, [Have tm_zone])
115     fi
116    
117     AC_CHECK_STRUCT_FOR([
118     #include <sys/types.h>
119     #include <netinet/in.h>
120     ],sockaddr_in,sin_len)
121    
122     if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
123     AC_DEFINE(HAVE_SIN_LEN,1, [Have sin_len])
124     fi
125    
126     if test $ac_cv_func_socket = no; then
127     # socket is not in the default libraries.
128     AC_CHECK_LIB(socket, socket,
129     [ MYLIBS="$MYLIBS -lsocket" ])
130     fi
131    
132     if test $ac_cv_func_inet_aton = no; then
133     # inet_aton is not in the default libraries.
134     AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
135     fi
136    
137     if test $ac_cv_func_gethostname = no; then
138     AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
139     fi
140    
141     dnl May end up with duplicate -lnsl -- oh well
142     if test $ac_cv_func_gethostbyname = no; then
143     AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
144     fi
145    
146     LIBS="$LIBS $MYLIBS"
147    
148     # Try to find TCP_CORK and use it if found.
149     AC_MSG_CHECKING([whether TCP_CORK is a valid TCP socket option])
150     AC_TRY_COMPILE(
151     #include <sys/socket.h>
152     #include <netinet/tcp.h>
153     #include <netinet/in.h>
154     ,[
155     int one = 1, fd;
156     if (setsockopt(fd, IPPROTO_TCP, TCP_CORK,
157     (void *) &one, sizeof (one)) == -1)
158     return -1;
159     return 0;
160    
161     ],
162     dnl *** FOUND
163     AC_DEFINE( HAVE_TCP_CORK, 1, [TCP_CORK was found and will be used])
164     AC_MSG_RESULT(yes),
165     dnl *** NOT FOUND
166     AC_MSG_RESULT(no)
167     )
168    
169 nmav 1.27 use_sendfile=yes
170 nmav 1.28 AC_MSG_CHECKING([whether to enable sendfile(2) usage])
171 nmav 1.27 AC_ARG_ENABLE(sendfile,
172     [ --disable-sendfile disable the use of the sendfile(2) system call],
173     [
174     if test "$enableval" = "no" ; then
175     use_sendfile=no
176     else
177     use_sendfile=yes
178     fi
179     ]
180     )
181    
182 nmav 1.30 AC_MSG_RESULT($use_sendfile)
183    
184 nmav 1.27 if test "$use_sendfile" = "yes"; then
185     case $host_os in
186     *linux*)
187     AC_CHECK_HEADERS(sys/sendfile.h)
188     AC_CHECK_FUNCS(sendfile)
189     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
190     AC_DEFINE(HAVE_LINUXSENDFILE, 1, [whether to use Linux' sendfile])
191     ;;
192     *freebsd*)
193     AC_CHECK_HEADERS(sys/sendfile.h)
194     AC_CHECK_FUNCS(sendfile)
195     AC_DEFINE(HAVE_BSDSENDFILE, 1, [whether to use FreeBSD's sendfile])
196     AC_DEFINE(HAVE_SENDFILE, 1, [whether to use sendfile])
197     ;;
198     *) ;;
199     esac
200     fi
201    
202 nmav 1.1 use_ssl=yes
203    
204     AC_MSG_CHECKING(whether to include SSL and TLS support)
205     AC_ARG_ENABLE(ssl, [ --disable-ssl Do not include SSL and TLS support],
206     [
207     if test "$enableval" = "yes" ; then
208     use_ssl=yes
209     else
210     use_ssl=no
211     fi
212     ]
213     )
214    
215     AC_MSG_RESULT($use_ssl)
216    
217     if test "$use_ssl" = "yes"; then
218 nmav 1.38 AM_PATH_LIBGNUTLS( 1.0.9,
219 nmav 1.11 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
220 nmav 1.10 LIBS="$LIBS $LIBGNUTLS_LIBS"
221     CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
222     AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
223 nmav 1.11 AC_MSG_WARN([[
224 nmav 1.1 ***
225     *** libgnutls was not found. You may want to get it from
226     *** ftp://ftp.gnutls.org/pub/gnutls/
227     ]]))
228    
229     fi
230    
231 nmav 1.6
232 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
233     else use_hic = no
234     fi
235 nmav 1.6
236 nmav 1.31 AC_CHECK_FUNC( fnmatch,
237     AC_DEFINE( ENABLE_ACCESS_LISTS, 1, [whether to enable file access control lists]) ,
238     AC_MSG_WARN([[
239     ***
240     *** fnmatch() is not available in your system. File access control lists
241     *** will not be available.
242     ]])
243     )
244 nmav 1.1
245     if test -n "$GCC"; then
246     dnl if we are running gcc, use -pipe
247     test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
248    
249     AC_MSG_CHECKING(compile and link profiling code)
250     AC_ARG_ENABLE(profiling,
251     [ --enable-profiling Compile and link profiling code],
252     [
253     if test "$enableval" = "yes" ; then
254     AC_MSG_RESULT(yes)
255 nmav 1.21 AC_CHECK_PROG(FC_OK, fc-config, yes, no)
256     if test x$FC_OK = xyes; then
257     CFLAGS="${CFLAGS} `fc-config --cflags`"
258     LIBS="$LIBS `fc-config --libs`"
259     else
260     AC_MSG_WARN(***
261     *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html
262     )
263     fi
264 nmav 1.30
265 nmav 1.1 else
266     AC_MSG_RESULT(no)
267     fi
268     ],
269     [
270     AC_MSG_RESULT(no)
271     ])
272     fi
273    
274     AC_MSG_CHECKING(whether to compile and link debugging code)
275     AC_ARG_ENABLE(debug,
276     [ --disable-debug Compile and link debugging code],
277     [
278     if test "$enableval" = "yes" ; then
279     AC_MSG_RESULT(yes)
280     LDFLAGS="$LDFLAGS -g"
281     test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
282     else
283     AC_MSG_RESULT(no)
284     fi
285     ],
286     [
287     AC_MSG_RESULT(yes)
288     LDFLAGS="$LDFLAGS -g"
289     test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
290     ])
291    
292     AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
293     AC_ARG_WITH(dmalloc,
294     [ --with-dmalloc link with the Dmalloc memory debugger/profiler],
295     [
296     if test "$withval" = "yes"; then
297     AC_MSG_RESULT(trying)
298     AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
299     else
300     AC_MSG_RESULT(no)
301     fi
302     ],
303     [
304     AC_MSG_RESULT(no)
305     ])
306    
307     AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
308     AC_ARG_WITH(efence,
309     [ --with-efence link with the Electric Fence memory debugger ],
310     [
311     if test "$withval" = "yes"; then
312     AC_MSG_RESULT(trying)
313     AC_CHECK_LIB(efence, main)
314     else
315     AC_MSG_RESULT(no)
316     fi
317     ],
318     [
319     AC_MSG_RESULT(no)
320     ])
321 nmav 1.25
322    
323     POLL_OR_SELECT
324    
325     if test "$BOA_ASYNC_IO" = "poll"; then
326     AC_DEFINE( USE_POLL, 1, [whether to use poll])
327     fi
328    
329     # there are three scenarios
330     # GNU make is installed as "make"
331     # GNU make is installed as something else we detected
332     # GNU make is not installed
333     # Unfortunately, we can't deal with it one way or the other
334     # Trying multiple AC_OUTPUT confuses autoconf, and using variables
335     # *in* AC_OUTPUT is even worse.
336     # *so*, make a default makefile that just forces make to call gmake
337     # or whatever.
338 nmav 1.1
339 nmav 1.35 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile contrib/redhat/Makefile examples/Makefile docs/Makefile])
340 nmav 1.3
341     AC_OUTPUT
342 nmav 1.4
343     echo "**********************************************************"
344     echo ""
345     echo "An example configuration file for hydra can be found at"
346     echo "examples/hydra.conf."
347     echo ""
348     echo "**********************************************************"

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26