dnl $Id: configure.in,v 1.5 1997/07/29 01:57:07 itojun Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(../src/main.c) AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_CANONICAL_HOST AC_PROG_INSTALL() case "$host_os" in bsdi*) CC=${CC-"shlicc"};; esac AC_SUBST(CC) CC=${CC-cc} dnl debug option AC_MSG_CHECKING(if --enable-debug option specified) AC_ARG_ENABLE(debug, [ --enable-debug Build a debugging version.], [ts_cv_debug="yes"], [ts_cv_debug="no"]) if test "$ts_cv_debug" = yes; then AC_DEFINE(DEBUG) OPTFLAG=${OPTFLAG-"-g"} fi AC_MSG_RESULT($ts_cv_debug) dnl debug option AC_MSG_CHECKING(if --disable-ipv6 option specified) AC_ARG_ENABLE(ipv6, [ --disable-ipv6 Build WITHOUT ipv6 support.], [ts_cv_disableipv6="disable"], [ts_cv_disableipv6="no"]) AC_MSG_RESULT($ts_cv_disableipv6) AC_SUBST(OPTFLAG) OPTFLAG=${OPTFLAG-"-O"} dnl Check to see if it's going to work. AM_SANITY_CHECK_CC dnl Checks for libraries. AC_MSG_CHECKING(for pcap library near here) ac_cv_pcap_dir="no" for ac_dir in ../../libpcap-* ../libpcap-* libpcap-*; do if test -d $ac_dir -a -f $ac_dir/pcap.h -a -f $ac_dir/libpcap.a; then ac_cv_pcap_dir=$ac_dir; LDFLAGS="-L$ac_dir $LDFLAGS" CFLAGS="-I$ac_dir $CFLAGS" fi done AC_MSG_RESULT($ac_cv_pcap_dir) AC_CHECK_LIB(pcap, pcap_dispatch, [], [dnl echo Fatal: no pcap library found. cannot continue; echo You need to fetch libpcap-* from ftp.ee.lbl.gov, and compile beforehand. exit 1]) AC_CHECK_LIB(termcap, tgetstr, [], [dnl echo Fatal: no termcap library found. exit 1]) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS(limits.h paths.h sgtty.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h regex.h regexp.h netinet6/ah.h netinet/ah.h) dnl Checks for ipv6 support. if test "$ts_cv_disableipv6" = no; then AC_MSG_CHECKING(for ipv6 support) AC_CACHE_VAL(ts_cv_ipv6, [dnl AC_TRY_COMPILE([#define INET6 #include #include ], [int x = IPPROTO_IPV6; struct in6_addr a;], [ts_cv_ipv6="yes"], [ts_cv_ipv6="no"])]) AC_MSG_RESULT($ts_cv_ipv6) if test "$ts_cv_ipv6" = yes; then OPTFLAG="-DINET6 $OPTFLAG" fi fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(select gettimeofday) AC_OUTPUT(Makefile)