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