2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([lighttpd], [1.4.40], [contact@lighttpd.net])
5 AC_CONFIG_SRCDIR([src/server.c])
6 AC_CONFIG_HEADER([config.h])
7 AC_CONFIG_MACRO_DIR([m4])
11 dnl HOW FUCKING BROKEN IS AUTOMAKE...
12 dnl serial-tests is not recognized before 1.12, and required for serial tests with 1.13, sane version checks "impossible"
13 dnl if you don't use the default (symlinked) automake on your box, set AUTOMAKE to the path you're using
14 m4_define([serial_tests], [
15 m4_esyscmd([case `${AUTOMAKE:-automake} --version | head -n 1` in
16 *1.11.*|*1.10.*|*1.9.*);;
17 *) echo serial-tests;;
21 AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-override foreign dist-xz tar-ustar] serial_tests)
23 dnl enable with --enable-silent-rules or make V=0 (needs automake >= 1.11)
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
27 dnl @synopsis TRY_CFLAGS [compiler flags]
28 dnl @summary check whether compiler supports given flags and adds them to CFLAGS
29 AC_DEFUN([TRY_CFLAGS],
31 AC_MSG_CHECKING([if $CC supports $1])
33 ac_try_cflags_saved_cflags="${CFLAGS}"
35 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
36 [AC_MSG_RESULT([yes])],
39 CFLAGS="${ac_try_cflags_saved_cflags}"
45 dnl @synopsis TRY_LDFLAGS [linker flags]
46 dnl @summary check whether linker supports given flags and adds them to LDFLAGS
47 AC_DEFUN([TRY_LDFLAGS],
49 AC_MSG_CHECKING([if $LD supports $1])
51 ac_try_ldflags_saved_ldflags="${LDFLAGS}"
52 LDFLAGS="${LDFLAGS} $1"
53 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
54 [AC_MSG_RESULT([yes])],
57 LDFLAGS="${ac_try_ldflags_saved_cflags}"
63 dnl Checks for programs.
74 dnl AM_PROG_AR is needed for some linker stuff
75 dnl AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.60
76 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS])
77 dnl AM_PROG_AR requires automake 1.11 (and uses AC_COMPILE_IFELSE which wants AC_USE_SYSTEM_EXTENSIONS)
78 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
87 *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
90 AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
92 if test -z "$LIGHTTPD_STATIC"; then
95 AM_CONDITIONAL(LIGHTTPD_STATIC, test x$LIGHTTPD_STATIC = xyes)
107 CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
109 dnl Checks for header files.
112 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
113 sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
114 getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
115 sys/mman.h sys/event.h port.h pwd.h \
116 sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
118 dnl Checks for typedefs, structures, and compiler characteristics.
126 AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
127 AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
128 AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
129 #include <sys/socket.h>])
131 dnl Checks for library functions.
139 AC_CHECK_FUNCS([issetugid inet_pton])
141 if test -z "$PKG_CONFIG"; then
142 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
145 dnl checking for libev
146 AC_MSG_CHECKING(for libev support)
148 AC_HELP_STRING([--with-libev@<:@=PATH@:>@],[Include libev support for fdevent handlers in PATH/include and PATH/lib]),
149 [WITH_LIBEV=$withval],[WITH_LIBEV=no])
154 if test "$WITH_LIBEV" != "no"; then
155 PKG_CHECK_MODULES(LIBEV, libev, [], [
156 dnl no pkg-config for libev, searching manually:
158 if test "$WITH_LIBEV" != "yes"; then
159 LIBEV_CFLAGS="-I$WITH_LIBEV/include"
160 LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
162 AC_CHECK_HEADERS([ev.h],[
163 AC_CHECK_LIB([ev], [ev_time], [
167 AC_MSG_ERROR([libev not found])
170 AC_MSG_ERROR([libev not found])
176 AC_DEFINE([HAVE_LIBEV], [1], [libev support])
179 AC_SUBST(LIBEV_CFLAGS)
182 dnl Checks for database.
186 AC_MSG_CHECKING(for MySQL support)
188 AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
189 [WITH_MYSQL=$withval],[WITH_MYSQL=no])
191 if test "$WITH_MYSQL" != "no"; then
193 if test "$WITH_MYSQL" = "yes"; then
194 AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
196 MYSQL_CONFIG=$WITH_MYSQL
199 if test "$MYSQL_CONFIG" = ""; then
200 AC_MSG_ERROR(mysql_config is not found)
202 if test \! -x $MYSQL_CONFIG; then
203 AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
206 if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
207 MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
209 MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
211 MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
213 AC_MSG_CHECKING(for MySQL includes at)
214 AC_MSG_RESULT($MYSQL_INCLUDE)
216 AC_MSG_CHECKING(for MySQL libraries at)
217 AC_MSG_RESULT($MYSQL_LIBS)
218 dnl check for errmsg.h, which isn't installed by some versions of 3.21
219 old_CPPFLAGS="$CPPFLAGS"
220 CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
221 AC_CHECK_HEADERS(errmsg.h mysql.h)
222 CPPFLAGS="$old_CPPFLAGS"
224 AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
230 AC_SUBST(MYSQL_INCLUDE)
233 AC_MSG_CHECKING(for LDAP support)
234 AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
235 [WITH_LDAP=$withval], [WITH_LDAP=no])
236 AC_MSG_RESULT([$withval])
237 if test "$WITH_LDAP" != "no"; then
238 AC_CHECK_LIB(ldap, ldap_bind, [
239 AC_CHECK_HEADERS([ldap.h],[
241 AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
242 AC_DEFINE([HAVE_LDAP_H], [1])
243 AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
247 AC_CHECK_LIB(lber, ber_printf, [
248 AC_CHECK_HEADERS([lber.h],[
250 AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
251 AC_DEFINE([HAVE_LBER_H], [1])
258 AC_MSG_CHECKING(for extended attributes support)
259 AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
260 [WITH_ATTR=$withval],[WITH_ATTR=no])
261 AC_MSG_RESULT($withval)
262 if test "$WITH_ATTR" != "no"; then
263 # libattr (linux only?)
264 AC_CHECK_LIB(attr, attr_get, [
265 AC_CHECK_HEADERS([attr/attributes.h],[
267 AC_DEFINE([HAVE_XATTR], [1], [libattr])
268 AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
274 AC_CHECK_FUNC([extattr_get_file], [
275 AC_CHECK_HEADERS([sys/extattr.h],[
276 AC_DEFINE([HAVE_EXTATTR], [1], [BSD extended attributes])
277 AC_DEFINE([HAVE_SYS_EXTATTR_H], [1])
282 dnl openssl on solaris needs -lsocket -lnsl
283 AC_SEARCH_LIBS(socket,socket)
284 AC_SEARCH_LIBS(gethostbyname,nsl socket)
285 AC_SEARCH_LIBS(hstrerror,resolv)
288 AC_SEARCH_LIBS(dlopen,dl,[
289 AC_CHECK_HEADERS([dlfcn.h],[
290 if test "$ac_cv_search_dlopen" != no; then
291 test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
294 AC_DEFINE([HAVE_LIBDL], [1], [libdl])
295 AC_DEFINE([HAVE_DLFCN_H], [1])
301 dnl Check for valgrind
302 AC_MSG_CHECKING(for valgrind)
303 AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
304 [WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
305 AC_MSG_RESULT([$WITH_VALGRIND])
306 if test "$WITH_VALGRIND" != "no"; then
307 AC_CHECK_HEADERS([valgrind/valgrind.h])
310 dnl Checking for libunwind
311 AC_MSG_CHECKING(for libunwind)
312 AC_ARG_WITH(libunwind,
313 AC_HELP_STRING([--with-libunwind],[Include libunwind support for backtraces on assert failures]),
314 [WITH_LIBUNWIND=$withval],[WITH_LIBUNWIND=no])
316 if test "$WITH_LIBUNWIND" != "no"; then
317 PKG_CHECK_MODULES(LIBUNWIND, libunwind)
318 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
321 dnl Check for openssl
322 AC_MSG_CHECKING(for OpenSSL)
324 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
325 [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
327 if test "$WITH_OPENSSL" != "no"; then
329 if test "$WITH_OPENSSL" != "yes"; then
330 CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
331 LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
336 AC_MSG_RESULT([$use_openssl])
338 AC_ARG_WITH(openssl-includes,
339 AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
340 [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
343 AC_ARG_WITH(openssl-libs,
344 AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
345 [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
348 AC_ARG_WITH(kerberos5,
349 AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]),
350 [ use_kerberos=yes ], [use_kerberos=no]
353 if test "x$use_openssl" = "xyes"; then
354 if test "x$use_kerberos" = "xyes"; then
355 AC_DEFINE([USE_OPENSSL_KERBEROS], [1], [with kerberos])
358 AC_CHECK_HEADERS([openssl/ssl.h])
360 AC_CHECK_LIB(crypto, BIO_f_base64, [
361 AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
362 AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
368 AC_MSG_CHECKING(for perl regular expressions support)
369 AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
370 [WITH_PCRE=$withval],[WITH_PCRE=yes])
371 AC_MSG_RESULT([$WITH_PCRE])
373 if test "$WITH_PCRE" != "no"; then
374 AC_PATH_PROG(PCRECONFIG, pcre-config)
376 if test x"$PCRECONFIG" != x; then
377 PCRE_LIB=`$PCRECONFIG --libs`
378 CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
379 AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
380 AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
382 AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
388 AC_MSG_CHECKING(for zlib support)
389 AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
390 [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
391 AC_MSG_RESULT([$WITH_ZLIB])
393 if test "$WITH_ZLIB" != "no"; then
394 AC_CHECK_LIB(z, deflate, [
395 AC_CHECK_HEADERS([zlib.h],[
397 AC_DEFINE([HAVE_LIBZ], [1], [libz])
398 AC_DEFINE([HAVE_ZLIB_H], [1])
401 if test x$Z_LIB = x; then
402 AC_MSG_ERROR([zlib-headers and/or libs where not found, install them or build with --without-zlib])
407 AC_MSG_CHECKING(for bzip2 support)
408 AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
409 [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
410 AC_MSG_RESULT([$WITH_BZIP2])
412 if test "$WITH_BZIP2" != "no"; then
413 AC_CHECK_LIB(bz2, BZ2_bzCompress, [
414 AC_CHECK_HEADERS([bzlib.h],[
416 AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
417 AC_DEFINE([HAVE_BZLIB_H], [1])
420 if test x$BZ_LIB = x; then
421 AC_MSG_ERROR([bzip2-headers and/or libs where not found, install them or build with --without-bzip2])
427 AC_MSG_CHECKING(for FAM)
428 AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
429 [WITH_FAM=$withval],[WITH_FAM=no])
430 AC_MSG_RESULT([$WITH_FAM])
432 if test "$WITH_FAM" != "no"; then
433 AC_CHECK_LIB(fam, FAMOpen2, [
434 AC_CHECK_HEADERS([fam.h],[
436 AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
437 AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
440 if test "x$FAM_LIBS" = x; then
441 PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
442 AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
443 AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
448 AC_CHECK_FUNCS([FAMNoExists])
451 if test x$FAM_LIBS = x; then
452 AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
456 AC_MSG_CHECKING(for properties in mod_webdav)
457 AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
458 [WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
459 AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
461 if test "$WITH_WEBDAV_PROPS" != "no"; then
462 PKG_CHECK_MODULES(XML, libxml-2.0, [
463 AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
464 AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
466 PKG_CHECK_MODULES(SQLITE, sqlite3, [
467 AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
468 AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
471 AC_MSG_CHECKING(for locks in mod_webdav)
472 AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
473 [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
474 AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
476 if test "$WITH_WEBDAV_LOCKS" != "no"; then
477 AC_CHECK_LIB(uuid, uuid_unparse, [
478 AC_CHECK_HEADERS([uuid/uuid.h],[
480 AC_DEFINE([HAVE_UUID], [1], [libuuid])
481 AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
489 AC_MSG_CHECKING(for gdbm)
490 AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
491 [WITH_GDBM=$withval],[WITH_GDBM=no])
492 AC_MSG_RESULT([$WITH_GDBM])
494 if test "$WITH_GDBM" != "no"; then
495 AC_CHECK_LIB(gdbm, gdbm_open, [
496 AC_CHECK_HEADERS([gdbm.h],[
498 AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
499 AC_DEFINE([HAVE_GDBM_H], [1])
505 dnl Check for memcached
506 AC_MSG_CHECKING(for memcached)
507 AC_ARG_WITH(memcached, AC_HELP_STRING([--with-memcached],[memcached storage for mod_trigger_b4_dl]),
508 [WITH_MEMCACHED=$withval],[WITH_MEMCACHED=no])
509 AC_MSG_RESULT([$WITH_MEMCACHED])
510 if test "$WITH_MEMCACHED" != "no"; then
511 AC_CHECK_LIB(memcached, memcached, [
512 AC_CHECK_HEADERS([libmemcached/memcached.h],[
513 MEMCACHED_LIB=-lmemcached
514 AC_DEFINE([USE_MEMCACHED], [1], [libmemcached])
517 AC_SUBST(MEMCACHED_LIB)
521 AC_MSG_CHECKING(if lua-support is requested)
522 AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
523 [WITH_LUA=$withval],[WITH_LUA=no])
525 AC_MSG_RESULT($WITH_LUA)
526 if test "$WITH_LUA" != "no"; then
527 if test "$WITH_LUA" != "yes"; then
528 PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
529 AC_DEFINE([HAVE_LUA], [1], [liblua])
530 AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
532 AC_MSG_ERROR([Couldn't find requested lua pkg-config module $WITH_LUA])
536 for luaname in lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
537 if test "$found_lua" = "0"; then
538 PKG_CHECK_MODULES(LUA, $luaname >= 5.1, [
539 AC_DEFINE([HAVE_LUA], [1], [liblua])
540 AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
543 AC_MSG_NOTICE([Couldn't find $luaname])
547 if test "$found_lua" = "0"; then
548 AC_MSG_ERROR([Couldn't find any lua pkg-config module])
556 dnl search for crypt_r and (fallback) for crypt
559 AC_SEARCH_LIBS([crypt_r],[crypt],[
560 AC_DEFINE([HAVE_CRYPT_R], [1], [crypt_r])
561 AC_CHECK_HEADERS([crypt.h],[
562 AC_DEFINE([HAVE_CRYPT_H], [1], [crypt.h])
567 AC_SEARCH_LIBS([crypt],[crypt],[
568 AC_DEFINE([HAVE_CRYPT], [1], [crypt])
569 AC_CHECK_HEADERS([crypt.h],[
570 AC_DEFINE([HAVE_CRYPT_H], [1], [crypt.h])
577 AC_SUBST([CRYPT_LIB])
580 AC_SEARCH_LIBS(sendfilev,sendfile,[
581 if test "$ac_cv_search_sendfilev" != no; then
582 test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
583 AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
587 AC_SUBST(SENDFILE_LIB)
590 *mingw* ) LIBS="$LIBS -lwsock32";;
594 AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
595 strdup strerror strstr strtol sendfile getopt socket lstat \
596 gethostbyname poll epoll_ctl getrlimit chroot \
597 getuid select signal pathconf madvise posix_fadvise posix_madvise \
598 writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r \
599 memset_s explicit_bzero])
601 AC_MSG_CHECKING(if weak symbols are supported)
602 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
603 __attribute__((weak)) void __dummy(void *x) { }
604 void f(void *x) { __dummy(x); }
608 AC_DEFINE([HAVE_WEAK_SYMBOLS], [1], [weak symbols are supported])
609 ],[AC_MSG_RESULT(no)])
611 AC_MSG_CHECKING(for Large File System support)
613 AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
614 [case "${enableval}" in
615 yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
617 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
618 esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
620 AC_MSG_RESULT($enableval)
622 AC_CHECK_SIZEOF(long)
623 AC_CHECK_SIZEOF(off_t)
625 if test "x$ac_cv_func_sendfile" = xyes; then
626 dnl check if sendfile works
627 AC_MSG_CHECKING(if sendfile works)
628 if test "x$cross_compiling" = xno; then
630 #ifdef HAVE_SYS_SENDFILE_H
631 #include <sys/sendfile.h>
632 #endif /* HAVE_SYS_SENDFILE_H */
636 if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
641 AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
643 AC_MSG_RESULT(no, cross-compiling)
644 AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
648 dnl Check for IPv6 support
651 AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
652 [case "${enableval}" in
655 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
658 if test x$ipv6 = xtrue; then
659 AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
660 [AC_TRY_LINK([ #include <sys/types.h>
661 #include <sys/socket.h>
662 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
663 [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
665 if test "$ac_cv_ipv6_support" = yes; then
666 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
670 # disable mmap by default; if a mmapped file gets truncated, the process gets a SIGBUS signal
671 # on reading the truncated area which we can't handle (yet).
672 # lighttpd may always use mmap with files it owns (created tmp files)
674 AC_HELP_STRING([--enable-mmap],[use mmap if available (DANGEROUS, allows local users to trigger SIGBUS crashes)]),
675 [case "${enableval}" in
678 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmap) ;;
681 if test x$mmap = xtrue; then
682 AC_DEFINE(ENABLE_MMAP, [1], [Use mmap if available])
686 AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
688 dnl check for fastcgi lib, for the tests only
690 AC_CHECK_LIB(fcgi, FCGI_Accept, [
691 AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
696 AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
699 dnl check for extra compiler options (warning options)
700 if test "${GCC}" = "yes"; then
701 TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
702 TRY_CFLAGS([-std=gnu99])
705 AC_ARG_ENABLE(extra-warnings,
706 AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
707 [case "${enableval}" in
708 yes) extrawarnings=true ;;
709 no) extrawarnings=false ;;
710 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
711 esac],[extrawarnings=false])
713 if test x$extrawarnings = xtrue; then
714 TRY_CFLAGS([-g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wcast-align -Wsign-compare -Wnested-externs -Wpointer-arith -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security])
715 TRY_LDFLAGS([-Wl,--as-needed])
719 LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
720 AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
722 AC_CONFIG_FILES([Makefile src/Makefile
723 doc/config/conf.d/Makefile \
724 doc/config/vhosts.d/Makefile \
725 doc/config/Makefile \
726 doc/scripts/Makefile \
727 doc/initscripts/Makefile \
728 doc/systemd/Makefile \
729 doc/outdated/Makefile \
732 tests/docroot/Makefile \
733 tests/docroot/123/Makefile \
734 tests/docroot/www/Makefile \
735 tests/docroot/www/go/Makefile \
736 tests/docroot/www/indexfile/Makefile \
737 tests/docroot/www/expire/Makefile \
742 do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
743 do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
745 plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
746 features="regex-conditionals"
747 if test ! "x$PCRE_LIB" = x; then
748 do_build="$do_build $plugins"
749 enable_feature="$features"
751 no_build="$no_build $plugins"
752 disable_feature="$features"
755 plugins="mod_mysql_vhost"
756 if test ! "x$MYSQL_LIBS" = x; then
757 do_build="$do_build $plugins"
759 no_build="$no_build $plugins"
762 plugins="mod_cml mod_magnet"
763 if test ! "x$LUA_LIBS" = x; then
764 do_build="$do_build $plugins"
766 no_build="$no_build $plugins"
769 features="storage-gdbm"
770 if test ! "x$GDBM_LIB" = x; then
771 enable_feature="$enable_feature $features"
773 disable_feature="$disable_feature $features"
776 features="storage-memcached"
777 if test ! "x$MEMCACHED_LIB" = x; then
778 enable_feature="$enable_feature $features"
780 disable_feature="$disable_feature $features"
783 features="compress-gzip compress-deflate"
784 if test ! "x$Z_LIB" = x; then
785 enable_feature="$enable_feature $features"
787 disable_feature="$disable_feature $features"
790 features="compress-bzip2"
791 if test ! "x$BZ_LIB" = x; then
792 enable_feature="$enable_feature $features"
794 disable_feature="$disable_feature $features"
798 if test ! "x$LDAP_LIB" = x; then
799 enable_feature="$enable_feature $features"
801 disable_feature="$disable_feature $features"
804 features="network-openssl"
805 if test ! "x$SSL_LIB" = x; then
806 enable_feature="$enable_feature $features"
808 disable_feature="$disable_feature $features"
812 features="auth-crypt"
813 if test "$ac_cv_search_crypt" = no; then
814 disable_feature="$disable_feature $features"
816 enable_feature="$enable_feature $features"
819 features="network-ipv6"
820 if test "$ac_cv_ipv6_support" = yes; then
821 enable_feature="$enable_feature $features"
823 disable_feature="$disable_feature $features"
826 features="large-files"
827 if test "$enable_lfs" = yes; then
828 enable_feature="$enable_feature $features"
830 disable_feature="$disable_feature $features"
833 features="stat-cache-fam"
834 if test ! "x$FAM_LIBS" = x; then
835 enable_feature="$enable_feature $features"
837 disable_feature="$disable_feature $features"
840 features="webdav-properties"
841 if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
842 enable_feature="$enable_feature $features"
844 disable_feature="$disable_feature $features"
847 features="webdav-locks"
848 if test "x$UUID_LIBS" \!= x; then
849 enable_feature="$enable_feature $features"
851 disable_feature="$disable_feature $features"
862 for p in $do_build; do
867 for p in $no_build; do
876 for p in $enable_feature; do
881 for p in $disable_feature; do