dnl $Id: configure.ac,v 1.13 2005/05/15 12:40:48 armin Exp $ dnl ------------------------------------------------------------------ AC_INIT(dnsproxy, 1.15) AC_PREREQ(2.57) AC_REVISION([$Revision: 1.13 $]) AC_CONFIG_HEADERS(config.h) dnl ------------------------------------------------------------------ dnl Check for programs dnl ------------------------------------------------------------------ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET AC_CACHE_SAVE dnl ------------------------------------------------------------------ dnl Check for headers dnl ------------------------------------------------------------------ AC_C_CONST AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(sys/types.h sys/socket.h sys/time.h) AC_CHECK_HEADERS(netinet/in.h arpa/inet.h) AC_CHECK_HEADERS(errno.h syslog.h) AC_TYPE_SIGNAL AC_CACHE_SAVE dnl ------------------------------------------------------------------ dnl Check for functions dnl ------------------------------------------------------------------ AC_CHECK_FUNCS(strchr memcpy) AC_CHECK_FUNCS(setregid setresgid setresuid setreuid) AC_CHECK_FUNCS(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)]) AC_CHECK_FUNCS(socket, , [AC_CHECK_LIB(socket, socket)]) AC_CHECK_FUNCS(inet_pton, , [AC_CHECK_LIB(resolv, inet_pton)]) AC_CACHE_SAVE dnl ------------------------------------------------------------------ dnl Enable extended warnings while developing dnl ------------------------------------------------------------------ AC_ARG_ENABLE(warnings, [ --enable-warnings enable all sorts of warnings for debugging], [ CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations \ -W -Wmissing-prototypes -Wnested-externs -Wshadow \ -Wwrite-strings -Wno-unused -Wno-sign-compare" ]) AC_SUBST(CFLAGS) dnl ------------------------------------------------------------------ dnl Recurse into libevent or check for already installed library dnl ------------------------------------------------------------------ AC_ARG_WITH(native-libevent, [ --with-native-libevent use already installed libevent], [ AC_CHECK_LIB(event, event_init) INCEVENT="" LIBEVENT="" ],[ AC_CONFIG_SUBDIRS(libevent) INCEVENT="-Ilibevent" LIBEVENT="libevent/libevent.a" ]) AC_SUBST(INCEVENT) AC_SUBST(LIBEVENT) dnl ------------------------------------------------------------------ dnl Check for available nroff and manpage macro package dnl ------------------------------------------------------------------ AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$PATH:/usr/ucb]) if ${NROFF} -mdoc dnsproxy.1 >/dev/null 2>&1; then MAN=mdoc else MAN=man fi AC_SUBST(MAN) dnl ------------------------------------------------------------------ dnl Generate Makefile by default. Others only if their .in file dnl exists in the current directory, which happens in my workdir dnl but not for distributed tarballs. dnl ------------------------------------------------------------------ AC_CONFIG_FILES(Makefile) if test -r "README.in"; then AC_CONFIG_FILES(README) fi if test -r "dnsproxy.1.in"; then AC_CONFIG_FILES(dnsproxy.1) fi AC_OUTPUT() AC_MSG_RESULT() AC_MSG_RESULT([Configured successfully. Now run make.]) AC_MSG_RESULT()