Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 1125 lines (951 sloc) 31.335 kb
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
1 dnl -*- mode: m4-mode -*-
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
2 dnl Process this file with autoconf to produce a configure script.
3
4 AC_COPYRIGHT([
5 Copyright (C) 2001-2006 Alvaro Lopez Ortega
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of version 2 of the GNU General Public
9 License as published by the Free Software Foundation.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
20 ])
21
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
22 dnl require autoconf 2.56
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
23 AC_PREREQ(2.56)
24
25 dnl Version
26 m4_define([cherokee_major_version], [0])
a5dd2dd @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@247 5dc97367-97…
alobbs authored
27 m4_define([cherokee_minor_version], [6])
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
28 m4_define([cherokee_micro_version], [0])
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
29 m4_define([cherokee_version], m4_format('%s.%s.%s', cherokee_major_version, cherokee_minor_version, cherokee_micro_version))
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
30
31 dnl Init autoconf and automake
e8c75f5 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@438 5dc97367-97…
alobbs authored
32 AC_INIT([cherokee], [cherokee_version], [http://bugs.cherokee-project.com], [cherokee])
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
33 AC_CONFIG_SRCDIR([cherokee/server.c])
34 AM_INIT_AUTOMAKE([no-define])
35
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
36 dnl Define version
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
37 AC_DEFINE(PACKAGE_MAJOR_VERSION, "cherokee_major_version", [Version string])
38 AC_DEFINE(PACKAGE_MINOR_VERSION, "cherokee_minor_version", [Version string])
39 AC_DEFINE(PACKAGE_MICRO_VERSION, "cherokee_micro_version", [Version string])
40
41 PACKAGE_MAJOR_VERSION="cherokee_major_version"
42 PACKAGE_MINOR_VERSION="cherokee_minor_version"
43 PACKAGE_MICRO_VERSION="cherokee_micro_version"
44 AC_SUBST(PACKAGE_MAJOR_VERSION)
45 AC_SUBST(PACKAGE_MINOR_VERSION)
46 AC_SUBST(PACKAGE_MICRO_VERSION)
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
47
500a566 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@478 5dc97367-97…
alobbs authored
48
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
49 dnl Check the SVN revision
50 AC_ARG_ENABLE(beta, AC_HELP_STRING([--enable-beta], [Enable beta development]),
51 is_beta="$enableval", is_beta="no")
52
53 if test x"$is_beta" == "xyes"; then
54 if test -d ".svn"; then
86dcbbb @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@471 5dc97367-97…
alobbs authored
55 svn_rev="`svn info -R | grep Revision | sort | tail -1 | sed 's/Revision: //'`";
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
56 fi
57
86dcbbb @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@471 5dc97367-97…
alobbs authored
58 PACKAGE_PATCH_VERSION="b$svn_rev"
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
59
60 dnl Redefine versions
61 PACKAGE_VERSION="$PACKAGE_MAJOR_VERSION.$PACKAGE_MINOR_VERSION.$PACKAGE_MICRO_VERSION$PACKAGE_PATCH_VERSION"
d66e3cd @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@472 5dc97367-97…
alobbs authored
62 AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "${PACKAGE_VERSION}", [Package version])
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
63
64 VERSION="$PACKAGE_MAJOR_VERSION.$PACKAGE_MINOR_VERSION.$PACKAGE_MICRO_VERSION$PACKAGE_PATCH_VERSION"
65 AC_DEFINE(VERSION, $VERSION, [Software version])
500a566 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@478 5dc97367-97…
alobbs authored
66 else
67
68 PACKAGE_PATCH_VERSION=""
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
69 fi
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
70
500a566 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@478 5dc97367-97…
alobbs authored
71 dnl Path version
72 AC_SUBST(PACKAGE_PATCH_VERSION)
73 AC_DEFINE_UNQUOTED(PACKAGE_PATCH_VERSION, "${PACKAGE_PATCH_VERSION}", [Version string])
74
4b33faa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@522 5dc97367-97…
alobbs authored
75 dnl Initial CFLAGS
76 AC_MSG_CHECKING(initial CFLAGS)
77 AC_MSG_RESULT($CFLAGS)
500a566 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@478 5dc97367-97…
alobbs authored
78
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
79 dnl Check for CPU / vendor / OS
94d0935 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@470 5dc97367-97…
alobbs authored
80 AC_CANONICAL_HOST
81
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
82 os_string="UNIX"
83 so_suffix=so
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
84 mod_suffix=$so_suffix
85
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
86 AC_MSG_CHECKING([host platform characteristics])
87 case "$host" in
88 *-*-mingw*|*-*-cygwin*)
89 so_suffix=DLL
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
90 mod_suffix=$so_suffix
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
91 os_string="Win32"
92 libdl=
93 ;;
94 *-*-*netbsd*)
95 thread_ldflags="-pthread"
96 libdl=
97 ;;
98 *-*-*freebsd*|*-*-*openbsd*|*-*-*dragonfly*)
99 thread_ldflags="-pthread"
100 libdl="-pthread"
101 ;;
102 *-*-linux*)
103 thread_ldflags="-lpthread"
104 libdl="-ldl"
105 ;;
106 *-*-hpux*)
107 thread_ldflags="-lpthread"
108 libdl="-ldl"
109 ;;
110 *-*-solaris*)
111 AC_DEFINE(SOLARIS, 1, [It is Solaris])
112 setenv_is_threadsafe="yes"
113 libdl="-ldl"
114 ;;
115 *-*-darwin*)
116 so_suffix=dylib
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
117 mod_suffix=so
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
118 thread_ldflags="-pthread"
119 libdl="-ldl"
120 ;;
121 *)
122 AC_MSG_WARN([*** Please add $host to configure.in checks!])
123 libdl="-ldl"
124 ;;
125 esac
126 AC_MSG_RESULT(ok)
127
128 dnl
129 dnl OS string
130 dnl
131 AC_ARG_ENABLE(os_string, AC_HELP_STRING([--enable-os-string=STR], [Set a customized OS type string]), [os_string="$enableval"])
132 AC_DEFINE_UNQUOTED(OS_TYPE, "${os_string}", [OS type])
133
134 AC_ARG_ENABLE(trace, AC_HELP_STRING([--enable-trace], [Enable trace facility]),
135 [enable_trace="$enableval"
136 AC_DEFINE(TRACE_ENABLED, 1, [Trace facility])
137 ], [enable_trace="no"])
138
139 dnl
140 dnl Dynamic library loading library
141 dnl
142 LIBS="$LIBS $libdl"
143 AC_DEFINE_UNQUOTED(SO_SUFFIX, "${so_suffix}", [Dynamic loading libraries extension])
3509796 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@282 5dc97367-97…
alobbs authored
144 AC_DEFINE_UNQUOTED(MOD_SUFFIX, "${mod_suffix}", [Dynamic modules extension])
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
145
146 dnl
147 dnl Platforms
148 dnl
149 AM_CONDITIONAL(PLATFORM_WIN32, test x"$os_string" = "xWin32")
150
151 dnl
152 dnl Libtool options
153 dnl
154 if test "$os_string" != "Win32"; then
155 # libtool option to control which symbols are exported
156 # right now, symbols starting with _ are not exported
157 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
158 else
159 LIBTOOL_EXPORT_OPTIONS=
160 fi
161
162 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
163
164
165
166 AM_INIT_AUTOMAKE(cherokee, $VERSION)
167 AM_MAINTAINER_MODE
168
169 AM_CONFIG_HEADER(config.h)
170 AC_SUBST(VERSION)
171
172 AC_PATH_PROG(cherokeepath, cherokee)
173
174 AC_PROG_CC
175 AC_PROG_INSTALL
176 AC_PROG_MAKE_SET
177
178 AC_LIBTOOL_DLOPEN
179 AC_LIBTOOL_WIN32_DLL
180 AM_PROG_LIBTOOL
181
182 AC_FUNC_CLOSEDIR_VOID
183 AC_FUNC_MALLOC
184 AC_FUNC_REALLOC
185 AC_FUNC_VPRINTF
186
187 AC_C_CONST
188 AC_C_BIGENDIAN
189 AC_C_INLINE
190 if test "$ac_cv_c_inline" != no; then
191 AC_DEFINE(HAVE_INLINE, 1, [Compile supports inline])
192 fi
193
194 dnl
195 dnl Check for headers
196 dnl
197 AC_HEADER_STDC
198 AC_HEADER_DIRENT
199 AC_HEADER_TIME
200 AC_HEADER_SYS_WAIT
201
202 AC_CHECK_HEADERS(endian.h machine/endian.h sys/endian.h sys/isa_defs.h sys/utsname.h sys/poll.h poll.h )
203 AC_CHECK_HEADERS(sys/socket.h sys/un.h netinet/in.h arpa/inet.h netinet/tcp.h sys/ioctl.h fcntl.h sys/time.h)
204 AC_CHECK_HEADERS(sys/resource.h resource.h unistd.h syslog.h stdint.h inttypes.h error.h pwd.h sys/uio.h)
205 AC_CHECK_HEADERS(pthread.h netdb.h stdarg.h sys/filio.h sys/varargs.h sys/select.h sys/mman.h grp.h winsock.h)
206 AC_CHECK_HEADERS(winsock.h winsock2.h)
207
208 AC_SYS_LARGEFILE
209
210 AC_SIZE_T
211 AC_TYPE_SIGNAL
212 AC_TYPE_UID_T
213 AC_TYPE_MODE_T
214 AC_TYPE_OFF_T
215 AC_TYPE_SIZE_T
216 AC_TYPE_PID_T
217 AC_STRUCT_ST_RDEV
9521853 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@528 5dc97367-97…
alobbs authored
218 AC_CHECK_TYPE(ino_t, unsigned)
219 AC_CHECK_TYPE(loff_t, off_t)
220 AC_CHECK_TYPE(offset_t, loff_t)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
221 AC_CHECK_TYPE(ssize_t, int)
222 AC_CHECK_TYPE(wchar_t, unsigned short)
223
9521853 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@528 5dc97367-97…
alobbs authored
224 AC_CHECK_SIZEOF(int)
225 AC_CHECK_SIZEOF(unsigned int)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
226 AC_CHECK_SIZEOF(unsigned long)
227 AC_CHECK_SIZEOF(unsigned long long)
228 AC_CHECK_SIZEOF(unsigned int)
229 AC_CHECK_SIZEOF(off_t)
9521853 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@528 5dc97367-97…
alobbs authored
230 AC_CHECK_SIZEOF(size_t)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
231
232 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
233 AC_TRY_RUN([#include <stdio.h>
234 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
235 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
236 if test x"$samba_cv_have_longlong" = x"yes"; then
237 AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
238 fi
239
240 AC_FUNC_MEMCMP
241 AC_FUNC_MMAP
242
83fd835 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@333 5dc97367-97…
alobbs authored
243 AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r getrlimit getdtablesize readdir readdir_r flockfile funlockfile)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
244
c5205f7 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@379 5dc97367-97…
alobbs authored
245 FW_CHECK_PWD
246 FW_CHECK_GRP
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
247
9527966 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@443 5dc97367-97…
alobbs authored
248 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
249 AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm]),,[#include <time.h>])
250
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
251 AH_BOTTOM([
252 /* Give us an unsigned 32-bit data type. */
253 #if SIZEOF_UNSIGNED_LONG==4
254 #define UWORD32 unsigned long
255 #elif SIZEOF_UNSIGNED_INT==4
256 #define UWORD32 unsigned int
257 #else
258 #error I do not know what to use for a UWORD32.
259 #endif
260 ])
261
262
263 dnl Find socket()
264 dnl Likely combinations:
265 dnl -lsocket [ -lnsl_s | -lnsl ]
266 dnl -linet
267 AC_CHECK_LIB(ws2_32, main)
268 AC_CHECK_LIB(wsock32, main)
269
270 AC_CHECK_FUNC(socket, :, [
271 AC_CHECK_LIB(socket, main)
272 AC_CHECK_LIB(net, main)
273 AC_CHECK_LIB(nsl_s, main)
274 AC_CHECK_LIB(nsl, main)
275 AC_CHECK_LIB(inet, socket)
276 AC_CHECK_LIB(gen, main)
277 ])
278
279 AC_SEARCH_LIBS(accept, socket)
280 AC_SEARCH_LIBS(bind, socket)
281 AC_SEARCH_LIBS(listen, socket)
282 AC_SEARCH_LIBS(setsockopt, socket)
283
284 dnl
285 dnl Check for fd events inspect functions
286 dnl
287 AC_CHECK_FUNC(poll, have_poll=yes)
288 AC_CHECK_FUNC(kqueue, have_kqueue=yes)
289 AC_CHECK_FUNC(select, have_select=yes)
290
291 if test "x-$have_select" != "x-yes" -a "x-$ac_cv_header_winsock2_h" = "x-yes"; then
292 AC_MSG_CHECKING([for select in ws2_32])
293 AC_TRY_LINK([#include <winsock2.h>],
294 [select(0,0,0,0,0)],
295 [AC_MSG_RESULT(yes)
296 have_win32_select=yes],
297 [AC_MSG_RESULT(no)])
298 fi
299
300 dnl
301 dnl Epoll
302 dnl
303 AC_CHECK_HEADER(sys/epoll.h, have_epoll_include=yes, have_epoll_include=no)
304
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
305 AC_ARG_ENABLE(epoll, AC_HELP_STRING([--disable-epoll],[Disable epoll() support]),
306 wants_epoll="$enableval", wants_epoll="yes")
307
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
308 have_epoll=no
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
309 if test "x$have_epoll_include" = "xyes" && test "x$wants_epoll" == "xyes"; then
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
310 AC_MSG_CHECKING(for epoll system call)
311
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
312 AC_RUN_IFELSE([
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
313 #include <stdint.h>
314 #include <sys/param.h>
315 #include <sys/types.h>
316 #include <sys/syscall.h>
317 #include <sys/epoll.h>
318 #include <unistd.h>
319
320 int epoll_create (int size) {
321 return (syscall(__NR_epoll_create, size));
322 }
323
324 int main (int argc, char **argv) {
325 int epfd;
326 epfd = epoll_create(256);
327 exit (epfd == -1 ? 1 : 0);
328 }
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
329 ],
330 have_epoll=yes,
331 have_epoll=no,
332 have_epoll=yes)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
333 AC_MSG_RESULT($have_epoll)
334 fi
335
336 dnl
337 dnl Solaris 10: Event ports
338 dnl
339 AC_CHECK_HEADER(port.h, have_port_include=yes, have_port_include=no)
340
341 have_port=no
342 if test "x$have_port_include" = "xyes"; then
343 AC_MSG_CHECKING(for event ports support)
344
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
345 AC_RUN_IFELSE([
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
346 #include <stdint.h>
347 #include <unistd.h>
348 #include <port.h>
349
350 int main (int argc, char **argv) {
351 int port;
352 port = port_create();
353 exit (port < 0 ? 1 : 0);
354 }
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
355 ],
356 have_port=yes,
357 have_port=no,
358 have_port=cross)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
359 AC_MSG_RESULT($have_port)
360 fi
361
362
363
364 if test "$have_epoll" = yes; then
365 AC_DEFINE(HAVE_EPOLL, 1, [Have epoll])
366 fi
367 AM_CONDITIONAL(COMPILE_EPOLL, test x"$have_epoll" = "xyes")
368
369 if test "$have_kqueue" = yes; then
370 AC_DEFINE(HAVE_KQUEUE, 1, [Have kqueue])
371 fi
372 AM_CONDITIONAL(COMPILE_KQUEUE, test x"$have_kqueue" = "xyes")
373
374 if test "$have_port" = yes; then
375 AC_DEFINE(HAVE_PORT, 1, [Have event ports])
376 fi
377 AM_CONDITIONAL(COMPILE_PORT, test x"$have_port" = "xyes")
378
379 if test "$have_poll" = yes; then
380 AC_DEFINE(HAVE_POLL, 1, [Have poll])
381 fi
382 AM_CONDITIONAL(COMPILE_POLL, test x"$have_poll" = "xyes")
383
384 if test "$have_win32_select" = yes; then
385 AC_DEFINE(HAVE_WIN32_SELECT, 1, [Have Win32 select])
386 fi
387 AM_CONDITIONAL(COMPILE_WIN32_SELECT, test x"$have_win32_select" = "xyes")
388
389 if test "$have_select" = yes; then
390 AC_DEFINE(HAVE_SELECT, 1, [Have select])
391 fi
392 AM_CONDITIONAL(COMPILE_SELECT, test x"$have_select" = "xyes" -a x"$have_win32_select" != "xyes")
393
394
395 dnl
396 dnl Check for inet_pton. We have our own, but on Solaris the version in
397 dnl libresolv is more lenient in ways that Solaris's internal DNS resolution
398 dnl code requires, so if we use our own *and* link with libresolv (which may
399 dnl be forced by Perl) DNS resolution fails.
400 dnl
401 AC_SEARCH_LIBS(inet_pton, [socket nsl resolv])
402 AC_CHECK_FUNCS(inet_pton inet_ntop inet_addr)
403
404 AC_SEARCH_LIBS(gethostbyname, [socket nsl resolv])
405 AC_CHECK_FUNCS(gethostbyname gethostbyname_r)
406
407 dnl
408 dnl Check for inet_addr
409 dnl
410 AC_SEARCH_LIBS(inet_addr, xnet)
411 AC_CHECK_FUNCS(inet_addr)
412
413 dnl
414 dnl TCP_CORK
415 dnl
416 HYDRA_TCP_CORK
417
418
419 dnl
420 dnl Check for GNU getopt_long()
421 dnl
422 #AC_SEARCH_LIBS(getopt_long, [iberty gnugetopt])
423 AC_CHECK_HEADERS(getopt.h)
424 AC_CHECK_FUNC(getopt_long, have_getopt_long="yes")
425 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x"$have_getopt_long" = "xyes")
426
427
428 dnl
429 dnl Pthread
430 dnl
431 with_pthread="yes"
432 AC_ARG_ENABLE(pthread, AC_HELP_STRING([--disable-pthread],[Disable threading support]),
433 with_pthread="$enableval", with_pthread="yes")
434
435 AM_CONDITIONAL(USE_PTHREAD, test "x$with_pthread" = "xyes")
436 if test "x$with_pthread" = "xyes"
437 then
438 ACX_PTHREAD( , AC_MSG_ERROR([POSIX threads missing]))
439
440 dnl I'm not sure about it..
441 dnl but I've had problems compiling in some GNU/Linux machines
442 dnl because ACX_PTHREAD didn't add -lpthread
443 if test "x$PTHREAD_LIBS" = "x"
444 then
445 # AC_CHECK_LIB(pthread, pthread_create,
446 # [PTHREAD_LIBS="-lpthread"
447 # AC_SUBST(PTHREAD_LIBS)])
448 PTHREAD_LIBS="$thread_ldflags"
449 AC_SUBST(PTHREAD_LIBS)
450 fi
451
452 if test "$acx_pthread_ok" = "yes"; then
453
454 AC_MSG_CHECKING([for pthread_rwlock_t support])
455 have_pthread_rwlock_t=yes
4b33faa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@522 5dc97367-97…
alobbs authored
456
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
457 AC_TRY_COMPILE([#include <pthread.h>],
458 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
459 AC_MSG_RESULT([ok]),
460
4b33faa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@522 5dc97367-97…
alobbs authored
461 dnl Didn't find rwlock_t.
462 dnl Try defining _XOPEN_SOURCE=500
463 dnl
464 oldcflags="$CFLAGS"
465 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500"
466
467 AC_TRY_COMPILE([#include <pthread.h>],
468 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;]
469 ,
470 AC_MSG_RESULT([-D_XOPEN_SOURCE=500])
471 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_XOPEN_SOURCE=500"
472 AC_SUBST(PTHREAD_CFLAGS)
473 # AC_DEFINE(_XOPEN_SOURCE, 500, [Define this if it is needed for pthread_rwlock_t support])
474 ,
475 have_pthread_rwlock_t=no
476 # AC_MSG_ERROR([pthread_rwlock_t support missing]))
477 )
478
479 CFLAGS="$oldcflags"
480 )
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
481
482 if test "$have_pthread_rwlock_t" = yes; then
483 AC_DEFINE(HAVE_PTHREAD_RWLOCK_T, 1, [Define if your pthread library includes pthread_rwlock_t])
484 fi
4b33faa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@522 5dc97367-97…
alobbs authored
485
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
486 with_pthread="yes"
487 fi
488 fi
489
490 AC_CHECK_FUNC(pthread_attr_setschedpolicy, have_pthread_attr_setschedpolicy=yes)
491 if test x"$have_pthread_attr_setschedpolicy" = "xyes"; then
492 AC_DEFINE(HAVE_PTHREAD_SETSCHEDPOLICY, 1, [Pthread support pthread_attr_setschedpolicy])
493 fi
494
495 dnl
496 dnl Is setenv() threadsafe?
497 dnl
498 if test "$setenv_is_threadsafe" = "yes"; then
499 AC_DEFINE(SETENV_IS_THREADSAFE, 1, [setenv function is thread safe])
500 fi
501
502 dnl
503 dnl Check for vsyslog
504 dnl
505 AC_CHECK_FUNCS(syslog vsyslog strsep strcasestr memmove strerror bcopy strlcat)
506
423d6fa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@370 5dc97367-97…
alobbs authored
507 dnl
508 dnl Check for Glib (usually Linux)
509 dnl
510 AC_PREPROC_IFELSE([
511 #include <features.h>
512 #ifndef __GLIBC__
513 chokeme
514 #endif
515 ], [
516 AC_DEFINE([HAVE_GLIBC], [1], [Define to 1 if you have glibc.])
517 AC_DEFINE([_GNU_SOURCE], [1], [Define to 1 if you have glibc.])
518 ])
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
519
520 dnl
521 dnl Does this platform require array notation to assign to a va_list?
522 dnl If cross-compiling, we assume va_list is "normal". If this breaks
523 dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
524 dnl also just to be sure.
525 dnl
526 AC_MSG_CHECKING(whether va_list assignments need array notation)
527 AC_CACHE_VAL(ac_cv_valistisarray,
528 [AC_TRY_RUN([#include <stdlib.h>
529 #include <stdarg.h>
530 void foo(int i, ...) {
531 va_list ap1, ap2;
532 va_start(ap1, i);
533 ap2 = ap1;
534 if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); }
535 va_end(ap1); va_end(ap2);
536 }
537 int main()
538 { foo(0, 123); return(0); }],
539 [ac_cv_valistisarray=false],
540 [ac_cv_valistisarray=true],
541 [ac_cv_valistisarray=false])])
542
543 if test "$ac_cv_valistisarray" = true ; then
544 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY,,[va_list works copying an array])
545 AC_MSG_RESULT(yes)
546 else
547 AC_MSG_RESULT(no)
548 fi
549
550
551 dnl
552 dnl Check if the global variable `timezone' exists. If so, define
553 dnl HAVE_INT_TIMEZONE.
554 dnl
555 AC_STRUCT_TIMEZONE
556
557 AC_MSG_CHECKING(for global timezone)
558 AC_TRY_LINK([#include <time.h>],
559 [int res; res = timezone / 60;],
560 [AC_MSG_RESULT(yes)
561 AC_DEFINE(HAVE_INT_TIMEZONE,, [Set to 1 if you have the global variable timezone])],
562 AC_MSG_RESULT(no))
563
564
565 dnl
566 dnl Check for RTDL constants (from Haskell code)
567 dnl
568 dnl ** check for libdl & RTLD_NEXT
569 dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set
570 AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h)
571 AC_EGREP_CPP(yes,
572 [
573 #include <dlfcn.h>
574 #ifdef RTLD_NEXT
575 yes
576 #endif
577 ], [
578 AC_MSG_RESULT(yes)
579 AC_DEFINE(HAVE_RTLDNEXT,,[Have RTDL_NEXT])
580 HaveRtldNext=YES
581 ], [
582 AC_MSG_RESULT(no)
583 HaveRtldNext=NO
584 ])
585 AC_SUBST(HaveRtldNext)
586
587 dnl ** RTLD_LOCAL isn't available on cygwin or openbsd
588 AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
589 AC_EGREP_CPP(yes,
590 [
591 #include <dlfcn.h>
592 #ifdef RTLD_LOCAL
593 yes
594 #endif
595 ], [
596 AC_MSG_RESULT(yes)
597 AC_DEFINE(HAVE_RTLDLOCAL,,[Have RTDL_LOCAL])
598 HaveRtldLocal=YES
599 ], [
600 AC_MSG_RESULT(no)
601 HaveRtldLocal=NO
602 ])
603 AC_SUBST(HaveRtldLocal)
604
605 dnl ** RTLD_GLOBAL isn't available on openbsd
606 AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h)
607 AC_EGREP_CPP(yes,
608 [
609 #include <dlfcn.h>
610 #ifdef RTLD_GLOBAL
611 yes
612 #endif
613 ], [
614 AC_MSG_RESULT(yes)
615 AC_DEFINE(HAVE_RTLDGLOBAL,,[Have RTDL_GLOBAL])
616 HaveRtldGlobal=YES
617 ], [
618 AC_MSG_RESULT(no)
619 HaveRtldGlobal=NO
620 ])
621 AC_SUBST(HaveRtldGlobal)
622
623 dnl ** RTLD_NOW isn't available on openbsd
624 AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h)
625 AC_EGREP_CPP(yes,
626 [
627 #include <dlfcn.h>
628 #ifdef RTLD_NOW
629 yes
630 #endif
631 ], [
632 AC_MSG_RESULT(yes)
633 AC_DEFINE(HAVE_RTLDNOW,,[Have RTDL_NOW])
634 HaveRtldNow=YES
635 ], [
636 AC_MSG_RESULT(no)
637 HaveRtldNow=NO
638 ])
639 AC_SUBST(HaveRtldNow)
640
641
642 dnl
643 dnl Check of off64_t
644 dnl
645 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
646 AC_TRY_RUN([
647 #if defined(HAVE_UNISTD_H)
648 #include <unistd.h>
649 #endif
650 #include <stdio.h>
651 #include <sys/stat.h>
652 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
653 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
654 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
655 AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
656 fi
657
658
659 # From etr_socket_nsl.m4
660 ETR_SOCKET_NSL
661
662 # From sendfile_samba.m4
663 SENDFILE_CHECK
664
665 # Is sendfile broken?
666 AC_MSG_CHECKING(if sendfile works)
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
667 AC_RUN_IFELSE([#include <errno.h>
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
668 int main() {
669 int o = 0;
670 if (-1 == sendfile(0, 0, &o, 0) && errno == ENOSYS) return -1;
671 return 0;
672 } ],
673 AC_MSG_RESULT(yes),
674 [ AC_MSG_RESULT(no)
853c10e @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@453 5dc97367-97…
alobbs authored
675 AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])],
676 AC_MSG_RESULT(cross, assuming: yes))
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
677
678 # readdir_r()
cdf14c2 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@324 5dc97367-97…
alobbs authored
679 LIBWWW_READDIR_R_TYPE
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
680
681
682 dnl
683 dnl IPv6 Support
684 dnl I got this mostly from Apache's tests
685 dnl
686
687 AC_ARG_ENABLE(ipv6,
688 AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support]),
689 [ if test "$enableval" = "no"; then
690 disabled_ipv6=1
691 fi ],
692 [ disabled_ipv6=0 ] )
693
694 AC_SEARCH_LIBS(getaddrinfo, socket inet6)
695 AC_SEARCH_LIBS(getnameinfo, socket inet6)
696 AC_SEARCH_LIBS(gai_strerror, socket inet6)
697 AC_CHECK_FUNC(gai_strerror)
698
699 APR_CHECK_WORKING_GETADDRINFO
700 APR_CHECK_WORKING_GETNAMEINFO
701
702 AC_ACME_SOCKADDR_UN
703 AC_ACME_SOCKADDR_IN6
704 AC_ACME_SOCKADDR_STORAGE
705
706 AC_MSG_CHECKING(if the system supports IPv6)
707 have_ipv6="no"
708
709 if test "$disabled_ipv6" = 1; then
710 AC_MSG_RESULT([no -- disabled by user])
711 else
712 if test "x$ac_cv_acme_sockaddr_in6" = "xyes"; then
713 if test "x$ac_cv_working_getaddrinfo" = "xyes"; then
714 if test "x$ac_cv_working_getnameinfo" = "xyes"; then
715 have_ipv6="yes"
716 AC_MSG_RESULT([yes])
717 AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6 support.])
718 else
719 AC_MSG_RESULT([no -- no getnameinfo])
720 fi
721 else
722 AC_MSG_RESULT([no -- no working getaddrinfo])
723 fi
724 else
725 AC_MSG_RESULT([no -- no sockaddr_in6])
726 fi
727 fi
728
729 dnl
730 dnl Test whether SO_RCVTIMEO is broken
731 dnl
732 AC_CACHE_CHECK([whether setsockopt(SO_RCVTIMEO) is broken],
733 ac_cv_so_rcvtimeo_broken, [dnl
734 AC_RUN_IFELSE([AC_LANG_SOURCE([[
735 #if defined(HAVE_SYS_TYPES_H)
736 #include <sys/types.h>
737 #endif
738
739 #if defined(HAVE_SYS_SOCKET_H)
740 #include <sys/socket.h>
741 #endif
742
743 #if defined(HAVE_SYS_TIME_H)
744 #include <sys/time.h>
745 #endif
746
747 int main(void) {
748 int fd;
749 int ret;
750 struct timeval new_tv;
751
752 /* Open the socket (INET/TCP).*/
753 fd = socket(AF_INET, SOCK_STREAM, 0);
754
755 /* set the timeout for the incoming queue */
756 /* 1 second for example */
757 new_tv.tv_sec = 1;
758 new_tv.tv_usec = 0;
759
760 ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &new_tv, sizeof(new_tv));
761 return ret;
762 }
763 ]])],[ac_cv_so_rcvtimeo_broken=no],[ac_cv_so_rcvtimeo_broken=yes],[ac_cv_so_rcvtimeo_broken=cross])])
764 if test x"$ac_cv_so_rcvtimeo_broken" = x"yes"; then
765 AC_DEFINE(HAVE_BROKEN_SO_RCVTIMEO, 1, [Define if setsockopt(SO_RCVTIMEO) is broken])
766 fi
767
768 dnl
769 dnl Check of __func__ and co..
770 dnl
771 AC_MSG_CHECKING([whether our compiler supports __func__])
772 AC_TRY_COMPILE([],
773 [const char *cp = __func__;],
774 AC_MSG_RESULT([yes]),
775 AC_MSG_RESULT([no])
776 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
777 AC_TRY_COMPILE([],
778 [const char *cp = __FUNCTION__;],
779 AC_MSG_RESULT([yes])
780 AC_DEFINE(__func__, __FUNCTION__,
781 [Define to appropriate substitue if compiler doesnt have __func__]),
782 AC_MSG_RESULT([no])
783 AC_DEFINE(__func__, __FILE__,
784 [Define to appropriate substitue if compiler doesnt have __func__])))
785
786 dnl
787 dnl Check for pcre library
788 dnl
789 AC_CHECK_LIB(pcre, pcre_compile, have_pcre_lib=yes, have_pcre_lib=no)
790 AC_CHECK_HEADER(pcre.h, have_pcre_include=yes, have_pcre_include=no)
791 if test "$have_pcre_lib $have_pcre_include" = "yes yes"; then
792 have_pcre="yes"
793 else
794 have_pcre="built-in"
795 fi
796 AM_CONDITIONAL(USE_INTERNAL_PCRE, test $have_pcre = "built-in")
797
798
799 dnl
800 dnl PAM
801 dnl
802 have_pam="disabled"
803 AC_ARG_ENABLE(pam, AC_HELP_STRING([--disable-pam],[Disable PAM support]), use_pam="$enableval", use_pam="yes")
804 if test "x$use_pam" = "xyes"; then
805 AC_CHECK_LIB(pam, _pam_dispatch, have_pam=yes, have_pam=no)
806 AC_CHECK_HEADER(security/pam_modules.h, have_pam_include=yes, have_pam_include=no)
807 AC_CHECK_HEADERS(security/_pam_macros.h security/pam_appl.h)
808 fi
809 AM_CONDITIONAL(HAVE_PAM, test "$have_pam $have_pam_include" = "yes yes")
810
811 dnl
812 dnl crypt() and crypt_r()
813 dnl
814 AC_CHECK_HEADERS(crypt.h, have_crypt_include=yes, have_crypt_include=no)
815
816 AC_CHECK_LIB(crypt, crypt, have_crypt_lib="yes")
817 AM_CONDITIONAL(HAVE_CRYPT, test "$have_crypt_lib $have_crypt_include" = "yes yes")
818 if test "$have_crypt_lib" = "yes"; then
819 AC_DEFINE(HAVE_CRYPT, 1, [Have crypt function])
820 fi
821
822 AC_CHECK_LIB(crypt, crypt_r, have_crypt_r_lib="yes")
823 AM_CONDITIONAL(HAVE_CRYPT_R, test "$have_crypt_r_lib $have_crypt_include" = "yes yes")
824 if test "$have_crypt_r_lib" = "yes"; then
825 AC_DEFINE(HAVE_CRYPT_R, 1, [Have crypt_r function])
826 fi
827
828 if test "x$have_crypt_lib" = "xyes"; then
829 CRYPT_LIBS="-lcrypt"
830 AC_SUBST(CRYPT_LIBS)
831 fi
832
833 dnl
834 dnl crypt_r and pthread
835 dnl
836 if test "$have_crypt_r_lib" = "yes"; then
837 dnl
838 dnl struct crypt_data
839 dnl
840 oldcflags="$CFLAGS"
841 CFLAGS="$CFLAGS -D_GNU_SOURCE"
842
843 AC_MSG_CHECKING([for struct crypt_data])
844 AC_TRY_COMPILE([#include <crypt.h>],
845 [struct crypt_data data;]
846 ,
847 AC_MSG_RESULT([-D_GNU_SOURCE])
848 CRYPT_CFLAGS="-D_GNU_SOURCE"
849 AC_SUBST(CRYPT_CFLAGS)
850 ,
851 AC_MSG_ERROR([struct crypt_data is not known]))
852
853 CFLAGS="$oldcflags"
854 fi
855
856
857 dnl
858 dnl SSL and TLS
859 dnl
860 AC_ARG_ENABLE([tls],
861 [AC_HELP_STRING([--disable-tls],[Disable TLS/SSL support])
862 AC_HELP_STRING([--enable-tls=[gnutls|openssl]])],
863 enable_tls="$enableval", enable_tls="undef")
864
865 case "$enable_tls" in
866 no)
867 check_gnutls=no
868 check_openssl=no
869 ;;
870 undef|yes)
871 check_gnutls=yes
872 check_openssl=yes
873 ;;
874 gnu*)
875 check_gnutls=yes
876 check_openssl=no
877 ;;
878 open*)
879 check_gnutls=no
880 check_openssl=yes
881 ;;
882 *)
883 AC_MSG_ERROR([Incorrect TLS library])
884 ;;
885 esac
886
887 have_tls="no"
888
889 if test "$check_gnutls" = "yes" && test "$have_tls" = "no"
890 then
891 dnl
892 dnl GNUTLS
893 dnl
894 AM_PATH_LIBGNUTLS(1.0.4, [have_gnutls=yes], [have_gnutls=no])
895 if test "$have_gnutls" = "yes"
896 then
897 TLS_LIBS="$LIBGNUTLS_LIBS"
898 TLS_CFLAGS="$LIBGNUTLS_CFLAGS"
899 AC_SUBST(TLS_LIBS)
900 AC_SUBST(TLS_CFLAGS)
901
902 AC_DEFINE(HAVE_TLS, 1, [Have TLS support])
903 AC_DEFINE(HAVE_GNUTLS, 1, [Have libgnutls])
904 have_tls="gnutls"
905 else
906 enable_tls=no
907 fi
908 fi
909
910 if test "$check_openssl" = "yes" && test "$have_tls" = "no"
911 then
912 dnl
913 dnl OpenSSL
914 dnl
40aafe2 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@307 5dc97367-97…
alobbs authored
915 AC_CHECK_HEADERS([openssl/engine.h])
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
916 AC_CHECK_LIB(ssl, SSL_accept, [have_openssl=yes], [have_openssl=no])
917 if test "$have_openssl" = "yes"
918 then
919 TLS_LIBS="-lssl"
920 AC_SUBST(TLS_LIBS)
921
922 AC_DEFINE(HAVE_TLS, 1, [Have TLS support])
923 AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL library])
924 have_tls="openssl"
925 else
926 enable_tls=no
927 fi
928 fi
929
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
930 dnl
931 dnl LDAP
932 dnl
9eb4035 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@400 5dc97367-97…
alobbs authored
933 AC_ARG_WITH([ldap],
934 AC_HELP_STRING([--with-ldap=@<:@ARG@:>@],
935 [use OpenLDAP development library @<:@default=yes@:>@, optionally specify path to dev libs]
936 ),
937 [
938 if test "$withval" = "no"; then
939 want_ldap="no"
940 elif test "$withval" = "yes"; then
941 want_ldap="yes"
942 else
943 want_ldap="yes"
944 LDAP_CONFIG="$withval"
945 fi
946 ],
947 [want_ldap="yes"]
948 )
949
950 if test "$want_ldap" = "yes"; then
951 AC_CHECK_LIB(ldap, ldap_init, have_ldap_lib=yes, have_ldap_lib=no)
952 AC_CHECK_HEADER(ldap.h, have_ldap_include=yes, have_ldap_include=no)
314cf73 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@447 5dc97367-97…
alobbs authored
953
954 AC_CHECK_LIB(ldap, ldap_start_tls_s, [
955 AC_DEFINE(LDAP_HAVE_START_TLS_S,, Define if you have ldap_start_tls_s)
956 ])
957
9eb4035 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@400 5dc97367-97…
alobbs authored
958 if test "$have_ldap_lib $have_ldap_include" = "yes yes"; then
959 have_ldap="yes"
960 else
961 have_ldap="no"
962 fi
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
963 else
9eb4035 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@400 5dc97367-97…
alobbs authored
964 have_ldap="no"
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
965 fi
9eb4035 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@400 5dc97367-97…
alobbs authored
966
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
967 AM_CONDITIONAL(HAVE_LDAP, test $have_ldap = "yes")
968
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
969
970 dnl
e4c101f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@391 5dc97367-97…
alobbs authored
971 dnl Check for MySQL 4.0.0 support
972 dnl
973 AX_LIB_MYSQL(4.0.0)
974
975
976 dnl
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
977 dnl WWW root directory
978 dnl
979 AC_ARG_WITH(wwwroot, AC_HELP_STRING([--with-wwwroot=DIR], [Set the WWW root directory]),
980 WWW_ROOT="$withval", WWW_ROOT="$localstatedir/www")
981
982 AC_SUBST(WWW_ROOT)
983
984
985 dnl
986 dnl Options
987 dnl
988 use_static_module=""
989 AC_ARG_ENABLE(static-module,
990 AC_HELP_STRING([--enable-static-module=MODULE][]),
991 [use_static_module="$use_static_module $enableval "],[])
992
e4c101f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@391 5dc97367-97…
alobbs authored
993 modules="error_redir server_info file admin dirlist fcgi fastcgi scgi redir common nn cgi phpcgi proxy gzip ncsa combined w3c pam ldap mysql htpasswd plain htdigest round_robin"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
994
995 # Remove modules that will not be compiles
996 #
997 if test "x$have_pam" != "xyes"; then
998 modules=`echo $modules | sed s/pam//`
999 fi
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
1000 if test "x$have_ldap" != "xyes"; then
1001 modules=`echo $modules | sed s/ldap//`
1002 fi
e4c101f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@391 5dc97367-97…
alobbs authored
1003 if test "x$have_mysql" != "xyes"; then
1004 modules=`echo $modules | sed s/mysql//`
1005 fi
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1006 if test "$have_crypt_lib $have_crypt_include" != "yes yes"; then
1007 modules=`echo $modules | sed s/htpasswd//`
1008 fi
1009
1010 add_calls=""
1011 init_calls=""
1012 headers=""
1013 ext_defs=""
1014
1015 for mod in $modules; do
1016 AC_MSG_CHECKING([module "$mod"])
1017
1018 if echo $use_static_module | grep $mod >/dev/null || echo $use_static_module | grep all >/dev/null; then
b69d2e0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@476 5dc97367-97…
alobbs authored
1019 ext_defs="$ext_defs \n extern cherokee_plugin_info_t cherokee_${mod}_info;"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1020
b69d2e0 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@476 5dc97367-97…
alobbs authored
1021 headers="$headers \n void PLUGIN_INIT_NAME($mod) (cherokee_plugin_loader_t *loader);"
1022 add_calls="$add_calls \n add_static_entry (loader, \"$mod\", PLUGIN_INFO_PTR($mod));"
1023 init_calls="$init_calls \n PLUGIN_INIT_NAME($mod)(loader);"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1024
1025 AC_MSG_RESULT([static])
1026 else
1027 AC_MSG_RESULT([dynamic])
1028 fi
1029 done
1030
1031 printf "$ext_defs\n" > ${srcdir}/cherokee/loader.autoconf.h
1032 printf "$headers \n\n $add_calls \n\n $init_calls\n" > ${srcdir}/cherokee/loader.autoconf.inc
1033
1034 dnl
1035 dnl Static/Dynamic modules
1036 dnl
1037 conf_h="${srcdir}/cherokee/loader.autoconf.h"
1038 AM_CONDITIONAL(STATIC_HANDLER_SERVER_INFO, grep server_info $conf_h >/dev/null)
1039 AM_CONDITIONAL(STATIC_HANDLER_FILE, grep file $conf_h >/dev/null)
1040 AM_CONDITIONAL(STATIC_HANDLER_ADMIN, grep admin $conf_h >/dev/null)
1041 AM_CONDITIONAL(STATIC_HANDLER_DIRLIST, grep dirlist $conf_h >/dev/null)
1042 AM_CONDITIONAL(STATIC_HANDLER_FCGI, grep fcgi $conf_h >/dev/null)
1043 AM_CONDITIONAL(STATIC_HANDLER_FASTCGI, grep fastcgi $conf_h >/dev/null)
1044 AM_CONDITIONAL(STATIC_HANDLER_SCGI, grep scgi $conf_h >/dev/null)
1045 AM_CONDITIONAL(STATIC_HANDLER_REDIR, grep redir $conf_h >/dev/null)
1046 AM_CONDITIONAL(STATIC_HANDLER_ERROR_REDIR, grep redir $conf_h >/dev/null)
1047 AM_CONDITIONAL(STATIC_HANDLER_COMMON, grep common $conf_h >/dev/null)
1048 AM_CONDITIONAL(STATIC_HANDLER_NN, grep nn $conf_h >/dev/null)
1049 AM_CONDITIONAL(STATIC_HANDLER_CGI, grep cgi $conf_h >/dev/null)
1050 AM_CONDITIONAL(STATIC_HANDLER_PHPCGI, grep phpcgi $conf_h >/dev/null)
a5dd2dd @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@247 5dc97367-97…
alobbs authored
1051 AM_CONDITIONAL(STATIC_HANDLER_PROXY, grep proxy $conf_h >/dev/null)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1052 AM_CONDITIONAL(STATIC_ENCODER_GZIP, grep gzip $conf_h >/dev/null)
1053 AM_CONDITIONAL(STATIC_LOGGER_NCSA, grep ncsa $conf_h >/dev/null)
1054 AM_CONDITIONAL(STATIC_LOGGER_COMBINED, grep combined $conf_h >/dev/null)
1055 AM_CONDITIONAL(STATIC_LOGGER_W3C, grep w3c $conf_h >/dev/null)
1056 AM_CONDITIONAL(STATIC_VALIDATOR_PAM, grep pam $conf_h >/dev/null)
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
1057 AM_CONDITIONAL(STATIC_VALIDATOR_LDAP, grep ldap $conf_h >/dev/null)
e4c101f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@391 5dc97367-97…
alobbs authored
1058 AM_CONDITIONAL(STATIC_VALIDATOR_MYSQL, grep mysql $conf_h >/dev/null)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1059 AM_CONDITIONAL(STATIC_VALIDATOR_HTPASSWD, grep htpasswd $conf_h >/dev/null)
1060 AM_CONDITIONAL(STATIC_VALIDATOR_PLAIN, grep plain $conf_h >/dev/null)
1061 AM_CONDITIONAL(STATIC_VALIDATOR_HTDIGEST, grep htdigest $conf_h >/dev/null)
c5205f7 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@379 5dc97367-97…
alobbs authored
1062 AM_CONDITIONAL(STATIC_BALANCER_ROUND_ROBIN, grep round_robin $conf_h >/dev/null)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1063
21c216c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@353 5dc97367-97…
alobbs authored
1064 AC_OUTPUT(Makefile cherokee/Makefile.MingW m4/Makefile cherokee/Makefile cget/Makefile icons/Makefile themes/Makefile www/Makefile doc/Makefile doc/develop/Makefile doc/develop/doxygen.cfg contrib/Makefile qa/Makefile windows/Makefile cherokee-config cherokee.spec cherokee.pc windows/cherokee.nsi)
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1065
1066
1067 methods=""
1068 if test "$have_epoll" = yes; then methods="${methods}epoll "; fi
1069 if test "$have_kqueue" = yes; then methods="${methods}kqueue "; fi
1070 if test "$have_poll" = yes; then methods="${methods}poll "; fi
1071 if test "$have_port" = yes; then methods="${methods}port "; fi
1072 if test "$have_win32_select" = yes; then methods="${methods}win32 "; fi
1073 if test "$have_select" = yes; then methods="${methods}select"; fi
1074
1075 crypt_type="no"
1076 if test "$have_crypt_lib" = "yes" && test "$have_crypt_r_lib" = "yes"; then
1077 crypt_type="multithread"
1078 elif test "$have_crypt_lib" = "yes"; then
1079 crypt_type="single thread"
1080 fi
1081
1082 echo
1083 echo ============================
1084 echo "Install prefix $prefix"
1085 echo "cflags $CFLAGS"
1086 echo "trace $enable_trace"
1087 echo "sendfile() $with_sendfile_support"
1088 echo "IPv6 support $have_ipv6"
1089 i=1
1090 for m in $methods; do
1091 echo "Polling method $i $m"
1092 i=`expr $i + 1`
1093 done
1094 echo "Threading support $with_pthread"
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
1095 echo "TLS support $have_tls"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1096 echo "PCRE library $have_pcre"
1097 echo "Compatible PAM $have_pam"
3007777 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@330 5dc97367-97…
alobbs authored
1098 echo "LDAP $have_ldap"
e4c101f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@391 5dc97367-97…
alobbs authored
1099 echo "MySQL $have_mysql"
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1100 echo "crypt support $crypt_type"
86dcbbb @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@471 5dc97367-97…
alobbs authored
1101 if test x"$is_beta" == "xyes"; then
1102 echo "Beta release $svn_rev"
1103 fi
ae9d971 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@243 5dc97367-97…
alobbs authored
1104 echo
1105 eval eval echo "Installation dir $bindir"
1106 echo ============================
1107 echo
1108 if test "x$cherokeepath" != "x" ; then
1109 echo Warning: You have an old copy of Cherokee at $cherokeepath.
1110 echo
1111 fi
1112
1113 cat <<THEEND
1114 +--------------------------------------------------------------------+
1115 | License: |
1116 | This software is subject to the GPL License, available in this |
1117 | distribution in the file COPYING. By continuing this installation |
1118 | process, you are bound by the terms of this license agreement. |
1119 | If you do not agree with the terms of this license, you must abort |
1120 | the installation process at this point. |
1121 +--------------------------------------------------------------------+
1122
1123 Thank you for using Cherokee.
1124 THEEND
Something went wrong with that request. Please try again.