AC_INIT(darkstat, 3.0.0-git) AC_CONFIG_SRCDIR([darkstat.c]) AC_CONFIG_HEADER([config.h]) RULE="------------------------------------------------------------" # Let user specify CHROOT_DIR, or else autodetect it, or else die. AC_ARG_WITH(chroot-dir, AS_HELP_STRING([--with-chroot-dir], [specify the chroot directory (default: /var/empty)]), [_chd="$withval"], [# Find an "empty" directory to serve as the chroot. _chd="/var/empty" AC_MSG_CHECKING([for $_chd]) if test -d $_chd ; then AC_MSG_RESULT(found it) else AC_MSG_RESULT(not there - what a shitty Unix) _chd="/var/lib/empty" AC_MSG_CHECKING([for $_chd]) if test -d $_chd ; then AC_MSG_RESULT(found it) else AC_MSG_RESULT(not there either) AC_MSG_ERROR([please specify --with-chroot-dir]) fi fi]) AC_DEFINE_UNQUOTED(CHROOT_DIR, "$_chd", [Default chroot directory.]) # Allow configure-time override of PRIVDROP_USER. AC_ARG_WITH(privdrop-user, AS_HELP_STRING([--with-privdrop-user], [specify which user to drop privileges to (default: nobody)]), [_pdu="$withval"], [_pdu="nobody"]) AC_DEFINE_UNQUOTED(PRIVDROP_USER, "$_pdu", [User to privdrop to.]) # Checks for programs. AC_PROG_INSTALL AC_PROG_CC # Augment CFLAGS for fun. echo "int main(void){return 1;}" > conftest.$ac_ext AC_MSG_CHECKING(if your C compiler wants a hit off the pipe) save_cflags="$CFLAGS" CFLAGS="-pipe $CFLAGS" if (eval $ac_link) 2>/dev/null; then AC_MSG_RESULT(sure does) else AC_MSG_RESULT(no) CFLAGS="$save_cflags" fi AC_ARG_WITH(mad-warnings, AS_HELP_STRING([--with-mad-warnings], [turn on lots of compile-time warnings, this needs GCC and is only really useful for development]), [if test "$withval" = yes ; then AC_MSG_CHECKING(if your C compiler throws mad warnings) save_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wredundant-decls -Wnested-externs \ -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \ -Winline -Wcast-qual -W -Wbad-function-cast -Wcast-align \ -Wchar-subscripts -Wshadow -Wwrite-strings \ -Wuninitialized -Winline" if (eval $ac_link) 2>/dev/null; then AC_MSG_RESULT(sure does) else AC_MSG_RESULT(no) CFLAGS="$save_cflags" fi fi]) rm -f conftest.$ac_objext conftest.$ac_ext # Check for zlib. AC_CHECK_LIB(z, deflate,, [ cat <