# Need at least 2.64 for PACKAGE_URL AC_PREREQ([2.64]) AC_INIT(darkstat, 3.0.718, , , http://unix4lyfe.org/darkstat/) AC_CONFIG_SRCDIR([darkstat.c]) AC_CONFIG_HEADER([config.h]) RULE="------------------------------------------------------------" # 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 m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: 'make V=1') --disable-silent-rules verbose build output (undo: 'make V=0')]) case $enable_silent_rules in no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac AC_SUBST([AM_DEFAULT_VERBOSITY]) # Let user disable debugging symbols so we create smaller binaries. AC_MSG_CHECKING(if we want debug code) AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug], [turn off debugging code and asserts]), [if test "x$enableval" = "xno" ; then CFLAGS="$CFLAGS -DNDEBUG -g0" AC_MSG_RESULT(nope) elif test "x$enableval" = "xyes" ; then AC_MSG_RESULT(sure) else CFLAGS="$CFLAGS -g$enableval" AC_MSG_RESULT(sure ($enableval)) fi], [AC_MSG_RESULT(sure)]) # 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_MSG_CHECKING(if your C compiler has a link-time optimizer) if test x$GCC = xyes; then save_cflags="$CFLAGS" CFLAGS="-flto $CFLAGS" if (eval $ac_link) 2>/dev/null; then AC_MSG_RESULT(sure does) else AC_MSG_RESULT(no) CFLAGS="$save_cflags" fi else AC_MSG_RESULT(skipped) fi AC_ARG_ENABLE(warnings, AS_HELP_STRING([--enable-warnings], [turn on lots of compile-time warnings, these are only useful for development]), [if test "x$enableval" = "xyes" ; then AC_MSG_CHECKING(if your C compiler has gcc-like --extra-warnings) save_cflags="$CFLAGS" CFLAGS="$CFLAGS -fdiagnostics-show-option --all-warnings --extra-warnings" if (eval $ac_link) 2>/dev/null; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) CFLAGS="$save_cflags" fi AC_MSG_CHECKING(if your C compiler has clang-like -Weverything) save_cflags="$CFLAGS" CFLAGS="$CFLAGS -Weverything" if (eval $ac_link) 2>/dev/null; then AC_MSG_RESULT(yes) 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 <