1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
AC_INIT
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE(guessnet, 0.14)
AM_CONFIG_HEADER(config.h)
dnl Add option to specify a nonstandard location of libnet
LIBNET_CONFIG=no
AC_ARG_WITH(libnet-config,
[ --with-libnet-config=[PFX] Specify location of libnet-config],
LIBNET_CONFIG=$withval
)
dnl To use subdirs
AC_PROG_MAKE_SET
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
AC_C_CONST
AC_C_BIGENDIAN
dnl Check for libnet
#AC_CHECK_HEADER(libnet.h, AC_DEFINE(HAVE_LIBNET_H, 1, libnet.h has been found),
# AC_MSG_ERROR([
#*** libnet.h not found. Check 'config.log' for more details.]))
#
#AC_CHECK_LIB(net, libnet_open_link_interface, x_libs="-lnet",
# AC_MSG_ERROR([
#*** libnet not found. Check 'config.log' for more details.]))
dnl Find libnet
if test "$LIBNET_CONFIG" = "no"
then
AC_PATH_PROG(LIBNET_CONFIG,libnet-config,no)
AC_MSG_CHECKING(for libnet libraries)
if test "$LIBNET_CONFIG" != "no"
then
if ! $LIBNET_CONFIG --help > /dev/null 2>&1
then
AC_MSG_ERROR(Could not find libnet-config anywhere (see config.log for details).)
fi
LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
LIBNET_CFLAGS="`$LIBNET_CONFIG --cflags` `$LIBNET_CONFIG --defines`"
AC_MSG_RESULT(found)
AC_SUBST(LIBNET_LIBS)
AC_SUBST(LIBNET_CFLAGS)
else
AC_MSG_ERROR(No libnet-config was specified (see config.log for details).)
fi
fi
dnl Check for libpcap
AC_CHECK_HEADER(pcap.h, AC_DEFINE(HAVE_PCAP_H, 1, pcap.h has been found),
AC_MSG_ERROR([
*** pcap.h not found. Check 'config.log' for more details.]))
AC_CHECK_LIB(pcap, pcap_open_live, LIBS="-lpcap $LIBS",
AC_MSG_ERROR([
*** libpcap not found. Check 'config.log' for more details.]))
dnl Check for libpopt
AC_CHECK_HEADER(popt.h, AC_DEFINE(HAVE_POPT_H, 1, popt.h has been found),
AC_MSG_ERROR([
*** popt.h not found. Check 'config.log' for more details.]))
AC_CHECK_LIB(popt, poptGetContext, LIBS="-lpopt $LIBS",
AC_MSG_ERROR([
*** libpopt not found. Check 'config.log' for more details.]))
dnl Check for libpthread
AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H, 1, pthread.h has been found),
AC_MSG_ERROR([
*** pthread.h not found. Check 'config.log' for more details.]))
AC_CHECK_LIB(pthread, pthread_create, LIBS="-lpthread $LIBS",
AC_MSG_ERROR([
*** libpthread not found. Check 'config.log' for more details.]))
dnl Check for misc other progs
AC_PATH_PROG(SH, sh)
AC_DEFINE_UNQUOTED(SH, "$SH", [Path to a Bourne-compatible shell])
AC_PATH_PROG(IFCONFIG, ifconfig, /sbin/ifconfig, "$PATH:/sbin:/usr/sbin")
AC_DEFINE_UNQUOTED(IFCONFIG, "$IFCONFIG", [Path to ifconfig])
AC_PATH_PROG(GREP, grep)
AC_DEFINE_UNQUOTED(GREP, "$GREP", [Path to grep])
CFLAGS="-Wall $CFLAGS"
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
|