[core] fdevent_cycle_logger()
[lighttpd.git] / configure.ac
blob8c37810f588aba311398ad73ce4c1ce3a29870f2
1 dnl                                               -*- Autoconf -*-
2 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.57)
4 AC_INIT([lighttpd], [1.4.46], [contact@lighttpd.net])
5 AC_CONFIG_SRCDIR([src/server.c])
6 AC_CONFIG_HEADER([config.h])
7 AC_CONFIG_MACRO_DIR([m4])
9 AC_CANONICAL_HOST
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;;
18       esac])
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],
30 [dnl
31   AC_MSG_CHECKING([if $CC supports $1])
32   AC_LANG_PUSH([C])
33   ac_try_cflags_saved_cflags="${CFLAGS}"
34   CFLAGS="${CFLAGS} $1"
35   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
36     [AC_MSG_RESULT([yes])],
37     [
38       AC_MSG_ERROR([no])
39       CFLAGS="${ac_try_cflags_saved_cflags}"
40     ]
41   )
42   AC_LANG_POP([C])
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],
48 [dnl
49   AC_MSG_CHECKING([if $LD supports $1])
50   AC_LANG_PUSH([C])
51   ac_try_ldflags_saved_ldflags="${LDFLAGS}"
52   LDFLAGS="${LDFLAGS} $1"
53   AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
54     [AC_MSG_RESULT([yes])],
55     [
56       AC_MSG_ERROR([no])
57       LDFLAGS="${ac_try_ldflags_saved_cflags}"
58     ]
59   )
60   AC_LANG_POP([C])
63 dnl Checks for programs.
64 AC_PROG_CC
65 AC_PROG_CC_STDC
66 AX_PROG_CC_FOR_BUILD
67 AM_PROG_CC_C_O
68 AC_PROG_LD
69 AC_PROG_INSTALL
70 AC_PROG_AWK
71 AC_PROG_CPP
72 dnl AC_PROG_CXX
73 AC_PROG_LN_S
74 AC_PROG_MAKE_SET
76 dnl AM_PROG_AR is needed for some linker stuff
77 dnl AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.60
78 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS])
79 dnl AM_PROG_AR requires automake 1.11 (and uses AC_COMPILE_IFELSE which wants AC_USE_SYSTEM_EXTENSIONS)
80 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
82 dnl check environment
83 AC_AIX
84 AC_ISC_POSIX
85 AC_MINIX
87 dnl AC_CANONICAL_HOST
88 case $host_os in
89         *darwin*|*cygwin*|*aix*|*mingw*|*midipix* ) NO_RDYNAMIC=yes;;
90         * ) NO_RDYNAMIC=no;;
91 esac
92 AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
94 if test -z "$LIGHTTPD_STATIC"; then
95   LIGHTTPD_STATIC=no
97 AM_CONDITIONAL(LIGHTTPD_STATIC, test x$LIGHTTPD_STATIC = xyes)
99 AC_EXEEXT
101 dnl libtool
102 AC_DISABLE_STATIC
103 AC_ENABLE_SHARED
105 AC_LIBTOOL_DLOPEN
106 AC_PROG_LIBTOOL
108 dnl for solaris
109 CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
111 dnl Checks for header files.
112 AC_HEADER_STDC
113 AC_HEADER_SYS_WAIT
114 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h strings.h \
115 sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
116 getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
117 sys/mman.h sys/event.h port.h pwd.h \
118 sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
120 dnl Checks for typedefs, structures, and compiler characteristics.
121 AC_C_CONST
122 AC_C_INLINE
123 AC_C_CHAR_UNSIGNED
124 AC_TYPE_OFF_T
125 AC_TYPE_PID_T
126 AC_TYPE_SIZE_T
128 AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
129 AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
130 AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
131 #include <sys/socket.h>])
133 dnl Checks for library functions.
134 AC_FUNC_FORK
135 dnl AC_FUNC_MALLOC
136 dnl AC_FUNC_MMAP
137 dnl AC_FUNC_REALLOC
138 AC_TYPE_SIGNAL
139 AC_FUNC_STAT
140 AC_FUNC_STRFTIME
142 if test -z "$PKG_CONFIG"; then
143   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
146 dnl checking for libev
147 AC_MSG_CHECKING(for libev support)
148 AC_ARG_WITH(libev,
149     AC_HELP_STRING([--with-libev@<:@=PATH@:>@],[Include libev support for fdevent handlers in PATH/include and PATH/lib]),
150     [WITH_LIBEV=$withval],[WITH_LIBEV=no])
152 LIBEV_CFLAGS=""
153 LIBEV_LIBS=""
155 if test "$WITH_LIBEV" != "no"; then
156         PKG_CHECK_MODULES(LIBEV, libev, [], [
157                 dnl no pkg-config for libev, searching manually:
159                 if test "$WITH_LIBEV" != "yes"; then
160                         LIBEV_CFLAGS="-I$WITH_LIBEV/include"
161                         LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
162                 else
163                         AC_CHECK_HEADERS([ev.h],[
164                                 AC_CHECK_LIB([ev], [ev_time], [
165                                                 LIBEV_CFLAGS=""
166                                                 LIBEV_LIBS="-lev"
167                                         ],[
168                                         AC_MSG_ERROR([libev not found])
169                                         ]
170                                 )],[
171                                         AC_MSG_ERROR([libev not found])
172                                 ]
173                         )
174                 fi
175         ])
177         AC_DEFINE([HAVE_LIBEV], [1], [libev support])
180 AC_SUBST(LIBEV_CFLAGS)
181 AC_SUBST(LIBEV_LIBS)
182 AC_MSG_RESULT([$WITH_LIBEV])
184 dnl Checks for database.
185 MYSQL_INCLUDE=""
186 MYSQL_LIBS=""
188 AC_MSG_CHECKING(for MySQL support)
189 AC_ARG_WITH(mysql,
190     AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']),
191     [WITH_MYSQL=$withval],[WITH_MYSQL=no])
193 if test "$WITH_MYSQL" != "no"; then
194   AC_MSG_RESULT(yes)
195   if test "$WITH_MYSQL" = "yes"; then
196     AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
197   else
198     MYSQL_CONFIG=$WITH_MYSQL
199   fi
201   if test "$MYSQL_CONFIG" = ""; then
202     AC_MSG_ERROR(mysql_config is not found)
203   fi
204   if test \! -x $MYSQL_CONFIG; then
205     AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config)
206   fi
208   if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then
209     MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`"
210   else
211     MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`"
212   fi
213   MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`"
215   AC_MSG_CHECKING(for MySQL includes at)
216   AC_MSG_RESULT($MYSQL_INCLUDE)
218   AC_MSG_CHECKING(for MySQL libraries at)
219   AC_MSG_RESULT($MYSQL_LIBS)
220 dnl check for errmsg.h, which isn't installed by some versions of 3.21
221   old_CPPFLAGS="$CPPFLAGS"
222   CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
223   AC_CHECK_HEADERS(errmsg.h mysql.h)
224   CPPFLAGS="$old_CPPFLAGS"
226   AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
227 else
228   AC_MSG_RESULT(no)
230 AM_CONDITIONAL(BUILD_WITH_MYSQL, test ! $WITH_MYSQL = no)
232 AC_SUBST(MYSQL_LIBS)
233 AC_SUBST(MYSQL_INCLUDE)
236 dnl Checks for database.
237 PGSQL_INCLUDE=""
238 PGSQL_LIBS=""
240 AC_MSG_CHECKING(for PgSQL support)
241 AC_ARG_WITH(pgsql,
242     AC_HELP_STRING([--with-pgsql@<:@=PATH@:>@],[Include PgSQL support. PATH is the path to 'pg_config']),
243     [WITH_PGSQL=$withval],[WITH_PGSQL=no])
245 if test "$WITH_PGSQL" != "no"; then
246   AC_MSG_RESULT(yes)
247   if test "$WITH_PGSQL" = "yes"; then
248     AC_PATH_PROG(PGSQL_CONFIG, pg_config)
249   else
250     PGSQL_CONFIG=$WITH_PGSQL
251   fi
253   if test "$PGSQL_CONFIG" = ""; then
254     AC_MSG_ERROR(pg_config is not found)
255   fi
256   if test \! -x $PGSQL_CONFIG; then
257     AC_MSG_ERROR(pg_config not exists or not executable, use --with-pgsql=path-to-pg_config)
258   fi
260   PGSQL_INCLUDE="-I`$PGSQL_CONFIG --includedir`"
261   PGSQL_LIBS="-L`$PGSQL_CONFIG --libdir` -lpq"
263   AC_MSG_CHECKING(for PgSQL includes at)
264   AC_MSG_RESULT($PGSQL_INCLUDE)
266   AC_MSG_CHECKING(for PgSQL libraries at)
267   AC_MSG_RESULT($PGSQL_LIBS)
269   AC_DEFINE([HAVE_PGSQL], [1], [pgsql support])
270 else
271   AC_MSG_RESULT(no)
273 AM_CONDITIONAL(BUILD_WITH_PGSQL, test ! $WITH_PGSQL = no)
275 AC_SUBST(PGSQL_LIBS)
276 AC_SUBST(PGSQL_INCLUDE)
279 dnl Checks for libdbi library
280 DBI_INCLUDE=""
281 DBI_LIBS=""
283 AC_MSG_CHECKING(for LibDBI support)
284 AC_ARG_WITH(dbi,
285     AC_HELP_STRING([--with-dbi@<:@=PATH@:>@],[Include DBI support in PATH/include/dbi.h and PATH/lib]),
286     [WITH_DBI=$withval],[WITH_DBI=no])
288 if test "$WITH_DBI" != "no"; then
289        AC_MSG_RESULT(yes)
290        if test "$WITH_DBI" != "yes"; then
291                DBI_CFLAGS="-I$WITH_LIBDBI/include"
292                DBI_LIBS="-L$WITH_LIBDBI/lib -ldbi"
293        else
294                AC_CHECK_HEADERS([dbi/dbi.h],[
295                        AC_CHECK_LIB([dbi], [dbi_version], [
296                                        DBI_CFLAGS=""
297                                        DBI_LIBS="-ldbi"
298                                ],[
299                                AC_MSG_ERROR([LibDBI not found])
300                                ]
301                        )],[
302                                AC_MSG_ERROR([LibDBI not found])
303                        ]
304                )
305        fi
307        AC_DEFINE([HAVE_DBI], [1], [LibDBI support])
308 else
309        AC_MSG_RESULT(no)
311 AM_CONDITIONAL(BUILD_WITH_DBI, test ! $WITH_DBI = no)
313 AC_SUBST(DBI_LIBS)
314 AC_SUBST(DBI_CFLAGS)
317 dnl Check for LDAP
318 AC_MSG_CHECKING(for LDAP support)
319 AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]),
320 [WITH_LDAP=$withval], [WITH_LDAP=no])
321 AC_MSG_RESULT([$withval])
322 if test "$WITH_LDAP" != "no"; then
323  AC_CHECK_LIB(ldap, ldap_bind, [
324   AC_CHECK_HEADERS([ldap.h],[
325     LDAP_LIB=-lldap
326     AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
327     AC_DEFINE([HAVE_LDAP_H], [1])
328     AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
329   ])
330  ])
331  AC_SUBST(LDAP_LIB)
332  AC_CHECK_LIB(lber, ber_printf, [
333   AC_CHECK_HEADERS([lber.h],[
334     LBER_LIB=-llber
335     AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
336     AC_DEFINE([HAVE_LBER_H], [1])
337   ])
338  ])
339  AC_SUBST(LBER_LIB)
341 AM_CONDITIONAL(BUILD_WITH_LDAP, test ! $WITH_LDAP = no)
343 dnl Check for xattr
344 AC_MSG_CHECKING(for extended attributes support)
345 AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]),
346 [WITH_ATTR=$withval],[WITH_ATTR=no])
347 AC_MSG_RESULT($withval)
348 if test "$WITH_ATTR" != "no"; then
349   # libattr (linux only?)
350   AC_CHECK_LIB(attr, attr_get, [
351     AC_CHECK_HEADERS([attr/attributes.h],[
352       ATTR_LIB=-lattr
353       AC_DEFINE([HAVE_XATTR], [1], [libattr])
354       AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
355     ])
356   ])
357   AC_SUBST(ATTR_LIB)
359   # (Free)BSD extattr
360   AC_CHECK_FUNC([extattr_get_file], [
361     AC_CHECK_HEADERS([sys/extattr.h],[
362       AC_DEFINE([HAVE_EXTATTR], [1], [BSD extended attributes])
363       AC_DEFINE([HAVE_SYS_EXTATTR_H], [1])
364     ])
365   ])
368 dnl openssl on solaris needs -lsocket -lnsl
369 AC_SEARCH_LIBS(socket,socket)
370 AC_SEARCH_LIBS(gethostbyname,nsl socket)
372 dnl On Haiku accept() and friends are in libnetwork
373 AC_SEARCH_LIBS(accept,network)
375 dnl clock_gettime() needs -lrt with glibc < 2.17, and possibly other platforms
376 AC_SEARCH_LIBS([clock_gettime],[rt])
378 save_LIBS=$LIBS
379 AC_SEARCH_LIBS(dlopen,dl,[
380   AC_CHECK_HEADERS([dlfcn.h],[
381     if test "$ac_cv_search_dlopen" != no; then
382       test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"
383     fi
385     AC_DEFINE([HAVE_LIBDL], [1], [libdl])
386     AC_DEFINE([HAVE_DLFCN_H], [1])
387   ])
389 LIBS=$save_LIBS
390 AC_SUBST(DL_LIB)
392 dnl Check for valgrind
393 AC_MSG_CHECKING(for valgrind)
394 AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]),
395 [WITH_VALGRIND=$withval],[WITH_VALGRIND=no])
396 AC_MSG_RESULT([$WITH_VALGRIND])
397 if test "$WITH_VALGRIND" != "no"; then
398  AC_CHECK_HEADERS([valgrind/valgrind.h])
401 dnl Checking for libunwind
402 AC_MSG_CHECKING(for libunwind)
403 AC_ARG_WITH(libunwind,
404     AC_HELP_STRING([--with-libunwind],[Include libunwind support for backtraces on assert failures]),
405     [WITH_LIBUNWIND=$withval],[WITH_LIBUNWIND=no])
407 if test "$WITH_LIBUNWIND" != "no"; then
408   PKG_CHECK_MODULES(LIBUNWIND, libunwind)
409   AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
411 AC_MSG_RESULT([$WITH_LIBUNWIND])
413 dnl Checking for kerberos5
414 AC_MSG_CHECKING(for kerberos5)
415 AC_ARG_WITH(krb5,
416         AC_HELP_STRING([--with-krb5@<:@=DIR@:>@],[Use Kerberos 5]),
417         [WITH_KRB5=$withval],[WITH_KRB5=no])
418 if test "$WITH_KRB5" != "no"; then
419         use_krb5=yes
420         if test "x$WITH_KRB5" != "xyes"; then
421                 CPPFLAGS="$CPPFLAGS -I$WITH_KRB5/include"
422                 LDFLAGS="$LDFLAGS -L$WITH_KRB5/lib"
423         fi
424 else
425         use_krb5=no
427 AC_MSG_RESULT([$use_krb5])
428 AM_CONDITIONAL(BUILD_WITH_KRB5, test ! $WITH_KRB5 = no)
430 AC_ARG_WITH(krb5-includes,
431         AC_HELP_STRING([--with-krb5-includes=DIR],[Kerberos includes]),
432         [ use_krb5=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
435 AC_ARG_WITH(krb5-libs,
436         AC_HELP_STRING([--with-krb5-libs=DIR],[Kerberos libraries]),
437         [ use_krb5=yes LDFLAGS="$LDFLAGS -L$withval" ]
440 if test "x$use_krb5" = "xyes"; then
441         AC_CHECK_LIB(gssapi_krb5, gss_acquire_cred, [
442                 AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],[
443                         KRB5_LIB="-lkrb5 -lgssapi_krb5"
444                         AC_DEFINE(HAVE_KRB5, [1], [libgssapi_krb5])
445                 ])
446         ])
447         if test "x$KRB5_LIB" = x; then
448                 AC_MSG_ERROR([gssapi_krb5 headers and/or libs where not found, install them or build with --without-krb5])
449         fi
450         case $host_os in
451                 *cygwin* ) KRB5_LIB="$KRB5_LIB -lcom_err";;
452                 * ) ;;
453         esac
455 AC_SUBST(KRB5_LIB)
457 dnl Check for openssl
458 AC_MSG_CHECKING(for OpenSSL)
459 AC_ARG_WITH(openssl,
460     AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]),
461     [WITH_OPENSSL=$withval],[WITH_OPENSSL=no])
463 if test "$WITH_OPENSSL" != "no"; then
464     use_openssl=yes
465     if test "$WITH_OPENSSL" != "yes"; then
466         CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
467         LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
468     fi
469 else
470     use_openssl=no
472 AC_MSG_RESULT([$use_openssl])
473 AM_CONDITIONAL(BUILD_WITH_OPENSSL, test ! $WITH_OPENSSL = no)
475 AC_ARG_WITH(openssl-includes,
476     AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
477     [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
480 AC_ARG_WITH(openssl-libs,
481     AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
482     [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
485 if test "x$use_openssl" = "xyes"; then
486     if test "x$use_krb5" = "xyes"; then
487         AC_DEFINE([USE_OPENSSL_KERBEROS], [1], [with kerberos])
488     fi
490     AC_CHECK_HEADERS([openssl/ssl.h])
491     OLDLIBS="$LIBS"
492     AC_CHECK_LIB(crypto, BIO_f_base64, [
493       AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto"
494                                  CRYPTO_LIB="-lcrypto"
495                                  AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ])
496     ], [], [])
497     LIBS="$OLDLIBS"
498     AC_SUBST(SSL_LIB)
499     AC_SUBST(CRYPTO_LIB)
502 AC_MSG_CHECKING(for perl regular expressions support)
503 AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
504     [WITH_PCRE=$withval],[WITH_PCRE=yes])
505 AC_MSG_RESULT([$WITH_PCRE])
507 if test "$WITH_PCRE" != "no"; then
508                 if test "$WITH_PCRE" != "yes"; then
509                         PCRE_LIB="-L$WITH_PCRE/lib -lpcre"
510                         CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include"
511                 else
512                         AC_PATH_PROG(PCRECONFIG, pcre-config)
513                         if test x"$PCRECONFIG" != x; then
514                                 PCRE_LIB=`$PCRECONFIG --libs`
515                                 CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
516                         fi
517                 fi
519   if test x"$PCRE_LIB" != x; then
520     AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
521     AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
522     AC_SUBST(PCRE_LIB)
523   else
524     AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
525   fi
528 AC_MSG_CHECKING(for zlib support)
529 AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],[Enable zlib support for mod_compress]),
530     [WITH_ZLIB=$withval],[WITH_ZLIB=yes])
531 AC_MSG_RESULT([$WITH_ZLIB])
533 if test "$WITH_ZLIB" != "no"; then
534                 if test "$WITH_ZLIB" != "yes"; then
535                         Z_LIB="-L$WITH_ZLIB -lz"
536                         CPPFLAGS="$CPPFLAGS -I$WITH_ZLIB"
537                 else
538                         AC_CHECK_LIB(z, deflate, [
539                           AC_CHECK_HEADERS([zlib.h],[Z_LIB=-lz])
540                         ])
541                 fi
543   if test x"$Z_LIB" != x; then
544     AC_DEFINE([HAVE_LIBZ], [1], [libz])
545     AC_DEFINE([HAVE_ZLIB_H], [1])
546     AC_SUBST(Z_LIB)
547   else
548     AC_MSG_ERROR([zlib-headers and/or libs were not found, install them or build with --without-zlib])
549   fi
552 AC_MSG_CHECKING(for bzip2 support)
553 AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]),
554     [WITH_BZIP2=$withval],[WITH_BZIP2=yes])
555 AC_MSG_RESULT([$WITH_BZIP2])
557 if test "$WITH_BZIP2" != "no"; then
558                 if test "$WITH_BZIP2" != "yes"; then
559                         BZ_LIB="-L$WITH_BZIP2 -lbz2"
560                         CPPFLAGS="$CPPFLAGS -I$WITH_BZIP2"
561                 else
562                         AC_CHECK_LIB(bz2, BZ2_bzCompress, [
563                           AC_CHECK_HEADERS([bzlib.h],[BZ_LIB=-lbz2])
564                         ])
565                 fi
567   if test x"$BZ_LIB" != x; then
568     AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
569     AC_DEFINE([HAVE_BZLIB_H], [1])
570     AC_SUBST(BZ_LIB)
571   else
572     AC_MSG_ERROR([bzip2-headers and/or libs were not found, install them or build with --without-bzip2])
573   fi
576 dnl Check for gamin
577 AC_MSG_CHECKING(for FAM)
578 AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
579 [WITH_FAM=$withval],[WITH_FAM=no])
580 AC_MSG_RESULT([$WITH_FAM])
582 if test "$WITH_FAM" != "no"; then
583                 if test "$WITH_FAM" != "yes"; then
584                         FAM_LIBS="-L$WITH_FAM -lfam"
585                         CPPFLAGS="$CPPFLAGS -I$WITH_FAM"
586                 else
587                         AC_CHECK_LIB(fam, FAMOpen2, [
588                           AC_CHECK_HEADERS([fam.h],[FAM_LIBS=-lfam])
589                         ])
590                         if test "x$FAM_LIBS" = x; then
591                           PKG_CHECK_MODULES(FAM, gamin >= 0.1.0)
592                         fi
593                 fi
595   if test x"$FAM_LIBS" != x; then
596     OLD_LIBS=$LIBS
597     LIBS=$FAM_LIBS
598     AC_CHECK_FUNCS([FAMNoExists])
599     LIBS=$OLD_LIBS
601     AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
602     AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
603     AC_SUBST(FAM_LIBS)
604   else
605      AC_MSG_ERROR([fam/gamin-headers and/or libs were not found, install them or build with --without-fam])
606   fi
609 AC_MSG_CHECKING(for properties in mod_webdav)
610 AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
611 [WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no])
612 AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
614 if test "$WITH_WEBDAV_PROPS" != "no"; then
616   AC_MSG_CHECKING(for libxml2)
617   AC_ARG_WITH(libxml, AC_HELP_STRING([--with-libxml],[libxml2 for properties in mod_webdav]),
618   [WITH_LIBXML=$withval],[WITH_LIBXML=yes])
619   AC_MSG_RESULT([$WITH_LIBXML])
621   if test "$WITH_LIBXML" != "no"; then
622                 if test "$WITH_LIBXML" != "yes"; then
623                         XML_LIBS="-L$WITH_LIBXML/.libs -lxml2"
624                         XML_CFLAGS="-I$WITH_LIBXML/include"
625                 else
626                         PKG_CHECK_MODULES(XML, libxml-2.0)
627                 fi
629     if test x"$XML_LIBS" != x; then
630       AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
631       AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
632       AC_SUBST(XML_LIBS)
633       AC_SUBST(XML_CFLAGS)
634     else
635       AC_MSG_ERROR([libxml2-headers and/or libs were not found, install them or build with --without-webdav-props])
636     fi
637   fi
639   AC_MSG_CHECKING(for sqlite)
640   AC_ARG_WITH(sqlite, AC_HELP_STRING([--with-sqlite],[sqlite for properties in mod_webdav]),
641   [WITH_SQLITE=$withval],[WITH_SQLITE=yes])
642   AC_MSG_RESULT([$WITH_SQLITE])
644   if test "$WITH_SQLITE" != "no"; then
645                 if test "$WITH_SQLITE" != "yes"; then
646                         SQLITE_LIBS="-L$WITH_SQLITE/.libs -lsqlite3"
647                         SQLITE_CFLAGS="-I$WITH_SQLITE"
648                 else
649                         PKG_CHECK_MODULES(SQLITE, sqlite3)
650                 fi
652     if test x"$SQLITE_LIBS" != x; then
653       AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
654       AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
655       AC_SUBST(SQLITE_LIBS)
656       AC_SUBST(SQLITE_CFLAGS)
657     else
658       AC_MSG_ERROR([sqlite-headers and/or libs were not found, install them or build with --without-webdav-props])
659     fi
660   fi
662   AC_MSG_CHECKING(for locks in mod_webdav)
663   AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]),
664   [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no])
665   AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
667   if test "$WITH_WEBDAV_LOCKS" != "no"; then
669     AC_MSG_CHECKING(for libuuid)
670     AC_ARG_WITH(uuid, AC_HELP_STRING([--with-uuid],[uuid for locks in mod_webdav]),
671     [WITH_UUID=$withval],[WITH_UUID=yes])
672     AC_MSG_RESULT([$WITH_UUID])
674     if test "$WITH_UUID" != "no"; then
675                 if test "$WITH_UUID" != "yes"; then
676                         UUID_LIBS="-L$WITH_UUID -luuid"
677                         CPPFLAGS="$CPPFLAGS -I$WITH_UUID"
678                 else
679                         AC_CHECK_LIB(uuid, uuid_unparse, [
680                           AC_CHECK_HEADERS([uuid/uuid.h],[UUID_LIBS=-luuid])
681                         ])
682                 fi
684       if test x"$UUID_LIBS" != x; then
685         AC_DEFINE([HAVE_UUID], [1], [libuuid])
686         AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
687         AC_SUBST(UUID_LIBS)
688       else
689         AC_MSG_ERROR([uuid-headers and/or libs were not found, install them or build with --without-webdav-locks])
690       fi
691     fi
693   fi
697 dnl Check for gdbm
698 AC_MSG_CHECKING(for gdbm)
699 AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
700 [WITH_GDBM=$withval],[WITH_GDBM=no])
701 AC_MSG_RESULT([$WITH_GDBM])
703 if test "$WITH_GDBM" != "no"; then
704                 if test "$WITH_GDBM" != "yes"; then
705                         GDBM_LIB="-L$WITH_GDBM -lgdbm"
706                         CPPFLAGS="$CPPFLAGS -I$WITH_GDBM"
707                 else
708                         AC_CHECK_LIB(gdbm, gdbm_open, [
709                           AC_CHECK_HEADERS([gdbm.h],[GDBM_LIB=-lgdbm])
710                         ])
711                 fi
713   if test x"$GDBM_LIB" != x; then
714     AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
715     AC_DEFINE([HAVE_GDBM_H], [1])
716     AC_SUBST(GDBM_LIB)
717   else
718     AC_MSG_ERROR([gdbm headers and/or libs were not found, install them or build with --without-gdbm])
719   fi
721 AM_CONDITIONAL(BUILD_WITH_GDBM, test ! $WITH_GDBM = no)
723 dnl Check for GeoIP
724 AC_MSG_CHECKING(for GeoIP)
725 AC_ARG_WITH(geoip, AC_HELP_STRING([--with-geoip],[IP-based geolocation lookup]),
726 [WITH_GEOIP=$withval],[WITH_GEOIP=no])
727 AC_MSG_RESULT([$WITH_GEOIP])
729 if test "$WITH_GEOIP" != "no"; then
730                 if test "$WITH_GEOIP" != "yes"; then
731                         GEOIP_LIB="-L$WITH_GEOIP -lGeoIP"
732                         CPPFLAGS="$CPPFLAGS -I$WITH_GEOIP"
733                 else
734                         AC_CHECK_LIB(GeoIP, GeoIP_country_name_by_addr, [
735                           AC_CHECK_HEADERS([GeoIP.h],[GEOIP_LIB=-lGeoIP])
736                         ])
737                 fi
739   if test x"$GEOIP_LIB" != x; then
740     AC_DEFINE([HAVE_GEOIP], [1], [libGeoIP])
741     AC_DEFINE([HAVE_GEOIP_H], [1])
742     AC_SUBST(GEOIP_LIB)
743   else
744     AC_MSG_ERROR([GeoIP headers and/or libs were not found, install them or build with --without-geoip])
745   fi
747 AM_CONDITIONAL(BUILD_WITH_GEOIP, test ! $WITH_GEOIP = no)
749 dnl Check for memcached
750 AC_MSG_CHECKING(for memcached)
751 AC_ARG_WITH(memcached, AC_HELP_STRING([--with-memcached],[memcached storage for mod_trigger_b4_dl]),
752 [WITH_MEMCACHED=$withval],[WITH_MEMCACHED=no])
753 AC_MSG_RESULT([$WITH_MEMCACHED])
755 if test "$WITH_MEMCACHED" != "no"; then
756                 if test "$WITH_MEMCACHED" != "yes"; then
757                         MEMCACHED_LIB="-L$WITH_MEMCACHED -lMEMCACHED"
758                         CPPFLAGS="$CPPFLAGS -I$WITH_MEMCACHED"
759                 else
760                         AC_CHECK_LIB(memcached, memcached, [
761                           AC_CHECK_HEADERS([libmemcached/memcached.h],[
762                             MEMCACHED_LIB=-lmemcached
763                           ])
764                         ])
765                 fi
767   if test x"$MEMCACHED_LIB" != x; then
768     AC_DEFINE([USE_MEMCACHED], [1], [libmemcached])
769     AC_SUBST(MEMCACHED_LIB)
770   else
771     AC_MSG_ERROR([memcached headers and/or libs were not found, install them or build with --without-memcached])
772   fi
774 AM_CONDITIONAL(BUILD_WITH_MEMCACHED, test ! $WITH_MEMCACHED = no)
776 AM_CONDITIONAL(BUILD_MOD_TRIGGER_B4_DL, test ! $WITH_MEMCACHED = no || test ! $WITH_GDBM = no)
778 dnl Check for lua
779 AC_MSG_CHECKING(if lua-support is requested)
780 AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
781 [WITH_LUA=$withval],[WITH_LUA=no])
783 AC_MSG_RESULT($WITH_LUA)
784 if test "$WITH_LUA" != "no"; then
785   found_lua=0
786   if test "$WITH_LUA" != "yes"; then
787     PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [
788       found_lua=1
789     ],[
790       AC_MSG_NOTICE([Couldn't find requested lua pkg-config module $WITH_LUA])
791     ])
792     if test "$found_lua" = "0"; then
793       LUA_LIBS="-L$WITH_LUA -llua"
794       LUA_CFLAGS="-I$WITH_LUA"
795     fi
796   else
797     for luaname in lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
798       if test "$found_lua" = "0"; then
799         PKG_CHECK_MODULES(LUA, $luaname >= 5.1, [
800           found_lua=1
801         ], [
802           AC_MSG_NOTICE([Couldn't find $luaname])
803         ])
804       fi
805     done
806     if test "$found_lua" = "0"; then
807       AC_MSG_ERROR([Couldn't find any lua pkg-config module])
808     fi
809   fi
811   if test x"$LUA_LIBS" != x; then
812     AC_DEFINE([HAVE_LUA], [1], [liblua])
813     AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
814     AC_SUBST(LUA_LIBS)
815     AC_SUBST(LUA_CFLAGS)
816   else
817     AC_MSG_ERROR([lua headers and/or libs were not found, install them or build with --without-lua])
818   fi
820 AM_CONDITIONAL(BUILD_WITH_LUA, test ! $WITH_LUA = no)
822 dnl search for crypt_r and (fallback) for crypt
823 save_LIBS=$LIBS
824 LIBS=
825 AC_SEARCH_LIBS([crypt_r],[crypt],[
826   AC_DEFINE([HAVE_CRYPT_R], [1], [crypt_r])
827   AC_CHECK_HEADERS([crypt.h],[
828     AC_DEFINE([HAVE_CRYPT_H], [1], [crypt.h])
829   ])
831   CRYPT_LIB=$LIBS
833   AC_SEARCH_LIBS([crypt],[crypt],[
834     AC_DEFINE([HAVE_CRYPT], [1], [crypt])
835     AC_CHECK_HEADERS([crypt.h],[
836       AC_DEFINE([HAVE_CRYPT_H], [1], [crypt.h])
837     ])
839     CRYPT_LIB=$LIBS
840   ])
842 LIBS=$save_LIBS
843 AC_SUBST([CRYPT_LIB])
845 save_LIBS=$LIBS
846 AC_SEARCH_LIBS(sendfilev,sendfile,[
847   if test "$ac_cv_search_sendfilev" != no; then
848     test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev"
849     AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
850   fi
852 LIBS=$save_LIBS
853 AC_SUBST(SENDFILE_LIB)
855 case $host_os in
856         *mingw* ) LIBS="$LIBS -lwsock32";;
857         * ) ;;
858 esac
860 AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop inet_pton issetugid memset mmap munmap strchr \
861                   strdup strerror strstr strtol sendfile  getopt socket lstat \
862                   gethostbyname poll epoll_ctl getrlimit chroot \
863                   getuid select signal pathconf madvise posix_fadvise posix_madvise \
864                   writev sigaction sendfile64 send_file kqueue port_create localtime_r gmtime_r \
865                   memset_s explicit_bzero clock_gettime pipe2 \
866                   arc4random_buf jrand48 srandom getloadavg])
867 AC_CHECK_HEADERS([sys/random.h],[
868   AC_CHECK_FUNC([getentropy], AC_DEFINE([HAVE_GETENTROPY], [1], [getentropy]))
870 AC_CHECK_HEADERS([linux/random.h],[
871   AC_CHECK_FUNC([getrandom], AC_DEFINE([HAVE_GETRANDOM], [1], [getrandom]))
874 AC_MSG_CHECKING(if weak symbols are supported)
875 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
876                 __attribute__((weak)) void __dummy(void *x) { }
877                 void f(void *x) { __dummy(x); }
878         ]])],
879         [
880                 AC_MSG_RESULT(yes)
881                 AC_DEFINE([HAVE_WEAK_SYMBOLS], [1], [weak symbols are supported])
882         ],[AC_MSG_RESULT(no)])
884 AC_MSG_CHECKING(for Large File System support)
885 AC_ARG_ENABLE(lfs,
886  AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
887  [case "${enableval}" in
888    yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
889     no) ;;
890      *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
891   esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
892          enable_lfs=yes])
893 AC_MSG_RESULT($enableval)
895 AC_CHECK_SIZEOF(long)
896 AC_CHECK_SIZEOF(off_t)
898 if test "x$ac_cv_func_sendfile" = xyes; then
899         dnl check if sendfile works
900         AC_MSG_CHECKING(if sendfile works)
901         if test "x$cross_compiling" = xno; then
902         AC_TRY_RUN([
903                     #ifdef HAVE_SYS_SENDFILE_H
904                     #include <sys/sendfile.h>
905                     #endif /* HAVE_SYS_SENDFILE_H */
906                     #include <errno.h>
907                     int main() {
908                       int o = 0;
909                       if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
910                       return 0;
911                     } ],
912                     AC_MSG_RESULT(yes),
913                     [ AC_MSG_RESULT(no)
914                     AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] )
915         else
916               AC_MSG_RESULT(no, cross-compiling)
917               AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
918         fi
921 dnl Check for IPv6 support
923 AC_ARG_ENABLE(ipv6,
924  AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
925  [case "${enableval}" in
926    yes) ipv6=true ;;
927     no) ipv6=false ;;
928      *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
929   esac],[ipv6=true])
931 if test x$ipv6 = xtrue; then
932   AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
933   [AC_TRY_LINK([ #include <sys/types.h>
934 #include <sys/socket.h>
935 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
936   [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
938   if test "$ac_cv_ipv6_support" = yes; then
939     AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
940   fi
943 # disable mmap by default; if a mmapped file gets truncated, the process gets a SIGBUS signal
944 # on reading the truncated area which we can't handle (yet).
945 # lighttpd may always use mmap with files it owns (created tmp files)
946 AC_ARG_ENABLE(mmap,
947   AC_HELP_STRING([--enable-mmap],[use mmap if available (DANGEROUS, allows local users to trigger SIGBUS crashes)]),
948   [case "${enableval}" in
949    yes) mmap=true ;;
950     no) mmap=false ;;
951      *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmap) ;;
952   esac],[mmap=false])
954 if test x$mmap = xtrue; then
955   AC_DEFINE(ENABLE_MMAP, [1], [Use mmap if available])
958 dnl check for fastcgi lib, for the tests only
959 fastcgi_found=no
960 AC_CHECK_LIB(fcgi, FCGI_Accept, [
961  AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[
962    fastcgi_found=yes
963  ])
966 AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
969 dnl check for extra compiler options (warning options)
970 if test "${GCC}" = "yes"; then
971   TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
974 AC_ARG_ENABLE(extra-warnings,
975  AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
976  [case "${enableval}" in
977  error) extrawarnings=error ;;
978    yes) extrawarnings=true ;;
979     no) extrawarnings=false ;;
980      *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
981   esac],[extrawarnings=false])
983 if test x$extrawarnings = xtrue || test x$extrawarnings = xerror; then
984   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])
985   TRY_LDFLAGS([-Wl,--as-needed])
986   if test x$extrawarnings = xerror; then
987     AS_VAR_APPEND([CFLAGS], [" -Werror"])
988     AS_VAR_APPEND([LDFLAGS], [" -Wl,--fatal-warnings"])
989   fi
992 dnl build version-id
993 LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'`
994 AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
996 AC_CONFIG_FILES([Makefile src/Makefile
997                  doc/config/conf.d/Makefile \
998                  doc/config/vhosts.d/Makefile \
999                  doc/config/Makefile \
1000                  doc/scripts/Makefile \
1001                  doc/systemd/Makefile \
1002                  doc/outdated/Makefile \
1003                  doc/Makefile \
1004                  tests/Makefile \
1005                  tests/docroot/Makefile \
1006                  tests/docroot/123/Makefile \
1007                  tests/docroot/www/Makefile \
1008                  tests/docroot/www/go/Makefile \
1009                  tests/docroot/www/indexfile/Makefile \
1010                  tests/docroot/www/expire/Makefile \
1011                  distribute.sh])
1012 AC_OUTPUT
1015 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_authn_file mod_status mod_accesslog"
1016 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 mod_ssi mod_deflate"
1017 do_build="$do_build mod_vhostdb"
1019 plugins="mod_rewrite mod_redirect"
1020 features="regex-conditionals"
1021 if test ! "x$PCRE_LIB" = x; then
1022         do_build="$do_build $plugins"
1023         enable_feature="$features"
1024 else
1025         no_build="$no_build $plugins"
1026         disable_feature="$features"
1029 plugins="mod_trigger_b4_dl"
1030 if test ! "x$PCRE_LIB" = x; then
1031 if test ! "x$WITH_MEMCACHED" = xno || test ! "x$WITH_GDBM" = xno; then
1032         do_build="$do_build $plugins"
1033 else
1034         no_build="$no_build $plugins"
1038 plugins="mod_authn_mysql mod_mysql_vhost mod_vhostdb_mysql"
1039 if test ! "x$MYSQL_LIBS" = x; then
1040         do_build="$do_build $plugins"
1041 else
1042         no_build="$no_build $plugins"
1045 plugins="mod_vhostdb_pgsql"
1046 if test ! "x$PGSQL_LIBS" = x; then
1047         do_build="$do_build $plugins"
1048 else
1049         no_build="$no_build $plugins"
1052 plugins="mod_vhostdb_dbi"
1053 if test ! "x$DBI_LIBS" = x; then
1054         do_build="$do_build $plugins"
1055 else
1056         no_build="$no_build $plugins"
1059 plugins="mod_cml mod_magnet"
1060 if test ! "x$LUA_LIBS" = x; then
1061         do_build="$do_build $plugins"
1062 else
1063         no_build="$no_build $plugins"
1066 plugins="mod_geoip"
1067 if test ! "x$GEOIP_LIB" = x; then
1068         do_build="$do_build $plugins"
1069 else
1070         no_build="$no_build $plugins"
1073 features="storage-gdbm"
1074 if test ! "x$GDBM_LIB" = x; then
1075         enable_feature="$enable_feature $features"
1076 else
1077         disable_feature="$disable_feature $features"
1080 features="storage-memcached"
1081 if test ! "x$MEMCACHED_LIB" = x; then
1082         enable_feature="$enable_feature $features"
1083 else
1084         disable_feature="$disable_feature $features"
1087 features="compress-gzip compress-deflate"
1088 if test ! "x$Z_LIB" = x; then
1089         enable_feature="$enable_feature $features"
1090 else
1091         disable_feature="$disable_feature $features"
1094 features="compress-bzip2"
1095 if test ! "x$BZ_LIB" = x; then
1096         enable_feature="$enable_feature $features"
1097 else
1098         disable_feature="$disable_feature $features"
1101 plugins="mod_authn_gssapi"
1102 if test ! "x$KRB5_LIB" = x; then
1103         do_build="$do_build $plugins"
1104 else
1105         no_build="$no_build $plugins"
1108 plugins="mod_authn_ldap mod_vhostdb_ldap"
1109 if test ! "x$LDAP_LIB" = x; then
1110         do_build="$do_build $plugins"
1111 else
1112         no_build="$no_build $plugins"
1115 features="network-openssl"
1116 if test ! "x$SSL_LIB" = x; then
1117         enable_feature="$enable_feature $features"
1118 else
1119         disable_feature="$disable_feature $features"
1122 dnl no crypt call
1123 features="auth-crypt"
1124 if test "$ac_cv_search_crypt" = no; then
1125         disable_feature="$disable_feature $features"
1126 else
1127         enable_feature="$enable_feature $features"
1130 features="network-ipv6"
1131 if test "$ac_cv_ipv6_support" = yes; then
1132         enable_feature="$enable_feature $features"
1133 else
1134         disable_feature="$disable_feature $features"
1137 features="large-files"
1138 if test "$enable_lfs" = yes; then
1139         enable_feature="$enable_feature $features"
1140 else
1141         disable_feature="$disable_feature $features"
1144 features="stat-cache-fam"
1145 if test ! "x$FAM_LIBS" = x; then
1146         enable_feature="$enable_feature $features"
1147 else
1148         disable_feature="$disable_feature $features"
1151 features="webdav-properties"
1152 if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
1153         enable_feature="$enable_feature $features"
1154 else
1155         disable_feature="$disable_feature $features"
1158 features="webdav-locks"
1159 if test "x$UUID_LIBS" \!= x; then
1160         enable_feature="$enable_feature $features"
1161 else
1162         disable_feature="$disable_feature $features"
1166 dnl output
1168 $ECHO
1169 $ECHO "Plugins:"
1170 $ECHO
1172 $ECHO "enabled: "
1173 for p in $do_build; do
1174         $ECHO "  $p"
1175 done | sort
1177 $ECHO "disabled: "
1178 for p in $no_build; do
1179         $ECHO "  $p"
1180 done | sort
1182 $ECHO
1183 $ECHO "Features:"
1184 $ECHO
1186 $ECHO "enabled: "
1187 for p in $enable_feature; do
1188         $ECHO "  $p"
1189 done | sort
1191 $ECHO "disabled: "
1192 for p in $disable_feature; do
1193         $ECHO "  $p"
1194 done | sort
1196 $ECHO