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

Annotation of /hydra/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations)
Wed Oct 2 13:48:35 2002 UTC (18 years, 11 months ago) by nmav
Branch: MAIN
Changes since 1.14: +3 -24 lines
Added compatibility function implementations such as scandir(), strstr() etc, in src/. Scandir implementation was replaced by the one in gnu libc.

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26