dnl Process this file with autoconf to produce a configure script. AC_INIT(doscan, 0.3.1, fw@deneb.enyo.de) AC_CANONICAL_TARGET AC_EXEEXT dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_PROG_CXX if test "$GCC" = "yes" ; then AC_SUBST([WARN_CFLAGS], [-Wall]) fi dnl for C compiler properties. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([libintl.h stdint.h stdlib.h string.h strings.h unistd.h]) AC_CHECK_HEADERS([sys/filio.h sys/epoll.h]) dnl Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([memcpy memset epoll_wait]) dnl Checks for libraries. AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(connect, socket) AC_CHECK_PROG([PCRE_CONFIG], [pcre-config], [pcre-config], [no]) if test "$PCRE_CONFIG" = "no" ; then AC_MSG_ERROR([cannot find PCRE library]) fi dnl C++ compiler compatibility checks. AC_LANG(C++) AC_COMPILE_IFELSE([#include #include #include #include void test(unsigned host) { struct in_addr in; struct hostent *he; in.s_addr = htonl(host); he = gethostbyaddr(&in, sizeof(in), AF_INET); } ], [AC_DEFINE(GETHOSTBYADDR_ACCEPTS_IN_ADDR, [], [Define if first argument to gethostbyaddr() is struct in_addr*.])]) AC_COMPILE_IFELSE([#include #include #include #include void test(unsigned host) { struct in_addr in; struct hostent *he; in.s_addr = htonl(host); he = gethostbyaddr(reinterpret_cast(&in), sizeof(in), AF_INET); } ], [AC_DEFINE(GETHOSTBYADDR_ACCEPTS_CHAR, [], [Define if first argument to gethostbyaddr() is char*.])]) dnl Handle . AH_BOTTOM([/* Include where available. On other systems, hope that provides the necessary types. */ #ifdef HAVE_STDINT_H #include #else #include #endif ]) AC_CONFIG_SRCDIR([src/doscan.cc]) AC_CONFIG_HEADER(config.h) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT