| 1 | # -*- Autoconf -*- |
|---|
| 2 | # Process this file with autoconf to produce a configure script. |
|---|
| 3 | AC_PREREQ(2.57) |
|---|
| 4 | AC_INIT(lighttpd, 1.4.18, jan@kneschke.de) |
|---|
| 5 | AC_CONFIG_SRCDIR([src/server.c]) |
|---|
| 6 | |
|---|
| 7 | AC_CANONICAL_TARGET |
|---|
| 8 | |
|---|
| 9 | AM_INIT_AUTOMAKE |
|---|
| 10 | |
|---|
| 11 | AC_CONFIG_HEADER([config.h]) |
|---|
| 12 | |
|---|
| 13 | AM_MAINTAINER_MODE |
|---|
| 14 | |
|---|
| 15 | # Checks for programs. |
|---|
| 16 | AC_PROG_CC |
|---|
| 17 | AM_PROG_CC_C_O |
|---|
| 18 | AC_PROG_LD |
|---|
| 19 | AC_PROG_INSTALL |
|---|
| 20 | AC_PROG_AWK |
|---|
| 21 | AC_PROG_CPP |
|---|
| 22 | dnl AC_PROG_CXX |
|---|
| 23 | AC_PROG_LN_S |
|---|
| 24 | AC_PROG_MAKE_SET |
|---|
| 25 | |
|---|
| 26 | dnl check environment |
|---|
| 27 | AC_AIX |
|---|
| 28 | AC_ISC_POSIX |
|---|
| 29 | AC_MINIX |
|---|
| 30 | |
|---|
| 31 | dnl AC_CANONICAL_HOST |
|---|
| 32 | case $host_os in |
|---|
| 33 | *darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;; |
|---|
| 34 | * ) NO_RDYNAMIC=no;; |
|---|
| 35 | esac |
|---|
| 36 | AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes) |
|---|
| 37 | |
|---|
| 38 | AC_EXEEXT |
|---|
| 39 | |
|---|
| 40 | dnl more automake stuff |
|---|
| 41 | AM_C_PROTOTYPES |
|---|
| 42 | |
|---|
| 43 | dnl libtool |
|---|
| 44 | AC_DISABLE_STATIC |
|---|
| 45 | AC_ENABLE_SHARED |
|---|
| 46 | |
|---|
| 47 | AC_LIBTOOL_DLOPEN |
|---|
| 48 | AC_PROG_LIBTOOL |
|---|
| 49 | |
|---|
| 50 | dnl for solaris |
|---|
| 51 | CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__" |
|---|
| 52 | |
|---|
| 53 | # Checks for header files. |
|---|
| 54 | AC_HEADER_STDC |
|---|
| 55 | AC_HEADER_SYS_WAIT |
|---|
| 56 | AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \ |
|---|
| 57 | sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \ |
|---|
| 58 | getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \ |
|---|
| 59 | sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \ |
|---|
| 60 | sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h]) |
|---|
| 61 | |
|---|
| 62 | # Checks for typedefs, structures, and compiler characteristics. |
|---|
| 63 | AC_C_CONST |
|---|
| 64 | AC_C_INLINE |
|---|
| 65 | AC_C_CHAR_UNSIGNED |
|---|
| 66 | AC_TYPE_OFF_T |
|---|
| 67 | AC_TYPE_PID_T |
|---|
| 68 | AC_TYPE_SIZE_T |
|---|
| 69 | |
|---|
| 70 | AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>]) |
|---|
| 71 | AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>]) |
|---|
| 72 | AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h> |
|---|
| 73 | #include <sys/socket.h>]) |
|---|
| 74 | |
|---|
| 75 | # Checks for library functions. |
|---|
| 76 | AC_FUNC_FORK |
|---|
| 77 | dnl AC_FUNC_MALLOC |
|---|
| 78 | #AC_FUNC_MMAP |
|---|
| 79 | dnl AC_FUNC_REALLOC |
|---|
| 80 | AC_TYPE_SIGNAL |
|---|
| 81 | AC_FUNC_STAT |
|---|
| 82 | AC_FUNC_STRFTIME |
|---|
| 83 | |
|---|
| 84 | dnl Checks for database. |
|---|
| 85 | MYSQL_INCLUDE="" |
|---|
| 86 | MYSQL_LIBS="" |
|---|
| 87 | |
|---|
| 88 | AC_MSG_CHECKING(for MySQL support) |
|---|
| 89 | AC_ARG_WITH(mysql, |
|---|
| 90 | AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],[Include MySQL support. PATH is the path to 'mysql_config']), |
|---|
| 91 | [WITH_MYSQL=$withval],[WITH_MYSQL=no]) |
|---|
| 92 | |
|---|
| 93 | if test "$WITH_MYSQL" != "no"; then |
|---|
| 94 | AC_MSG_RESULT(yes) |
|---|
| 95 | if test "$WITH_MYSQL" = "yes"; then |
|---|
| 96 | AC_PATH_PROG(MYSQL_CONFIG, mysql_config) |
|---|
| 97 | else |
|---|
| 98 | MYSQL_CONFIG=$WITH_MYSQL |
|---|
| 99 | fi |
|---|
| 100 | |
|---|
| 101 | if test "$MYSQL_CONFIG" = ""; then |
|---|
| 102 | AC_MSG_ERROR(mysql_config is not found) |
|---|
| 103 | fi |
|---|
| 104 | if test \! -x $MYSQL_CONFIG; then |
|---|
| 105 | AC_MSG_ERROR(mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config) |
|---|
| 106 | fi |
|---|
| 107 | |
|---|
| 108 | if $MYSQL_CONFIG | grep -- '--include' > /dev/null ; then |
|---|
| 109 | MYSQL_INCLUDE="`$MYSQL_CONFIG --include | sed s/\'//g`" |
|---|
| 110 | else |
|---|
| 111 | MYSQL_INCLUDE="`$MYSQL_CONFIG --cflags | sed s/\'//g`" |
|---|
| 112 | fi |
|---|
| 113 | MYSQL_LIBS="`$MYSQL_CONFIG --libs | sed s/\'//g`" |
|---|
| 114 | |
|---|
| 115 | AC_MSG_CHECKING(for MySQL includes at) |
|---|
| 116 | AC_MSG_RESULT($MYSQL_INCLUDE) |
|---|
| 117 | |
|---|
| 118 | AC_MSG_CHECKING(for MySQL libraries at) |
|---|
| 119 | AC_MSG_RESULT($MYSQL_LIBS) |
|---|
| 120 | dnl check for errmsg.h, which isn't installed by some versions of 3.21 |
|---|
| 121 | old_CPPFLAGS="$CPPFLAGS" |
|---|
| 122 | CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE" |
|---|
| 123 | AC_CHECK_HEADERS(errmsg.h mysql.h) |
|---|
| 124 | CPPFLAGS="$old_CPPFLAGS" |
|---|
| 125 | |
|---|
| 126 | AC_DEFINE([HAVE_MYSQL], [1], [mysql support]) |
|---|
| 127 | else |
|---|
| 128 | AC_MSG_RESULT(no) |
|---|
| 129 | fi |
|---|
| 130 | |
|---|
| 131 | AC_SUBST(MYSQL_LIBS) |
|---|
| 132 | AC_SUBST(MYSQL_INCLUDE) |
|---|
| 133 | |
|---|
| 134 | dnl Check for LDAP |
|---|
| 135 | AC_MSG_CHECKING(for LDAP support) |
|---|
| 136 | AC_ARG_WITH(ldap, AC_HELP_STRING([--with-ldap],[enable LDAP support]), |
|---|
| 137 | [WITH_LDAP=$withval], [WITH_LDAP=no]) |
|---|
| 138 | AC_MSG_RESULT([$withval]) |
|---|
| 139 | if test "$WITH_LDAP" != "no"; then |
|---|
| 140 | AC_CHECK_LIB(ldap, ldap_bind, [ |
|---|
| 141 | AC_CHECK_HEADERS([ldap.h],[ |
|---|
| 142 | LDAP_LIB=-lldap |
|---|
| 143 | AC_DEFINE([HAVE_LIBLDAP], [1], [libldap]) |
|---|
| 144 | AC_DEFINE([HAVE_LDAP_H], [1]) |
|---|
| 145 | ]) |
|---|
| 146 | ]) |
|---|
| 147 | AC_SUBST(LDAP_LIB) |
|---|
| 148 | AC_CHECK_LIB(lber, ber_printf, [ |
|---|
| 149 | AC_CHECK_HEADERS([lber.h],[ |
|---|
| 150 | LBER_LIB=-llber |
|---|
| 151 | AC_DEFINE([HAVE_LIBLBER], [1], [liblber]) |
|---|
| 152 | AC_DEFINE([HAVE_LBER_H], [1]) |
|---|
| 153 | ]) |
|---|
| 154 | ]) |
|---|
| 155 | AC_SUBST(LBER_LIB) |
|---|
| 156 | fi |
|---|
| 157 | |
|---|
| 158 | dnl Check for xattr |
|---|
| 159 | AC_MSG_CHECKING(for extended attributes support) |
|---|
| 160 | AC_ARG_WITH(attr, AC_HELP_STRING([--with-attr],[enable extended attribute support]), |
|---|
| 161 | [WITH_ATTR=$withval],[WITH_ATTR=no]) |
|---|
| 162 | AC_MSG_RESULT($withval) |
|---|
| 163 | if test "$WITH_ATTR" != "no"; then |
|---|
| 164 | AC_CHECK_LIB(attr, attr_get, [ |
|---|
| 165 | AC_CHECK_HEADERS([attr/attributes.h],[ |
|---|
| 166 | ATTR_LIB=-lattr |
|---|
| 167 | AC_DEFINE([HAVE_XATTR], [1], [libattr]) |
|---|
| 168 | AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1]) |
|---|
| 169 | ]) |
|---|
| 170 | ]) |
|---|
| 171 | AC_SUBST(ATTR_LIB) |
|---|
| 172 | fi |
|---|
| 173 | |
|---|
| 174 | ## openssl on solaris needs -lsocket -lnsl |
|---|
| 175 | AC_SEARCH_LIBS(socket,socket) |
|---|
| 176 | AC_SEARCH_LIBS(gethostbyname,nsl socket) |
|---|
| 177 | AC_SEARCH_LIBS(hstrerror,resolv) |
|---|
| 178 | |
|---|
| 179 | save_LIBS=$LIBS |
|---|
| 180 | AC_SEARCH_LIBS(dlopen,dl,[ |
|---|
| 181 | AC_CHECK_HEADERS([dlfcn.h],[ |
|---|
| 182 | if test "$ac_cv_search_dlopen" != no; then |
|---|
| 183 | test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen" |
|---|
| 184 | fi |
|---|
| 185 | |
|---|
| 186 | AC_DEFINE([HAVE_LIBDL], [1], [libdl]) |
|---|
| 187 | AC_DEFINE([HAVE_DLFCN_H], [1]) |
|---|
| 188 | ]) |
|---|
| 189 | ]) |
|---|
| 190 | LIBS=$save_LIBS |
|---|
| 191 | AC_SUBST(DL_LIB) |
|---|
| 192 | |
|---|
| 193 | dnl Check for valgrind |
|---|
| 194 | AC_MSG_CHECKING(for valgrind) |
|---|
| 195 | AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]), |
|---|
| 196 | [WITH_VALGRIND=$withval],[WITH_VALGRIND=no]) |
|---|
| 197 | AC_MSG_RESULT([$WITH_VALGRIND]) |
|---|
| 198 | if test "$WITH_VALGRIND" != "no"; then |
|---|
| 199 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
|---|
| 200 | fi |
|---|
| 201 | |
|---|
| 202 | dnl Check for openssl |
|---|
| 203 | AC_MSG_CHECKING(for OpenSSL) |
|---|
| 204 | AC_ARG_WITH(openssl, |
|---|
| 205 | AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]), |
|---|
| 206 | [WITH_OPENSSL=$withval],[WITH_OPENSSL=no]) |
|---|
| 207 | |
|---|
| 208 | if test "$WITH_OPENSSL" != "no"; then |
|---|
| 209 | use_openssl=yes |
|---|
| 210 | if test "$WITH_OPENSSL" != "yes"; then |
|---|
| 211 | CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include" |
|---|
| 212 | LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib" |
|---|
| 213 | fi |
|---|
| 214 | else |
|---|
| 215 | use_openssl=no |
|---|
| 216 | fi |
|---|
| 217 | AC_MSG_RESULT([$use_openssl]) |
|---|
| 218 | |
|---|
| 219 | AC_ARG_WITH(openssl-includes, |
|---|
| 220 | AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]), |
|---|
| 221 | [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ] |
|---|
| 222 | ) |
|---|
| 223 | |
|---|
| 224 | AC_ARG_WITH(openssl-libs, |
|---|
| 225 | AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]), |
|---|
| 226 | [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ] |
|---|
| 227 | ) |
|---|
| 228 | |
|---|
| 229 | AC_ARG_WITH(kerberos5, |
|---|
| 230 | AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]), |
|---|
| 231 | [ use_kerberos=yes ], [use_kerberos=no] |
|---|
| 232 | ) |
|---|
| 233 | |
|---|
| 234 | if test "x$use_openssl" = "xyes"; then |
|---|
| 235 | if test "x$use_kerberos" != "xyes"; then |
|---|
| 236 | CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" |
|---|
| 237 | fi |
|---|
| 238 | |
|---|
| 239 | AC_CHECK_HEADERS([openssl/ssl.h]) |
|---|
| 240 | OLDLIBS="$LIBS" |
|---|
| 241 | AC_CHECK_LIB(crypto, BIO_f_base64, [ |
|---|
| 242 | AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto" |
|---|
| 243 | AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ]) |
|---|
| 244 | ], [], []) |
|---|
| 245 | LIBS="$OLDLIBS" |
|---|
| 246 | AC_SUBST(SSL_LIB) |
|---|
| 247 | fi |
|---|
| 248 | |
|---|
| 249 | AC_MSG_CHECKING(for perl regular expressions support) |
|---|
| 250 | AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]), |
|---|
| 251 | [WITH_PCRE=$withval],[WITH_PCRE=yes]) |
|---|
| 252 | AC_MSG_RESULT([$WITH_PCRE]) |
|---|
| 253 | |
|---|
| 254 | if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then |
|---|
| 255 | AC_PATH_PROG(PCRECONFIG, pcre-config) |
|---|
| 256 | |
|---|
| 257 | if test x"$PCRECONFIG" != x; then |
|---|
| 258 | PCRE_LIB=`$PCRECONFIG --libs` |
|---|
| 259 | CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`" |
|---|
| 260 | OLDLIBS="$LIBS" |
|---|
| 261 | LIBS="$LIBS $PCRE_LIB" |
|---|
| 262 | AC_CHECK_LIB(pcre, pcre_compile, [ |
|---|
| 263 | AC_CHECK_HEADERS([pcre.h], [ |
|---|
| 264 | AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre]) |
|---|
| 265 | AC_DEFINE([HAVE_PCRE_H], [1]) |
|---|
| 266 | ]) |
|---|
| 267 | ]) |
|---|
| 268 | LIBS="$OLDLIBS" |
|---|
| 269 | fi |
|---|
| 270 | fi |
|---|
| 271 | |
|---|
| 272 | AC_SUBST(PCRE_LIB) |
|---|
| 273 | |
|---|
| 274 | AC_CHECK_LIB(z, deflate, [ |
|---|
| 275 | AC_CHECK_HEADERS([zlib.h],[ |
|---|
| 276 | Z_LIB=-lz |
|---|
| 277 | AC_DEFINE([HAVE_LIBZ], [1], [libz]) |
|---|
| 278 | AC_DEFINE([HAVE_ZLIB_H], [1]) |
|---|
| 279 | ]) |
|---|
| 280 | ]) |
|---|
| 281 | AC_SUBST(Z_LIB) |
|---|
| 282 | |
|---|
| 283 | AC_MSG_CHECKING(for bzip2 support) |
|---|
| 284 | AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]), |
|---|
| 285 | [WITH_BZIP2=$withval],[WITH_BZIP2=yes]) |
|---|
| 286 | AC_MSG_RESULT([$WITH_BZIP2]) |
|---|
| 287 | |
|---|
| 288 | if test "$WITH_BZIP2" != "no"; then |
|---|
| 289 | AC_CHECK_LIB(bz2, BZ2_bzCompress, [ |
|---|
| 290 | AC_CHECK_HEADERS([bzlib.h],[ |
|---|
| 291 | BZ_LIB=-lbz2 |
|---|
| 292 | AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2]) |
|---|
| 293 | AC_DEFINE([HAVE_BZLIB_H], [1]) |
|---|
| 294 | ]) |
|---|
| 295 | ]) |
|---|
| 296 | fi |
|---|
| 297 | AC_SUBST(BZ_LIB) |
|---|
| 298 | |
|---|
| 299 | if test -z "$PKG_CONFIG"; then |
|---|
| 300 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|---|
| 301 | fi |
|---|
| 302 | |
|---|
| 303 | dnl Check for gamin |
|---|
| 304 | AC_MSG_CHECKING(for FAM) |
|---|
| 305 | AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]), |
|---|
| 306 | [WITH_FAM=$withval],[WITH_FAM=no]) |
|---|
| 307 | AC_MSG_RESULT([$WITH_FAM]) |
|---|
| 308 | |
|---|
| 309 | if test "$WITH_FAM" != "no"; then |
|---|
| 310 | AC_CHECK_LIB(fam, FAMOpen2, [ |
|---|
| 311 | AC_CHECK_HEADERS([fam.h],[ |
|---|
| 312 | FAM_LIBS=-lfam |
|---|
| 313 | AC_DEFINE([HAVE_LIBFAM], [1], [libfam]) |
|---|
| 314 | AC_DEFINE([HAVE_FAM_H], [1], [fam.h]) |
|---|
| 315 | ]) |
|---|
| 316 | ]) |
|---|
| 317 | if test "x$FAM_LIBS" = x; then |
|---|
| 318 | PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [ |
|---|
| 319 | AC_DEFINE([HAVE_LIBFAM], [1], [libfam]) |
|---|
| 320 | AC_DEFINE([HAVE_FAM_H], [1], [fam.h]) |
|---|
| 321 | ]) |
|---|
| 322 | fi |
|---|
| 323 | OLD_LIBS=$LIBS |
|---|
| 324 | LIBS=$FAM_LIBS |
|---|
| 325 | AC_CHECK_FUNCS([FAMNoExists]) |
|---|
| 326 | LIBS=$OLD_LIBS |
|---|
| 327 | fi |
|---|
| 328 | |
|---|
| 329 | AC_MSG_CHECKING(for properties in mod_webdav) |
|---|
| 330 | AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]), |
|---|
| 331 | [WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no]) |
|---|
| 332 | AC_MSG_RESULT([$WITH_WEBDAV_PROPS]) |
|---|
| 333 | |
|---|
| 334 | if test "$WITH_WEBDAV_PROPS" != "no"; then |
|---|
| 335 | PKG_CHECK_MODULES(XML, libxml-2.0, [ |
|---|
| 336 | AC_DEFINE([HAVE_LIBXML2], [1], [libxml2]) |
|---|
| 337 | AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h]) |
|---|
| 338 | ]) |
|---|
| 339 | PKG_CHECK_MODULES(SQLITE, sqlite3, [ |
|---|
| 340 | AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3]) |
|---|
| 341 | AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h]) |
|---|
| 342 | ]) |
|---|
| 343 | |
|---|
| 344 | AC_MSG_CHECKING(for locks in mod_webdav) |
|---|
| 345 | AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]), |
|---|
| 346 | [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no]) |
|---|
| 347 | AC_MSG_RESULT([$WITH_WEBDAV_LOCKS]) |
|---|
| 348 | |
|---|
| 349 | if test "$WITH_WEBDAV_LOCKS" != "no"; then |
|---|
| 350 | AC_CHECK_LIB(uuid, uuid_unparse, [ |
|---|
| 351 | AC_CHECK_HEADERS([uuid/uuid.h],[ |
|---|
| 352 | UUID_LIBS=-luuid |
|---|
| 353 | AC_DEFINE([HAVE_UUID], [1], [libuuid]) |
|---|
| 354 | AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available]) |
|---|
| 355 | ]) |
|---|
| 356 | ]) |
|---|
| 357 | |
|---|
| 358 | fi |
|---|
| 359 | fi |
|---|
| 360 | AC_SUBST(UUID_LIBS) |
|---|
| 361 | |
|---|
| 362 | dnl Check for gdbm |
|---|
| 363 | AC_MSG_CHECKING(for gdbm) |
|---|
| 364 | AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]), |
|---|
| 365 | [WITH_GDBM=$withval],[WITH_GDBM=no]) |
|---|
| 366 | AC_MSG_RESULT([$WITH_GDBM]) |
|---|
| 367 | |
|---|
| 368 | if test "$WITH_GDBM" != "no"; then |
|---|
| 369 | AC_CHECK_LIB(gdbm, gdbm_open, [ |
|---|
| 370 | AC_CHECK_HEADERS([gdbm.h],[ |
|---|
| 371 | GDBM_LIB=-lgdbm |
|---|
| 372 | AC_DEFINE([HAVE_GDBM], [1], [libgdbm]) |
|---|
| 373 | AC_DEFINE([HAVE_GDBM_H], [1]) |
|---|
| 374 | ]) |
|---|
| 375 | ]) |
|---|
| 376 | AC_SUBST(GDBM_LIB) |
|---|
| 377 | fi |
|---|
| 378 | |
|---|
| 379 | dnl Check for memcache |
|---|
| 380 | AC_MSG_CHECKING(for memcache) |
|---|
| 381 | AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]), |
|---|
| 382 | [WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no]) |
|---|
| 383 | AC_MSG_RESULT([$WITH_MEMCACHE]) |
|---|
| 384 | if test "$WITH_MEMCACHE" != "no"; then |
|---|
| 385 | AC_CHECK_LIB(memcache, mc_new, [ |
|---|
| 386 | AC_CHECK_HEADERS([memcache.h],[ |
|---|
| 387 | MEMCACHE_LIB=-lmemcache |
|---|
| 388 | AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache]) |
|---|
| 389 | AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h]) |
|---|
| 390 | ]) |
|---|
| 391 | ]) |
|---|
| 392 | AC_SUBST(MEMCACHE_LIB) |
|---|
| 393 | fi |
|---|
| 394 | |
|---|
| 395 | dnl Check for lua |
|---|
| 396 | AC_MSG_CHECKING(if lua-support is requested) |
|---|
| 397 | AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]), |
|---|
| 398 | [WITH_LUA=$withval],[WITH_LUA=no]) |
|---|
| 399 | |
|---|
| 400 | AC_MSG_RESULT($WITH_LUA) |
|---|
| 401 | if test "$WITH_LUA" != "no"; then |
|---|
| 402 | if test "$WITH_LUA" = "yes"; then |
|---|
| 403 | WITH_LUA=lua |
|---|
| 404 | fi |
|---|
| 405 | PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [ |
|---|
| 406 | AC_DEFINE([HAVE_LUA], [1], [liblua]) |
|---|
| 407 | AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) |
|---|
| 408 | ]) |
|---|
| 409 | |
|---|
| 410 | AC_SUBST(LUA_CFLAGS) |
|---|
| 411 | AC_SUBST(LUA_LIBS) |
|---|
| 412 | fi |
|---|
| 413 | |
|---|
| 414 | save_LIBS=$LIBS |
|---|
| 415 | AC_SEARCH_LIBS(crypt,crypt,[ |
|---|
| 416 | AC_CHECK_HEADERS([crypt.h],[ |
|---|
| 417 | AC_DEFINE([HAVE_CRYPT_H], [1]) |
|---|
| 418 | ]) |
|---|
| 419 | |
|---|
| 420 | AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt]) |
|---|
| 421 | if test "$ac_cv_search_crypt" != no; then |
|---|
| 422 | test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt" |
|---|
| 423 | fi |
|---|
| 424 | ]) |
|---|
| 425 | LIBS=$save_LIBS |
|---|
| 426 | AC_SUBST(CRYPT_LIB) |
|---|
| 427 | |
|---|
| 428 | save_LIBS=$LIBS |
|---|
| 429 | AC_SEARCH_LIBS(sendfilev,sendfile,[ |
|---|
| 430 | if test "$ac_cv_search_sendfilev" != no; then |
|---|
| 431 | test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev" |
|---|
| 432 | AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev]) |
|---|
| 433 | fi |
|---|
| 434 | ]) |
|---|
| 435 | LIBS=$save_LIBS |
|---|
| 436 | AC_SUBST(SENDFILE_LIB) |
|---|
| 437 | |
|---|
| 438 | case $host_os in |
|---|
| 439 | *mingw* ) LIBS="$LIBS -lwsock32";; |
|---|
| 440 | * ) ;; |
|---|
| 441 | esac |
|---|
| 442 | |
|---|
| 443 | AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \ |
|---|
| 444 | strdup strerror strstr strtol sendfile getopt socket lstat \ |
|---|
| 445 | gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \ |
|---|
| 446 | getuid select signal pathconf madvise posix_fadvise posix_madvise \ |
|---|
| 447 | writev sigaction sendfile64 send_file kqueue port_create localtime_r]) |
|---|
| 448 | |
|---|
| 449 | AC_MSG_CHECKING(for Large File System support) |
|---|
| 450 | AC_ARG_ENABLE(lfs, |
|---|
| 451 | AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]), |
|---|
| 452 | [case "${enableval}" in |
|---|
| 453 | yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;; |
|---|
| 454 | no) ;; |
|---|
| 455 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;; |
|---|
| 456 | esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" |
|---|
| 457 | enable_lfs=yes]) |
|---|
| 458 | AC_MSG_RESULT($enableval) |
|---|
| 459 | |
|---|
| 460 | AC_CHECK_SIZEOF(long) |
|---|
| 461 | AC_CHECK_SIZEOF(off_t) |
|---|
| 462 | |
|---|
| 463 | if test "x$ac_cv_func_sendfile" = xyes; then |
|---|
| 464 | # check if sendfile works |
|---|
| 465 | AC_MSG_CHECKING(if sendfile works) |
|---|
| 466 | if test "x$cross_compiling" = xno; then |
|---|
| 467 | AC_TRY_RUN([ |
|---|
| 468 | #ifdef HAVE_SYS_SENDFILE_H |
|---|
| 469 | #include <sys/sendfile.h> |
|---|
| 470 | #endif /* HAVE_SYS_SENDFILE_H */ |
|---|
| 471 | #include <errno.h> |
|---|
| 472 | int main() { |
|---|
| 473 | int o = 0; |
|---|
| 474 | if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1; |
|---|
| 475 | return 0; |
|---|
| 476 | } ], |
|---|
| 477 | AC_MSG_RESULT(yes), |
|---|
| 478 | [ AC_MSG_RESULT(no) |
|---|
| 479 | AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] ) |
|---|
| 480 | else |
|---|
| 481 | AC_MSG_RESULT(no, cross-compiling) |
|---|
| 482 | AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) |
|---|
| 483 | fi |
|---|
| 484 | fi |
|---|
| 485 | |
|---|
| 486 | dnl Check for IPv6 support |
|---|
| 487 | |
|---|
| 488 | AC_ARG_ENABLE(ipv6, |
|---|
| 489 | AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]), |
|---|
| 490 | [case "${enableval}" in |
|---|
| 491 | yes) ipv6=true ;; |
|---|
| 492 | no) ipv6=false ;; |
|---|
| 493 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;; |
|---|
| 494 | esac],[ipv6=true]) |
|---|
| 495 | |
|---|
| 496 | if test x$ipv6 = xtrue; then |
|---|
| 497 | AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, |
|---|
| 498 | [AC_TRY_LINK([ #include <sys/types.h> |
|---|
| 499 | #include <sys/socket.h> |
|---|
| 500 | #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ], |
|---|
| 501 | [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])]) |
|---|
| 502 | |
|---|
| 503 | if test "$ac_cv_ipv6_support" = yes; then |
|---|
| 504 | AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support]) |
|---|
| 505 | fi |
|---|
| 506 | fi |
|---|
| 507 | |
|---|
| 508 | |
|---|
| 509 | AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) |
|---|
| 510 | |
|---|
| 511 | dnl check for fastcgi lib, for the tests only |
|---|
| 512 | fastcgi_found=no |
|---|
| 513 | AC_CHECK_LIB(fcgi, FCGI_Accept, [ |
|---|
| 514 | AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[ |
|---|
| 515 | fastcgi_found=yes |
|---|
| 516 | ]) |
|---|
| 517 | ]) |
|---|
| 518 | |
|---|
| 519 | AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes) |
|---|
| 520 | |
|---|
| 521 | |
|---|
| 522 | if test "${GCC}" = "yes"; then |
|---|
| 523 | CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99" |
|---|
| 524 | fi |
|---|
| 525 | |
|---|
| 526 | dnl build version-id |
|---|
| 527 | LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'` |
|---|
| 528 | AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id]) |
|---|
| 529 | |
|---|
| 530 | AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \ |
|---|
| 531 | tests/docroot/Makefile \ |
|---|
| 532 | tests/docroot/123/Makefile \ |
|---|
| 533 | tests/docroot/www/Makefile \ |
|---|
| 534 | tests/docroot/www/go/Makefile \ |
|---|
| 535 | tests/docroot/www/indexfile/Makefile \ |
|---|
| 536 | tests/docroot/www/expire/Makefile \ |
|---|
| 537 | lighttpd.spec distribute.sh cygwin/Makefile cygwin/lighttpd.README |
|---|
| 538 | openwrt/Makefile openwrt/control openwrt/lighttpd.mk]) |
|---|
| 539 | AC_OUTPUT |
|---|
| 540 | |
|---|
| 541 | |
|---|
| 542 | 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 mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfiles mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming" |
|---|
| 543 | |
|---|
| 544 | plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl" |
|---|
| 545 | features="regex-conditionals" |
|---|
| 546 | if test ! "x$PCRE_LIB" = x; then |
|---|
| 547 | do_build="$do_build $plugins" |
|---|
| 548 | enable_feature="$features" |
|---|
| 549 | else |
|---|
| 550 | no_build="$no_build $plugins" |
|---|
| 551 | disable_feature="$features" |
|---|
| 552 | fi |
|---|
| 553 | |
|---|
| 554 | plugins="mod_mysql_vhost" |
|---|
| 555 | if test ! "x$MYSQL_LIBS" = x; then |
|---|
| 556 | do_build="$do_build $plugins" |
|---|
| 557 | else |
|---|
| 558 | no_build="$no_build $plugins" |
|---|
| 559 | fi |
|---|
| 560 | |
|---|
| 561 | plugins="mod_cml mod_magnet" |
|---|
| 562 | if test ! "x$LUA_LIBS" = x; then |
|---|
| 563 | do_build="$do_build $plugins" |
|---|
| 564 | else |
|---|
| 565 | no_build="$no_build $plugins" |
|---|
| 566 | fi |
|---|
| 567 | |
|---|
| 568 | features="storage-gdbm" |
|---|
| 569 | if test ! "x$GDBM_LIB" = x; then |
|---|
| 570 | enable_feature="$enable_feature $features" |
|---|
| 571 | else |
|---|
| 572 | disable_feature="$disable_feature $features" |
|---|
| 573 | fi |
|---|
| 574 | |
|---|
| 575 | features="storage-memcache" |
|---|
| 576 | if test ! "x$MEMCACHE_LIB" = x; then |
|---|
| 577 | enable_feature="$enable_feature $features" |
|---|
| 578 | else |
|---|
| 579 | disable_feature="$disable_feature $features" |
|---|
| 580 | fi |
|---|
| 581 | |
|---|
| 582 | features="compress-gzip compress-deflate" |
|---|
| 583 | if test ! "x$Z_LIB" = x; then |
|---|
| 584 | enable_feature="$enable_feature $features" |
|---|
| 585 | else |
|---|
| 586 | disable_feature="$disable_feature $features" |
|---|
| 587 | fi |
|---|
| 588 | |
|---|
| 589 | features="compress-bzip2" |
|---|
| 590 | if test ! "x$BZ_LIB" = x; then |
|---|
| 591 | enable_feature="$enable_feature $features" |
|---|
| 592 | else |
|---|
| 593 | disable_feature="$disable_feature $features" |
|---|
| 594 | fi |
|---|
| 595 | |
|---|
| 596 | features="auth-ldap" |
|---|
| 597 | if test ! "x$LDAP_LIB" = x; then |
|---|
| 598 | enable_feature="$enable_feature $features" |
|---|
| 599 | else |
|---|
| 600 | disable_feature="$disable_feature $features" |
|---|
| 601 | fi |
|---|
| 602 | |
|---|
| 603 | features="network-openssl" |
|---|
| 604 | if test ! "x$SSL_LIB" = x; then |
|---|
| 605 | enable_feature="$enable_feature $features" |
|---|
| 606 | else |
|---|
| 607 | disable_feature="$disable_feature $features" |
|---|
| 608 | fi |
|---|
| 609 | |
|---|
| 610 | # no crypt call |
|---|
| 611 | features="auth-crypt" |
|---|
| 612 | if test "$ac_cv_search_crypt" = no; then |
|---|
| 613 | disable_feature="$disable_feature $features" |
|---|
| 614 | else |
|---|
| 615 | enable_feature="$enable_feature $features" |
|---|
| 616 | fi |
|---|
| 617 | |
|---|
| 618 | features="network-ipv6" |
|---|
| 619 | if test "$ac_cv_ipv6_support" = yes; then |
|---|
| 620 | enable_feature="$enable_feature $features" |
|---|
| 621 | else |
|---|
| 622 | disable_feature="$disable_feature $features" |
|---|
| 623 | fi |
|---|
| 624 | |
|---|
| 625 | features="large-files" |
|---|
| 626 | if test "$enable_lfs" = yes; then |
|---|
| 627 | enable_feature="$enable_feature $features" |
|---|
| 628 | else |
|---|
| 629 | disable_feature="$disable_feature $features" |
|---|
| 630 | fi |
|---|
| 631 | |
|---|
| 632 | features="stat-cache-fam" |
|---|
| 633 | if test ! "x$FAM_LIBS" = x; then |
|---|
| 634 | enable_feature="$enable_feature $features" |
|---|
| 635 | else |
|---|
| 636 | disable_feature="$disable_feature $features" |
|---|
| 637 | fi |
|---|
| 638 | |
|---|
| 639 | features="webdav-properties" |
|---|
| 640 | if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then |
|---|
| 641 | enable_feature="$enable_feature $features" |
|---|
| 642 | else |
|---|
| 643 | disable_feature="$disable_feature $features" |
|---|
| 644 | fi |
|---|
| 645 | |
|---|
| 646 | features="webdav-locks" |
|---|
| 647 | if test "x$UUID_LIBS" \!= x; then |
|---|
| 648 | enable_feature="$enable_feature $features" |
|---|
| 649 | else |
|---|
| 650 | disable_feature="$disable_feature $features" |
|---|
| 651 | fi |
|---|
| 652 | |
|---|
| 653 | |
|---|
| 654 | ## output |
|---|
| 655 | |
|---|
| 656 | $ECHO |
|---|
| 657 | $ECHO "Plugins:" |
|---|
| 658 | $ECHO |
|---|
| 659 | |
|---|
| 660 | $ECHO "enabled: " |
|---|
| 661 | for p in $do_build; do |
|---|
| 662 | $ECHO " $p" |
|---|
| 663 | done | sort |
|---|
| 664 | |
|---|
| 665 | $ECHO "disabled: " |
|---|
| 666 | for p in $no_build; do |
|---|
| 667 | $ECHO " $p" |
|---|
| 668 | done | sort |
|---|
| 669 | |
|---|
| 670 | $ECHO |
|---|
| 671 | $ECHO "Features:" |
|---|
| 672 | $ECHO |
|---|
| 673 | |
|---|
| 674 | $ECHO "enabled: " |
|---|
| 675 | for p in $enable_feature; do |
|---|
| 676 | $ECHO " $p" |
|---|
| 677 | done | sort |
|---|
| 678 | |
|---|
| 679 | $ECHO "disabled: " |
|---|
| 680 | for p in $disable_feature; do |
|---|
| 681 | $ECHO " $p" |
|---|
| 682 | done | sort |
|---|
| 683 | |
|---|
| 684 | $ECHO |
|---|