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