mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 14:39:02 +00:00
Nsock: let libpcap decisions set LDFLAGS, needed for make check
This commit is contained in:
52
nsock/src/configure
vendored
52
nsock/src/configure
vendored
@@ -3540,24 +3540,70 @@ fi
|
|||||||
;;
|
;;
|
||||||
included)
|
included)
|
||||||
LIBPCAP_INC=${top_nmap_srcdir}/libpcap
|
LIBPCAP_INC=${top_nmap_srcdir}/libpcap
|
||||||
|
LIBPCAP_LIB=${top_nmap_srcdir}/libpcap
|
||||||
|
LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a
|
||||||
have_libpcap=yes
|
have_libpcap=yes
|
||||||
;;
|
;;
|
||||||
no)
|
no)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_cppflags=$CPPFLAGS
|
_cppflags=$CPPFLAGS
|
||||||
|
_ldflags=$LDFLAGS
|
||||||
|
|
||||||
CPPFLAGS="-I$with_libpcap/include $CPPFLAGS"
|
CPPFLAGS="-I$with_libpcap/include $CPPFLAGS"
|
||||||
|
LDFLAGS="-L$with_libpcap/lib $LDFLAGS"
|
||||||
|
|
||||||
ac_fn_c_check_header_mongrel "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default"
|
ac_fn_c_check_header_mongrel "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default"
|
||||||
if test "x$ac_cv_header_pcap_h" = xyes; then :
|
if test "x$ac_cv_header_pcap_h" = xyes; then :
|
||||||
|
|
||||||
have_libpcap=yes
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_datalink in -lpcap" >&5
|
||||||
LIBPCAP_INC=$with_libpcap/include
|
$as_echo_n "checking for pcap_datalink in -lpcap... " >&6; }
|
||||||
|
if ${ac_cv_lib_pcap_pcap_datalink+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-lpcap $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char pcap_datalink ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return pcap_datalink ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_pcap_pcap_datalink=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_pcap_pcap_datalink=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_datalink" >&5
|
||||||
|
$as_echo "$ac_cv_lib_pcap_pcap_datalink" >&6; }
|
||||||
|
if test "x$ac_cv_lib_pcap_pcap_datalink" = xyes; then :
|
||||||
|
have_libpcap=yes
|
||||||
|
LIBPCAP_LIBS=-lpcap
|
||||||
|
LIBPCAP_INC=$with_libpcap/include
|
||||||
|
LIBPCAP_LIB=$with_libpcap/lib
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LDFLAGS=$_ldflags
|
||||||
CPPFLAGS=$_cppflags
|
CPPFLAGS=$_cppflags
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -3568,9 +3614,9 @@ fi
|
|||||||
if test "$have_libpcap" != "no"; then
|
if test "$have_libpcap" != "no"; then
|
||||||
$as_echo "#define HAVE_PCAP 1" >>confdefs.h
|
$as_echo "#define HAVE_PCAP 1" >>confdefs.h
|
||||||
|
|
||||||
LIBPCAP_LIBS=-lpcap
|
|
||||||
if test "${LIBPCAP_INC+set}" = "set"; then
|
if test "${LIBPCAP_INC+set}" = "set"; then
|
||||||
CPPFLAGS="-I$LIBPCAP_INC $CPPFLAGS"
|
CPPFLAGS="-I$LIBPCAP_INC $CPPFLAGS"
|
||||||
|
LDFLAGS="-L$LIBPCAP_LIB $LDFLAGS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -129,19 +129,27 @@ AC_HELP_STRING([--without-libpcap], [Disable pcap functions.]),
|
|||||||
;;
|
;;
|
||||||
included)
|
included)
|
||||||
LIBPCAP_INC=${top_nmap_srcdir}/libpcap
|
LIBPCAP_INC=${top_nmap_srcdir}/libpcap
|
||||||
|
LIBPCAP_LIB=${top_nmap_srcdir}/libpcap
|
||||||
|
LIBPCAP_LIBS=${LIBPCAP_LIB}/libpcap.a
|
||||||
have_libpcap=yes
|
have_libpcap=yes
|
||||||
;;
|
;;
|
||||||
no)
|
no)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_cppflags=$CPPFLAGS
|
_cppflags=$CPPFLAGS
|
||||||
|
_ldflags=$LDFLAGS
|
||||||
|
|
||||||
CPPFLAGS="-I$with_libpcap/include $CPPFLAGS"
|
CPPFLAGS="-I$with_libpcap/include $CPPFLAGS"
|
||||||
|
LDFLAGS="-L$with_libpcap/lib $LDFLAGS"
|
||||||
|
|
||||||
AC_CHECK_HEADER(pcap.h,[
|
AC_CHECK_HEADER(pcap.h,[
|
||||||
have_libpcap=yes
|
AC_CHECK_LIB(pcap, pcap_datalink,
|
||||||
LIBPCAP_INC=$with_libpcap/include])
|
[have_libpcap=yes
|
||||||
|
LIBPCAP_LIBS=-lpcap
|
||||||
|
LIBPCAP_INC=$with_libpcap/include
|
||||||
|
LIBPCAP_LIB=$with_libpcap/lib])])
|
||||||
|
|
||||||
|
LDFLAGS=$_ldflags
|
||||||
CPPFLAGS=$_cppflags
|
CPPFLAGS=$_cppflags
|
||||||
;;
|
;;
|
||||||
esac]
|
esac]
|
||||||
@@ -149,9 +157,9 @@ AC_HELP_STRING([--without-libpcap], [Disable pcap functions.]),
|
|||||||
|
|
||||||
if test "$have_libpcap" != "no"; then
|
if test "$have_libpcap" != "no"; then
|
||||||
AC_DEFINE(HAVE_PCAP)
|
AC_DEFINE(HAVE_PCAP)
|
||||||
LIBPCAP_LIBS=-lpcap
|
|
||||||
if test "${LIBPCAP_INC+set}" = "set"; then
|
if test "${LIBPCAP_INC+set}" = "set"; then
|
||||||
CPPFLAGS="-I$LIBPCAP_INC $CPPFLAGS"
|
CPPFLAGS="-I$LIBPCAP_INC $CPPFLAGS"
|
||||||
|
LDFLAGS="-L$LIBPCAP_LIB $LDFLAGS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
AC_SUBST(LIBPCAP_LIBS)
|
AC_SUBST(LIBPCAP_LIBS)
|
||||||
|
|||||||
Reference in New Issue
Block a user