711
711
AC_MSG_RESULT(using $GLIBCONFIG)
713
AC_ARG_ENABLE([libnet],
714
[ --enable-libnet Use libnet for ARP based funcationality, [default=try]],
715
[enable_libnet=$withval], [enable_libnet=try])
718
libnet_version="none"
722
AC_MSG_CHECKING(if libnet is required)
723
libnet_fatal=$enable_libnet
724
case $enable_libnet in
726
yes|libnet10|libnet11|10|11) libnet_fatal=yes;;
729
*Linux*|*linux*) libnet_fatal=no;;
730
*) libnet_fatal=yes;; dnl legacy behavior
733
*) libnet_fatal=yes; enable_libnet=try;;
735
AC_MSG_RESULT($libnet_fatal)
737
if test "x$enable_libnet" != "xno"; then
738
AC_PATH_PROGS(LIBNETCONFIG, libnet-config)
740
AC_CHECK_LIB(nsl, t_open) dnl -lnsl
741
AC_CHECK_LIB(socket, socket) dnl -lsocket
742
AC_CHECK_LIB(net, libnet_get_hwaddr, LIBNETLIBS=" -lnet", [])
745
AC_MSG_CHECKING(for libnet)
746
if test "x$LIBNETLIBS" != "x" -o "x$enable_libnet" = "xlibnet11"; then
748
if test "$ac_cv_lib_nsl_t_open" = yes; then
749
LIBNETLIBS="-lnsl $LIBNETLIBS"
751
if test "$ac_cv_lib_socket_socket" = yes; then
752
LIBNETLIBS="-lsocket $LIBNETLIBS"
756
libnet_version="libnet1.1"
759
if test "x$enable_libnet" = "xtry" -o "x$enable_libnet" = "xlibnet10"; then
760
if test "x$LIBNETLIBS" = x -a "x${LIBNETCONFIG}" != "x" ; then
761
LIBNETDEFINES="`$LIBNETCONFIG --defines` `$LIBNETCONFIG --cflags`";
762
LIBNETLIBS="`$LIBNETCONFIG --libs`";
763
libnet_version="libnet1.0 (old)"
765
*-l*) libnet=`echo $LIBNETLIBS | sed 's%.*-l%%'`;;
766
*) libnet_version=none;;
769
CPPFLAGS="$CPPFLAGS $LIBNETDEFINES"
771
AC_CHECK_HEADERS(libnet.h)
772
if test "$ac_cv_header_libnet_h" = no; then
777
AC_MSG_RESULT(found $libnet_version)
779
if test "$libnet_version" = none; then
782
if test $libnet_fatal = yes; then
783
FatalMissingThing "libnet" "You need libnet to continue." \
784
"You can get libnet from http://www.packetfactory.net/libnet" \
785
"Note that some RPMs split libnet up into libnet and libnet-devel." \
786
"In this case you have to install libnet-devel too"
790
AC_CHECK_LIB($libnet,libnet_init,
791
[new_libnet=yes; AC_DEFINE(HAVE_LIBNET_1_1_API, 1, Libnet 1.1 API)],
792
[new_libnet=no; AC_DEFINE(HAVE_LIBNET_1_0_API, 1, Libnet 1.0 API)],$LIBNETLIBS)
797
715
*Linux*|*linux*) sendarp_linux=1;;
801
AC_SUBST(LIBNETDEFINES)
802
AC_DEFINE(HAVE_LIBNET_API, test "x$libnet_version" != "xnone", Libnet API)
804
AM_CONDITIONAL(SENDARP_LINUX, test $sendarp_linux = 1 )
805
AM_CONDITIONAL(USE_LIBNET, test "x$libnet_version" != "xnone" )
808
718
AC_MSG_CHECKING(where is python installed)
809
719
if test "x${PYTHON}" = x; then
810
720
PYTHON="/usr/bin/env python";