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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (hide annotations)
Sat Oct 12 08:23:16 2002 UTC (21 years, 5 months ago) by nmav
Branch: MAIN
Changes since 1.21: +2 -2 lines
*** empty log message ***

1 nmav 1.22 dnl $Id: configure.in,v 1.21 2002/10/06 09:42:50 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.22 SERVER_VERSION="0.0.8"
8 nmav 1.4 AC_DEFINE_UNQUOTED(SERVER_VERSION, "$SERVER_VERSION", [Version of Hydra])
9 nmav 1.1 AC_DEFINE_UNQUOTED(SERVER_NAME, "Hydra", [Name of the server])
10    
11 nmav 1.4 AM_INIT_AUTOMAKE(hydra, $SERVER_VERSION, [nothing here])
12 nmav 1.1
13     dnl Make config.h
14     AM_CONFIG_HEADER(config.h)
15    
16 nmav 1.4 AM_MAINTAINER_MODE
17    
18 nmav 1.1 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 nmav 1.12 AC_C_INLINE
34 nmav 1.1 AC_TYPE_UID_T
35     AC_TYPE_PID_T
36     AC_HEADER_TIME
37    
38 nmav 1.18 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 nmav 1.1 dnl Checks for library functions.
49     AC_FUNC_SETVBUF_REVERSED
50     AC_FUNC_MMAP
51 nmav 1.20 AC_CHECK_FUNCS(getcwd strdup strstr gmtime_r)
52 nmav 1.1 AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
53 nmav 1.15 AC_CHECK_FUNCS(scandir alphasort qsort)
54 nmav 1.16 AC_CHECK_FUNCS(getrlimit setrlimit)
55 nmav 1.18 AC_CHECK_FUNCS(stat stat64 atoll,,)
56     AC_CHECK_FUNCS(open64 read64 write64 lseek64,,)
57 nmav 1.1
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 nmav 1.19 AM_PATH_LIBGNUTLS( 0.5.9,
162 nmav 1.11 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Have libgnutls])
163 nmav 1.10 LIBS="$LIBS $LIBGNUTLS_LIBS"
164     CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
165     AC_DEFINE( ENABLE_SSL, 1, [whether to enable ssl]),
166 nmav 1.11 AC_MSG_WARN([[
167 nmav 1.1 ***
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 nmav 1.5 CFLAGS="$CFLAGS -D_REENTRANT"
195 nmav 1.6 fi
196    
197 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
198     else use_hic = no
199     fi
200 nmav 1.6
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 nmav 1.7 if test "$use_smp" = "yes"; then use_hic=yes
206     else use_hic = no
207     fi
208 nmav 1.6 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 nmav 1.1 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 nmav 1.21 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 nmav 1.1 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 nmav 1.15 AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile examples/Makefile docs/Makefile])
300 nmav 1.3
301     AC_OUTPUT
302 nmav 1.4
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