# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) AC_INIT([surblhost], [0.8.0], [csl@sublevel3.org]) AM_INIT_AUTOMAKE(dist-bzip2) AC_CONFIG_SRCDIR([src/surblhost.c]) AC_CONFIG_HEADER([config.h]) AC_REVISION([$Id: configure.ac 152 2007-04-09 15:06:55Z cslsublevel3org $]) AC_CONFIG_FILES([Makefile src/Makefile]) AC_PROG_CC AC_HEADER_STDC AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_ARG_ENABLE([resolv], [ --enable-resolv to use libresolv for DNS TXT queries (default: enable)], [enable_resolv=$enableval], [enable_resolv="yes"]) AC_MSG_CHECKING([--enable-resolv]) AC_MSG_RESULT([$enable_resolv]) if test "x$enable_resolv" != "xno" ; then AC_DEFINE([ENABLE_DNSTXT], [1], [Define to 1 if dns txt lookups should be supported]) fi AC_CHECK_HEADERS([arpa/inet.h]) AC_CHECK_HEADERS([netdb.h]) AC_CHECK_HEADERS([arpa/nameser.h netinet/in.h sys/socket.h sys/types.h]) AC_HEADER_RESOLV AC_CHECK_HEADERS([resolv.h], [], [], [[#if HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETINET_IN_H # include /* inet_ functions / structs */ #endif #ifdef HAVE_ARPA_NAMESER_H # include /* DNS HEADER struct */ #endif #ifdef HAVE_SYS_SOCKET_H # include /* DNS HEADER struct */ #endif ]]) AC_CHECK_HEADERS([nameser8_compat.h]) AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_LIB(nsl,main) AC_CHECK_LIB(socket,main) RESOLV_LIBS="" RESOLV_VARIANTS="resolv c" for resolv in ${RESOLV_VARIANTS}; do AC_CHECK_LIB(${resolv}, [res_init], [RESOLV_LIBS="$RESOLV_LIBS -l${resolv}"; break]) done if test -z "${RESOLV_LIBS}" ; then AC_MSG_WARN([DNS TXT queries will be disabled (or use --disable-resolv)]) else LIBS="$LIBS $RESOLV_LIBS" AC_DEFINE([HAS_WORKING_RESOLV], [1], [Define to 1 if DNS has res_init]) fi AC_CHECK_FUNCS([gethostbyname]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([inet_ntoa]) AC_OUTPUT