| 1 | # -*- Autoconf -*- |
|---|
| 2 | # Process this file with autoconf to produce a configure script. |
|---|
| 3 | AC_PREREQ(2.57) |
|---|
| 4 | AC_INIT(lighttpd, 1.4.14, 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 pwd.h sys/syslimits.h \ |
|---|
| 59 | sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.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 | ## openssl on solaris needs -lsocket -lnsl |
|---|
| 174 | AC_SEARCH_LIBS(socket,socket) |
|---|
| 175 | AC_SEARCH_LIBS(gethostbyname,nsl socket) |
|---|
| 176 | AC_SEARCH_LIBS(hstrerror,resolv) |
|---|
| 177 | |
|---|
| 178 | save_LIBS=$LIBS |
|---|
| 179 | AC_SEARCH_LIBS(dlopen,dl,[ |
|---|
| 180 | AC_CHECK_HEADERS([dlfcn.h],[ |
|---|
| 181 | if test "$ac_cv_search_dlopen" != no; then |
|---|
| 182 | test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen" |
|---|
| 183 | fi |
|---|
| 184 | |
|---|
| 185 | AC_DEFINE([HAVE_LIBDL], [1], [libdl]) |
|---|
| 186 | AC_DEFINE([HAVE_DLFCN_H], [1]) |
|---|
| 187 | ]) |
|---|
| 188 | ]) |
|---|
| 189 | LIBS=$save_LIBS |
|---|
| 190 | AC_SUBST(DL_LIB) |
|---|
| 191 | |
|---|
| 192 | dnl Check for valgrind |
|---|
| 193 | AC_MSG_CHECKING(for valgrind) |
|---|
| 194 | AC_ARG_WITH(valgrind, AC_HELP_STRING([--with-valgrind],[enable internal support for valgrind]), |
|---|
| 195 | [WITH_VALGRIND=$withval],[WITH_VALGRIND=no]) |
|---|
| 196 | AC_MSG_RESULT([$WITH_VALGRIND]) |
|---|
| 197 | if test "$WITH_VALGRIND" != "no"; then |
|---|
| 198 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
|---|
| 199 | fi |
|---|
| 200 | |
|---|
| 201 | dnl Check for openssl |
|---|
| 202 | AC_MSG_CHECKING(for OpenSSL) |
|---|
| 203 | AC_ARG_WITH(openssl, |
|---|
| 204 | AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],[Include openssl support (default no)]), |
|---|
| 205 | [WITH_OPENSSL=$withval],[WITH_OPENSSL=no]) |
|---|
| 206 | |
|---|
| 207 | if test "$WITH_OPENSSL" != "no"; then |
|---|
| 208 | use_openssl=yes |
|---|
| 209 | if test "$WITH_OPENSSL" != "yes"; then |
|---|
| 210 | CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include" |
|---|
| 211 | LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib" |
|---|
| 212 | fi |
|---|
| 213 | else |
|---|
| 214 | use_openssl=no |
|---|
| 215 | fi |
|---|
| 216 | AC_MSG_RESULT([$use_openssl]) |
|---|
| 217 | |
|---|
| 218 | AC_ARG_WITH(openssl-includes, |
|---|
| 219 | AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]), |
|---|
| 220 | [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ] |
|---|
| 221 | ) |
|---|
| 222 | |
|---|
| 223 | AC_ARG_WITH(openssl-libs, |
|---|
| 224 | AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]), |
|---|
| 225 | [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ] |
|---|
| 226 | ) |
|---|
| 227 | |
|---|
| 228 | AC_ARG_WITH(kerberos5, |
|---|
| 229 | AC_HELP_STRING([--with-kerberos5],[use Kerberos5 support with OpenSSL]), |
|---|
| 230 | [ use_kerberos=yes ], [use_kerberos=no] |
|---|
| 231 | ) |
|---|
| 232 | |
|---|
| 233 | if test "x$use_openssl" = "xyes"; then |
|---|
| 234 | if test "x$use_kerberos" != "xyes"; then |
|---|
| 235 | CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" |
|---|
| 236 | fi |
|---|
| 237 | |
|---|
| 238 | AC_CHECK_HEADERS([openssl/ssl.h]) |
|---|
| 239 | OLDLIBS="$LIBS" |
|---|
| 240 | AC_CHECK_LIB(crypto, BIO_f_base64, [ |
|---|
| 241 | AC_CHECK_LIB(ssl, SSL_new, [ SSL_LIB="-lssl -lcrypto" |
|---|
| 242 | AC_DEFINE(HAVE_LIBSSL, [], [Have libssl]) ], [], [ -lcrypto "$DL_LIB" ]) |
|---|
| 243 | ], [], []) |
|---|
| 244 | LIBS="$OLDLIBS" |
|---|
| 245 | AC_SUBST(SSL_LIB) |
|---|
| 246 | fi |
|---|
| 247 | |
|---|
| 248 | AC_MSG_CHECKING(for perl regular expressions support) |
|---|
| 249 | AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]), |
|---|
| 250 | [WITH_PCRE=$withval],[WITH_PCRE=yes]) |
|---|
| 251 | AC_MSG_RESULT([$WITH_PCRE]) |
|---|
| 252 | |
|---|
| 253 | if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then |
|---|
| 254 | AC_PATH_PROG(PCRECONFIG, pcre-config) |
|---|
| 255 | |
|---|
| 256 | if test x"$PCRECONFIG" != x; then |
|---|
| 257 | PCRE_LIB=`$PCRECONFIG --libs` |
|---|
| 258 | CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`" |
|---|
| 259 | OLDLIBS="$LIBS" |
|---|
| 260 | LIBS="$LIBS $PCRE_LIB" |
|---|
| 261 | AC_CHECK_LIB(pcre, pcre_compile, [ |
|---|
| 262 | AC_CHECK_HEADERS([pcre.h], [ |
|---|
| 263 | AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre]) |
|---|
| 264 | AC_DEFINE([HAVE_PCRE_H], [1]) |
|---|
| 265 | ]) |
|---|
| 266 | ]) |
|---|
| 267 | LIBS="$OLDLIBS" |
|---|
| 268 | fi |
|---|
| 269 | fi |
|---|
| 270 | |
|---|
| 271 | AC_SUBST(PCRE_LIB) |
|---|
| 272 | |
|---|
| 273 | AC_CHECK_LIB(z, deflate, [ |
|---|
| 274 | AC_CHECK_HEADERS([zlib.h],[ |
|---|
| 275 | Z_LIB=-lz |
|---|
| 276 | AC_DEFINE([HAVE_LIBZ], [1], [libz]) |
|---|
| 277 | AC_DEFINE([HAVE_ZLIB_H], [1]) |
|---|
| 278 | ]) |
|---|
| 279 | ]) |
|---|
| 280 | AC_SUBST(Z_LIB) |
|---|
| 281 | |
|---|
| 282 | AC_MSG_CHECKING(for bzip2 support) |
|---|
| 283 | AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2],[Enable bzip2 support for mod_compress]), |
|---|
| 284 | [WITH_BZIP2=$withval],[WITH_BZIP2=yes]) |
|---|
| 285 | AC_MSG_RESULT([$WITH_BZIP2]) |
|---|
| 286 | |
|---|
| 287 | if test "$WITH_BZIP2" != "no"; then |
|---|
| 288 | AC_CHECK_LIB(bz2, BZ2_bzCompress, [ |
|---|
| 289 | AC_CHECK_HEADERS([bzlib.h],[ |
|---|
| 290 | BZ_LIB=-lbz2 |
|---|
| 291 | AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2]) |
|---|
| 292 | AC_DEFINE([HAVE_BZLIB_H], [1]) |
|---|
| 293 | ]) |
|---|
| 294 | ]) |
|---|
| 295 | fi |
|---|
| 296 | AC_SUBST(BZ_LIB) |
|---|
| 297 | |
|---|
| 298 | if test -z "$PKG_CONFIG"; then |
|---|
| 299 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
|---|
| 300 | fi |
|---|
| 301 | |
|---|
| 302 | dnl Check for gamin |
|---|
| 303 | AC_MSG_CHECKING(for FAM) |
|---|
| 304 | AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]), |
|---|
| 305 | [WITH_FAM=$withval],[WITH_FAM=no]) |
|---|
| 306 | AC_MSG_RESULT([$WITH_FAM]) |
|---|
| 307 | |
|---|
| 308 | if test "$WITH_FAM" != "no"; then |
|---|
| 309 | AC_CHECK_LIB(fam, FAMOpen2, [ |
|---|
| 310 | AC_CHECK_HEADERS([fam.h],[ |
|---|
| 311 | FAM_LIBS=-lfam |
|---|
| 312 | AC_DEFINE([HAVE_LIBFAM], [1], [libfam]) |
|---|
| 313 | AC_DEFINE([HAVE_FAM_H], [1], [fam.h]) |
|---|
| 314 | ]) |
|---|
| 315 | ]) |
|---|
| 316 | if test "x$FAM_LIBS" = x; then |
|---|
| 317 | PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [ |
|---|
| 318 | AC_DEFINE([HAVE_LIBFAM], [1], [libfam]) |
|---|
| 319 | AC_DEFINE([HAVE_FAM_H], [1], [fam.h]) |
|---|
| 320 | ]) |
|---|
| 321 | fi |
|---|
| 322 | OLD_LIBS=$LIBS |
|---|
| 323 | LIBS=$FAM_LIBS |
|---|
| 324 | AC_CHECK_FUNCS([FAMNoExists]) |
|---|
| 325 | LIBS=$OLD_LIBS |
|---|
| 326 | fi |
|---|
| 327 | |
|---|
| 328 | AC_MSG_CHECKING(for properties in mod_webdav) |
|---|
| 329 | AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]), |
|---|
| 330 | [WITH_WEBDAV_PROPS=$withval],[WITH_WEBDAV_PROPS=no]) |
|---|
| 331 | AC_MSG_RESULT([$WITH_WEBDAV_PROPS]) |
|---|
| 332 | |
|---|
| 333 | if test "$WITH_WEBDAV_PROPS" != "no"; then |
|---|
| 334 | PKG_CHECK_MODULES(XML, libxml-2.0, [ |
|---|
| 335 | AC_DEFINE([HAVE_LIBXML2], [1], [libxml2]) |
|---|
| 336 | AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h]) |
|---|
| 337 | ]) |
|---|
| 338 | PKG_CHECK_MODULES(SQLITE, sqlite3, [ |
|---|
| 339 | AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3]) |
|---|
| 340 | AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h]) |
|---|
| 341 | ]) |
|---|
| 342 | |
|---|
| 343 | AC_MSG_CHECKING(for locks in mod_webdav) |
|---|
| 344 | AC_ARG_WITH(webdav-locks, AC_HELP_STRING([--with-webdav-locks],[locks in mod_webdav]), |
|---|
| 345 | [WITH_WEBDAV_LOCKS=$withval],[WITH_WEBDAV_LOCKS=no]) |
|---|
| 346 | AC_MSG_RESULT([$WITH_WEBDAV_LOCKS]) |
|---|
| 347 | |
|---|
| 348 | if test "$WITH_WEBDAV_LOCKS" != "no"; then |
|---|
| 349 | AC_CHECK_LIB(uuid, uuid_unparse, [ |
|---|
| 350 | AC_CHECK_HEADERS([uuid/uuid.h],[ |
|---|
| 351 | UUID_LIBS=-luuid |
|---|
| 352 | AC_DEFINE([HAVE_UUID], [1], [libuuid]) |
|---|
| 353 | AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available]) |
|---|
| 354 | ]) |
|---|
| 355 | ]) |
|---|
| 356 | |
|---|
| 357 | fi |
|---|
| 358 | fi |
|---|
| 359 | AC_SUBST(UUID_LIBS) |
|---|
| 360 | |
|---|
| 361 | dnl Check for gdbm |
|---|
| 362 | AC_MSG_CHECKING(for gdbm) |
|---|
| 363 | AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]), |
|---|
| 364 | [WITH_GDBM=$withval],[WITH_GDBM=no]) |
|---|
| 365 | AC_MSG_RESULT([$WITH_GDBM]) |
|---|
| 366 | |
|---|
| 367 | if test "$WITH_GDBM" != "no"; then |
|---|
| 368 | AC_CHECK_LIB(gdbm, gdbm_open, [ |
|---|
| 369 | AC_CHECK_HEADERS([gdbm.h],[ |
|---|
| 370 | GDBM_LIB=-lgdbm |
|---|
| 371 | AC_DEFINE([HAVE_GDBM], [1], [libgdbm]) |
|---|
| 372 | AC_DEFINE([HAVE_GDBM_H], [1]) |
|---|
| 373 | ]) |
|---|
| 374 | ]) |
|---|
| 375 | AC_SUBST(GDBM_LIB) |
|---|
| 376 | fi |
|---|
| 377 | |
|---|
| 378 | dnl Check for memcache |
|---|
| 379 | AC_MSG_CHECKING(for memcache) |
|---|
| 380 | AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mod_trigger_b4_dl]), |
|---|
| 381 | [WITH_MEMCACHE=$withval],[WITH_MEMCACHE=no]) |
|---|
| 382 | AC_MSG_RESULT([$WITH_MEMCACHE]) |
|---|
| 383 | if test "$WITH_MEMCACHE" != "no"; then |
|---|
| 384 | AC_CHECK_LIB(memcache, mc_new, [ |
|---|
| 385 | AC_CHECK_HEADERS([memcache.h],[ |
|---|
| 386 | MEMCACHE_LIB=-lmemcache |
|---|
| 387 | AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache]) |
|---|
| 388 | AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h]) |
|---|
| 389 | ]) |
|---|
| 390 | ]) |
|---|
| 391 | AC_SUBST(MEMCACHE_LIB) |
|---|
| 392 | fi |
|---|
| 393 | |
|---|
| 394 | dnl Check for lua |
|---|
| 395 | AC_MSG_CHECKING(if lua-support is requested) |
|---|
| 396 | AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]), |
|---|
| 397 | [WITH_LUA=$withval],[WITH_LUA=no]) |
|---|
| 398 | |
|---|
| 399 | AC_MSG_RESULT($WITH_LUA) |
|---|
| 400 | if test "$WITH_LUA" != "no"; then |
|---|
| 401 | if test "$WITH_LUA" = "yes"; then |
|---|
| 402 | WITH_LUA=lua |
|---|
| 403 | fi |
|---|
| 404 | PKG_CHECK_MODULES(LUA, $WITH_LUA >= 5.1, [ |
|---|
| 405 | AC_DEFINE([HAVE_LUA], [1], [liblua]) |
|---|
| 406 | AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) |
|---|
| 407 | ]) |
|---|
| 408 | |
|---|
| 409 | AC_SUBST(LUA_CFLAGS) |
|---|
| 410 | AC_SUBST(LUA_LIBS) |
|---|
| 411 | fi |
|---|
| 412 | |
|---|
| 413 | save_LIBS=$LIBS |
|---|
| 414 | AC_SEARCH_LIBS(crypt,crypt,[ |
|---|
| 415 | AC_CHECK_HEADERS([crypt.h],[ |
|---|
| 416 | AC_DEFINE([HAVE_CRYPT_H], [1]) |
|---|
| 417 | ]) |
|---|
| 418 | |
|---|
| 419 | AC_DEFINE([HAVE_LIBCRYPT], [1], [libcrypt]) |
|---|
| 420 | if test "$ac_cv_search_crypt" != no; then |
|---|
| 421 | test "$ac_cv_search_crypt" = "none required" || CRYPT_LIB="$ac_cv_search_crypt" |
|---|
| 422 | fi |
|---|
| 423 | ]) |
|---|
| 424 | LIBS=$save_LIBS |
|---|
| 425 | AC_SUBST(CRYPT_LIB) |
|---|
| 426 | |
|---|
| 427 | save_LIBS=$LIBS |
|---|
| 428 | AC_SEARCH_LIBS(sendfilev,sendfile,[ |
|---|
| 429 | if test "$ac_cv_search_sendfilev" != no; then |
|---|
| 430 | test "$ac_cv_search_sendfilev" = "none required" || SENDFILE_LIB="$ac_cv_search_sendfilev" |
|---|
| 431 | AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev]) |
|---|
| 432 | fi |
|---|
| 433 | ]) |
|---|
| 434 | LIBS=$save_LIBS |
|---|
| 435 | AC_SUBST(SENDFILE_LIB) |
|---|
| 436 | |
|---|
| 437 | case $host_os in |
|---|
| 438 | *mingw* ) LIBS="$LIBS -lwsock32";; |
|---|
| 439 | * ) ;; |
|---|
| 440 | esac |
|---|
| 441 | |
|---|
| 442 | AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \ |
|---|
| 443 | strdup strerror strstr strtol sendfile getopt socket lstat \ |
|---|
| 444 | gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \ |
|---|
| 445 | getuid select signal pathconf madvise posix_fadvise posix_madvise \ |
|---|
| 446 | writev sigaction sendfile64 send_file kqueue port_create localtime_r]) |
|---|
| 447 | |
|---|
| 448 | AC_MSG_CHECKING(for Large File System support) |
|---|
| 449 | AC_ARG_ENABLE(lfs, |
|---|
| 450 | AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]), |
|---|
| 451 | [case "${enableval}" in |
|---|
| 452 | yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;; |
|---|
| 453 | no) ;; |
|---|
| 454 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;; |
|---|
| 455 | esac],[CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" |
|---|
| 456 | enable_lfs=yes]) |
|---|
| 457 | AC_MSG_RESULT($enableval) |
|---|
| 458 | |
|---|
| 459 | AC_CHECK_SIZEOF(long) |
|---|
| 460 | AC_CHECK_SIZEOF(off_t) |
|---|
| 461 | |
|---|
| 462 | if test "x$ac_cv_func_sendfile" = xyes; then |
|---|
| 463 | # check if sendfile works |
|---|
| 464 | AC_MSG_CHECKING(if sendfile works) |
|---|
| 465 | if test "x$cross_compiling" = xno; then |
|---|
| 466 | AC_TRY_RUN([ |
|---|
| 467 | #ifdef HAVE_SYS_SENDFILE_H |
|---|
| 468 | #include <sys/sendfile.h> |
|---|
| 469 | #endif /* HAVE_SYS_SENDFILE_H */ |
|---|
| 470 | #include <errno.h> |
|---|
| 471 | int main() { |
|---|
| 472 | int o = 0; |
|---|
| 473 | if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1; |
|---|
| 474 | return 0; |
|---|
| 475 | } ], |
|---|
| 476 | AC_MSG_RESULT(yes), |
|---|
| 477 | [ AC_MSG_RESULT(no) |
|---|
| 478 | AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) ] ) |
|---|
| 479 | else |
|---|
| 480 | AC_MSG_RESULT(no, cross-compiling) |
|---|
| 481 | AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile]) |
|---|
| 482 | fi |
|---|
| 483 | fi |
|---|
| 484 | |
|---|
| 485 | dnl Check for IPv6 support |
|---|
| 486 | |
|---|
| 487 | AC_ARG_ENABLE(ipv6, |
|---|
| 488 | AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]), |
|---|
| 489 | [case "${enableval}" in |
|---|
| 490 | yes) ipv6=true ;; |
|---|
| 491 | no) ipv6=false ;; |
|---|
| 492 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;; |
|---|
| 493 | esac],[ipv6=true]) |
|---|
| 494 | |
|---|
| 495 | if test x$ipv6 = xtrue; then |
|---|
| 496 | AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, |
|---|
| 497 | [AC_TRY_LINK([ #include <sys/types.h> |
|---|
| 498 | #include <sys/socket.h> |
|---|
| 499 | #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ], |
|---|
| 500 | [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])]) |
|---|
| 501 | |
|---|
| 502 | if test "$ac_cv_ipv6_support" = yes; then |
|---|
| 503 | AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support]) |
|---|
| 504 | fi |
|---|
| 505 | fi |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) |
|---|
| 509 | |
|---|
| 510 | dnl check for fastcgi lib, for the tests only |
|---|
| 511 | fastcgi_found=no |
|---|
| 512 | AC_CHECK_LIB(fcgi, FCGI_Accept, [ |
|---|
| 513 | AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h],[ |
|---|
| 514 | fastcgi_found=yes |
|---|
| 515 | ]) |
|---|
| 516 | ]) |
|---|
| 517 | |
|---|
| 518 | AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes) |
|---|
| 519 | |
|---|
| 520 | |
|---|
| 521 | if test "${GCC}" = "yes"; then |
|---|
| 522 | CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99" |
|---|
| 523 | fi |
|---|
| 524 | |
|---|
| 525 | dnl build version-id |
|---|
| 526 | LIGHTTPD_VERSION_ID=`echo $PACKAGE_VERSION | $AWK -F '.' '{print "(" $1 " << 16 | " $2 " << 8 | " $3 ")"}'` |
|---|
| 527 | AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id]) |
|---|
| 528 | |
|---|
| 529 | AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile \ |
|---|
| 530 | tests/docroot/Makefile \ |
|---|
| 531 | tests/docroot/123/Makefile \ |
|---|
| 532 | tests/docroot/www/Makefile \ |
|---|
| 533 | tests/docroot/www/go/Makefile \ |
|---|
| 534 | tests/docroot/www/indexfile/Makefile \ |
|---|
| 535 | tests/docroot/www/expire/Makefile \ |
|---|
| 536 | lighttpd.spec distribute.sh cygwin/Makefile cygwin/lighttpd.README |
|---|
| 537 | openwrt/Makefile openwrt/control openwrt/lighttpd.mk]) |
|---|
| 538 | AC_OUTPUT |
|---|
| 539 | |
|---|
| 540 | |
|---|
| 541 | 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" |
|---|
| 542 | |
|---|
| 543 | plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl" |
|---|
| 544 | features="regex-conditionals" |
|---|
| 545 | if test ! "x$PCRE_LIB" = x; then |
|---|
| 546 | do_build="$do_build $plugins" |
|---|
| 547 | enable_feature="$features" |
|---|
| 548 | else |
|---|
| 549 | no_build="$no_build $plugins" |
|---|
| 550 | disable_feature="$features" |
|---|
| 551 | fi |
|---|
| 552 | |
|---|
| 553 | plugins="mod_mysql_vhost" |
|---|
| 554 | if test ! "x$MYSQL_LIBS" = x; then |
|---|
| 555 | do_build="$do_build $plugins" |
|---|
| 556 | else |
|---|
| 557 | no_build="$no_build $plugins" |
|---|
| 558 | fi |
|---|
| 559 | |
|---|
| 560 | plugins="mod_cml mod_magnet" |
|---|
| 561 | if test ! "x$LUA_LIBS" = x; then |
|---|
| 562 | do_build="$do_build $plugins" |
|---|
| 563 | else |
|---|
| 564 | no_build="$no_build $plugins" |
|---|
| 565 | fi |
|---|
| 566 | |
|---|
| 567 | features="storage-gdbm" |
|---|
| 568 | if test ! "x$GDBM_LIB" = x; then |
|---|
| 569 | enable_feature="$enable_feature $features" |
|---|
| 570 | else |
|---|
| 571 | disable_feature="$disable_feature $features" |
|---|
| 572 | fi |
|---|
| 573 | |
|---|
| 574 | features="storage-memcache" |
|---|
| 575 | if test ! "x$MEMCACHE_LIB" = x; then |
|---|
| 576 | enable_feature="$enable_feature $features" |
|---|
| 577 | else |
|---|
| 578 | disable_feature="$disable_feature $features" |
|---|
| 579 | fi |
|---|
| 580 | |
|---|
| 581 | features="compress-gzip compress-deflate" |
|---|
| 582 | if test ! "x$Z_LIB" = x; then |
|---|
| 583 | enable_feature="$enable_feature $features" |
|---|
| 584 | else |
|---|
| 585 | disable_feature="$disable_feature $features" |
|---|
| 586 | fi |
|---|
| 587 | |
|---|
| 588 | features="compress-bzip2" |
|---|
| 589 | if test ! "x$BZ_LIB" = x; then |
|---|
| 590 | enable_feature="$enable_feature $features" |
|---|
| 591 | else |
|---|
| 592 | disable_feature="$disable_feature $features" |
|---|
| 593 | fi |
|---|
| 594 | |
|---|
| 595 | features="auth-ldap" |
|---|
| 596 | if test ! "x$LDAP_LIB" = x; then |
|---|
| 597 | enable_feature="$enable_feature $features" |
|---|
| 598 | else |
|---|
| 599 | disable_feature="$disable_feature $features" |
|---|
| 600 | fi |
|---|
| 601 | |
|---|
| 602 | features="network-openssl" |
|---|
| 603 | if test ! "x$SSL_LIB" = x; then |
|---|
| 604 | enable_feature="$enable_feature $features" |
|---|
| 605 | else |
|---|
| 606 | disable_feature="$disable_feature $features" |
|---|
| 607 | fi |
|---|
| 608 | |
|---|
| 609 | # no crypt call |
|---|
| 610 | features="auth-crypt" |
|---|
| 611 | if test "$ac_cv_search_crypt" = no; then |
|---|
| 612 | disable_feature="$disable_feature $features" |
|---|
| 613 | else |
|---|
| 614 | enable_feature="$enable_feature $features" |
|---|
| 615 | fi |
|---|
| 616 | |
|---|
| 617 | features="network-ipv6" |
|---|
| 618 | if test "$ac_cv_ipv6_support" = yes; then |
|---|
| 619 | enable_feature="$enable_feature $features" |
|---|
| 620 | else |
|---|
| 621 | disable_feature="$disable_feature $features" |
|---|
| 622 | fi |
|---|
| 623 | |
|---|
| 624 | features="large-files" |
|---|
| 625 | if test "$enable_lfs" = yes; then |
|---|
| 626 | enable_feature="$enable_feature $features" |
|---|
| 627 | else |
|---|
| 628 | disable_feature="$disable_feature $features" |
|---|
| 629 | fi |
|---|
| 630 | |
|---|
| 631 | features="stat-cache-fam" |
|---|
| 632 | if test ! "x$FAM_LIBS" = x; then |
|---|
| 633 | enable_feature="$enable_feature $features" |
|---|
| 634 | else |
|---|
| 635 | disable_feature="$disable_feature $features" |
|---|
| 636 | fi |
|---|
| 637 | |
|---|
| 638 | features="webdav-properties" |
|---|
| 639 | if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then |
|---|
| 640 | enable_feature="$enable_feature $features" |
|---|
| 641 | else |
|---|
| 642 | disable_feature="$disable_feature $features" |
|---|
| 643 | fi |
|---|
| 644 | |
|---|
| 645 | features="webdav-locks" |
|---|
| 646 | if test "x$UUID_LIBS" \!= x; then |
|---|
| 647 | enable_feature="$enable_feature $features" |
|---|
| 648 | else |
|---|
| 649 | disable_feature="$disable_feature $features" |
|---|
| 650 | fi |
|---|
| 651 | |
|---|
| 652 | |
|---|
| 653 | ## output |
|---|
| 654 | |
|---|
| 655 | $ECHO |
|---|
| 656 | $ECHO "Plugins:" |
|---|
| 657 | $ECHO |
|---|
| 658 | |
|---|
| 659 | $ECHO "enabled: " |
|---|
| 660 | for p in $do_build; do |
|---|
| 661 | $ECHO " $p" |
|---|
| 662 | done | sort |
|---|
| 663 | |
|---|
| 664 | $ECHO "disabled: " |
|---|
| 665 | for p in $no_build; do |
|---|
| 666 | $ECHO " $p" |
|---|
| 667 | done | sort |
|---|
| 668 | |
|---|
| 669 | $ECHO |
|---|
| 670 | $ECHO "Features:" |
|---|
| 671 | $ECHO |
|---|
| 672 | |
|---|
| 673 | $ECHO "enabled: " |
|---|
| 674 | for p in $enable_feature; do |
|---|
| 675 | $ECHO " $p" |
|---|
| 676 | done | sort |
|---|
| 677 | |
|---|
| 678 | $ECHO "disabled: " |
|---|
| 679 | for p in $disable_feature; do |
|---|
| 680 | $ECHO " $p" |
|---|
| 681 | done | sort |
|---|
| 682 | |
|---|
| 683 | $ECHO |
|---|