/boa-0.94.14rc21/configure.in
Autoconf | 301 lines | 215 code | 33 blank | 53 comment | 28 complexity | 1ae84c23c35e4f960a85966ba1cf3b44 MD5 | raw file
Possible License(s): GPL-2.0
- dnl $Id: configure.in,v 1.1.2.16 2003/10/05 04:00:05 jnelson Exp $
- dnl Process this file with autoconf to produce a configure script.
- AC_INIT
- AC_CONFIG_SRCDIR([src/boa.c])
- dnl Make config.h
- AC_CONFIG_HEADER(src/config.h)
- AC_CANONICAL_HOST
- dnl Checks for programs.
- AC_PROG_CC
- AC_PROG_CPP
- AC_C_VAR_FUNC
- CHECK_GNU_MAKE
- if test "x$_cv_gnu_make_command" != "x"; then
- MAKE="$_cv_gnu_make_command"
- ALLSOURCES="\$^"
- else
- MAKE="make"
- ALLSOURCES="\$(.ALLSRC)"
- fi
- AC_SUBST(ALLSOURCES)
- AC_SUBST(MAKE)
- dnl AC_MSG_RESULT($host) dnl i686-pc-linux-gnu
- dnl AC_MSG_RESULT($host_cpu) dnl i686
- dnl AC_MSG_RESULT($host_vendor) dnl pc
- dnl AC_MSG_RESULT($host_os) dnl linux-gnu
- dnl i386-unknown-freebsd4.2
- dnl Checks for libraries.
- # AC_SEARCH_LIBS (function, search-libs, [action-if-found], [action-if-not-found], [other-libraries])
- AC_SEARCH_LIBS(socket, socket net)
- AC_SEARCH_LIBS(inet_aton, resolv)
- AC_SEARCH_LIBS(gethostname, nsl)
- AC_SEARCH_LIBS(gethostbyname, nsl)
- dnl Checks for header files.
- AC_HEADER_DIRENT
- AC_HEADER_STDC
- AC_HEADER_SYS_WAIT
- AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h)
- AC_CHECK_HEADERS(getopt.h unistd.h)
- dnl Checks for typedefs, structures, and compiler characteristics.
- AC_C_CONST
- AC_TYPE_UID_T
- AC_TYPE_OFF_T
- AC_TYPE_PID_T
- AC_TYPE_SIZE_T
- AC_HEADER_TIME
- AC_STRUCT_TM
- dnl AC_CHECK_TYPE(sa_family_t,unsigned short int)
- dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) (includes, function-body, [action-if-found], [action-if-not-found])
- AC_MSG_CHECKING(whether sa_family_t is defined)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <sys/types.h>
- #include <sys/socket.h>
- ]], [[sa_family_t foo2;]])],[AC_MSG_RESULT(yes)],[
- AC_MSG_RESULT(no)
- AC_DEFINE(DONT_HAVE_SA_FAMILY_T,1,[Define if sa_family_t is not defined])
-
- ])
- dnl Checks for library functions.
- AC_FUNC_FNMATCH
- AC_FUNC_MEMCMP
- AC_FUNC_MMAP
- AC_FUNC_SETVBUF_REVERSED
- AC_CHECK_FUNCS(getcwd strdup strstr strcspn strtol)
- AC_CHECK_FUNCS(gethostname gethostbyname socket inet_aton herror inet_addr)
- AC_CHECK_FUNCS(scandir alphasort)
- AC_CHECK_FUNCS(madvise)
- AC_CHECK_STRUCT_FOR([
- #if TIME_WITH_SYS_TIME
- # include <sys/time.h>
- # include <time.h>
- #else
- # if HAVE_SYS_TIME_H
- # include <sys/time.h>
- # else
- # include <time.h>
- # endif
- #endif
- ],tm,tm_gmtoff)
- if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
- AC_DEFINE(HAVE_TM_GMTOFF,1,[Define if struct tm has a tm_gmtoff member])
- fi
- AC_CHECK_STRUCT_FOR([
- #if TIME_WITH_SYS_TIME
- # include <sys/time.h>
- # include <time.h>
- #else
- # if HAVE_SYS_TIME_H
- # include <sys/time.h>
- # else
- # include <time.h>
- # endif
- #endif
- ],tm,tm_zone)
- if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
- AC_DEFINE(HAVE_TM_ZONE,1,[Define if struct tm has tm_zone member])
- fi
- AC_CHECK_STRUCT_FOR([
- #include <sys/types.h>
- #include <netinet/in.h>
- ],sockaddr_in,sin_len)
- if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
- AC_DEFINE(HAVE_SIN_LEN,1,[Define if struct sockaddr_in has sin_len member])
- fi
- if test $ac_cv_func_scandir = no; then
- # scandir not defined, add it
- SCANDIR="scandir.o"
- AC_SUBST(SCANDIR)
- fi
- if test $ac_cv_func_alphasort = no; then
- # alphasort not defined, add it
- ALPHASORT="alphasort.o"
- AC_SUBST(ALPHASORT)
- fi
- if test $ac_cv_func_strdup = no -o $ac_cv_func_strstr = no; then
- # strdup or strstr not defined
- STRUTIL="strutil.o"
- AC_SUBST(STRUTIL)
- fi
- if test -n "$GCC"; then
- dnl if we are running gcc, use -pipe
- test -n "$GCC" && CFLAGS="$CFLAGS -pipe"
- AC_MSG_CHECKING(compile and link profiling code)
- AC_ARG_ENABLE(profiling,
- [ --enable-profiling Compile and link profiling code],
- [
- if test "$enableval" = "yes" ; then
- AC_MSG_RESULT(yes)
- CFLAGS="$CFLAGS -pg"
- LDFLAGS="$LDFLAGS -g -pg"
- else
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(no)
- ])
- fi
- AC_MSG_CHECKING(whether to enable gunzip support)
- AC_ARG_ENABLE(gunzip,
- [ --disable-gunzip Disable use of gunzip],
- [
- if test "$enableval" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(GUNZIP, gunzip)
- AC_DEFINE_UNQUOTED(GUNZIP, "$ac_cv_path_GUNZIP", [Define if gunzip can be found])
- else
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(GUNZIP, gunzip)
- AC_DEFINE_UNQUOTED(GUNZIP, "$ac_cv_path_GUNZIP", [Define if gunzip can be found])
- ])
- AC_MSG_CHECKING(whether to enable access control support)
- AC_ARG_ENABLE(access-control,
- [ --enable-access-control Enable support for allow/deny rules],
- [
- if test "$enableval" = "yes" ; then
- AC_MSG_RESULT(yes)
- CFLAGS="$CFLAGS -DACCESS_CONTROL"
- ACCESSCONTROL_SOURCE="access.c"
- else
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(no)
- ])
- AC_SUBST(ACCESSCONTROL_SOURCE)
- AC_MSG_CHECKING(whether to compile and link debugging code)
- AC_ARG_ENABLE(debug,
- [ --disable-debug Do not compile and link debugging code],
- [
- if test "$enableval" = "yes" ; then
- AC_MSG_RESULT(yes)
- LDFLAGS="$LDFLAGS -g"
- test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
- else
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(yes)
- LDFLAGS="$LDFLAGS -g"
- test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
- ])
- AC_MSG_CHECKING(whether to disable verbose/debug logging)
- AC_ARG_ENABLE(verbose,
- [ --disable-verbose Do not enable verbose/debug logging],
- [
- if test "$enableval" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- CFLAGS="$CFLAGS -DDISABLE_DEBUG"
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(yes)
- ])
- AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
- AC_ARG_WITH(dmalloc,
- [ --with-dmalloc Link with the Dmalloc memory debugger/profiler],
- [
- if test "$withval" = "yes"; then
- AC_MSG_RESULT(trying)
- AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
- else
- AC_MSG_RESULT(no)
- fi
- ],
- [
- AC_MSG_RESULT(no)
- ])
- AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
- AC_ARG_WITH(efence,
- [ --with-efence Link with the Electric Fence memory debugger],
- [
- if test "$withval" = "yes"; then
-