mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Disable libnl by default when building with included libpcap
Libpcap only needs libnl for monitor-mode sniffing. Disabling it lets us not worry about which -lnl or -lnl-3 linker argument to include in our own LIBS, so Nmap builds properly no matter whether libnl is present or not.
This commit is contained in:
58
configure
vendored
58
configure
vendored
@@ -6455,64 +6455,6 @@ if test $have_libpcap != yes; then
|
|||||||
|
|
||||||
$as_echo "#define PCAP_INCLUDED 1" >>confdefs.h
|
$as_echo "#define PCAP_INCLUDED 1" >>confdefs.h
|
||||||
|
|
||||||
|
|
||||||
# libpcap can require libnl
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nl_handle_alloc" >&5
|
|
||||||
$as_echo_n "checking for library containing nl_handle_alloc... " >&6; }
|
|
||||||
if ${ac_cv_search_nl_handle_alloc+:} false; then :
|
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
else
|
|
||||||
ac_func_search_save_LIBS=$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 nl_handle_alloc ();
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
return nl_handle_alloc ();
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
for ac_lib in '' nl; do
|
|
||||||
if test -z "$ac_lib"; then
|
|
||||||
ac_res="none required"
|
|
||||||
else
|
|
||||||
ac_res=-l$ac_lib
|
|
||||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
|
||||||
fi
|
|
||||||
if ac_fn_c_try_link "$LINENO"; then :
|
|
||||||
ac_cv_search_nl_handle_alloc=$ac_res
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext
|
|
||||||
if ${ac_cv_search_nl_handle_alloc+:} false; then :
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if ${ac_cv_search_nl_handle_alloc+:} false; then :
|
|
||||||
|
|
||||||
else
|
|
||||||
ac_cv_search_nl_handle_alloc=no
|
|
||||||
fi
|
|
||||||
rm conftest.$ac_ext
|
|
||||||
LIBS=$ac_func_search_save_LIBS
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nl_handle_alloc" >&5
|
|
||||||
$as_echo "$ac_cv_search_nl_handle_alloc" >&6; }
|
|
||||||
ac_res=$ac_cv_search_nl_handle_alloc
|
|
||||||
if test "$ac_res" != no; then :
|
|
||||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
else
|
||||||
# We assume our included libpcap doesn't need this check-and-define
|
# We assume our included libpcap doesn't need this check-and-define
|
||||||
|
|
||||||
|
|||||||
@@ -443,9 +443,6 @@ if test $have_libpcap != yes; then
|
|||||||
PCAP_CLEAN="pcap_clean"
|
PCAP_CLEAN="pcap_clean"
|
||||||
PCAP_DIST_CLEAN="pcap_dist_clean"
|
PCAP_DIST_CLEAN="pcap_dist_clean"
|
||||||
AC_DEFINE(PCAP_INCLUDED, 1, [Using included libpcap])
|
AC_DEFINE(PCAP_INCLUDED, 1, [Using included libpcap])
|
||||||
|
|
||||||
# libpcap can require libnl
|
|
||||||
AC_SEARCH_LIBS(nl_handle_alloc, nl)
|
|
||||||
else
|
else
|
||||||
# We assume our included libpcap doesn't need this check-and-define
|
# We assume our included libpcap doesn't need this check-and-define
|
||||||
PCAP_DEFINE_NETMASK_UNKNOWN
|
PCAP_DEFINE_NETMASK_UNKNOWN
|
||||||
|
|||||||
@@ -1,7 +1,29 @@
|
|||||||
|
The following features are disabled:
|
||||||
|
|
||||||
|
* monitor-mode sniffing of wireless interfaces on Linux, via libnl
|
||||||
|
* building shared libraries
|
||||||
|
* Bluetooth support
|
||||||
|
* canusb support
|
||||||
|
* CAN support
|
||||||
|
* dbus capture support
|
||||||
|
|
||||||
diff --git a/libpcap/configure.in b/libpcap/configure.in
|
diff --git a/libpcap/configure.in b/libpcap/configure.in
|
||||||
index 5386062..8ceddd7 100644
|
index 5386062..8ceddd7 100644
|
||||||
--- a/libpcap/configure.in
|
--- a/libpcap/configure.in
|
||||||
+++ b/libpcap/configure.in
|
+++ b/libpcap/configure.in
|
||||||
|
@@ -441,10 +441,10 @@ linux)
|
||||||
|
# Do we have libnl?
|
||||||
|
#
|
||||||
|
AC_ARG_WITH(libnl,
|
||||||
|
- AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
|
||||||
|
+ AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=disabled@:>@]),
|
||||||
|
with_libnl=$withval,,)
|
||||||
|
|
||||||
|
- if test x$with_libnl != xno ; then
|
||||||
|
+ if test x$with_libnl = xyes ; then
|
||||||
|
have_any_nl="no"
|
||||||
|
|
||||||
|
#
|
||||||
@@ -1285,8 +1285,8 @@ solaris*)
|
@@ -1285,8 +1285,8 @@ solaris*)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
5
libpcap/configure
vendored
5
libpcap/configure
vendored
@@ -1388,8 +1388,7 @@ Optional Packages:
|
|||||||
--without-gcc don't use gcc
|
--without-gcc don't use gcc
|
||||||
--with-sita include SITA support
|
--with-sita include SITA support
|
||||||
--with-pcap=TYPE use packet capture TYPE
|
--with-pcap=TYPE use packet capture TYPE
|
||||||
--without-libnl disable libnl support [default=yes, on Linux, if
|
--without-libnl disable libnl support [default=disabled]
|
||||||
present]
|
|
||||||
--with-dag[=DIR] include Endace DAG support ["yes", "no" or DIR;
|
--with-dag[=DIR] include Endace DAG support ["yes", "no" or DIR;
|
||||||
default="yes" on BSD and Linux if present]
|
default="yes" on BSD and Linux if present]
|
||||||
--with-dag-includes=DIR Endace DAG include directory
|
--with-dag-includes=DIR Endace DAG include directory
|
||||||
@@ -5500,7 +5499,7 @@ if test "${with_libnl+set}" = set; then :
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test x$with_libnl != xno ; then
|
if test x$with_libnl = xyes ; then
|
||||||
have_any_nl="no"
|
have_any_nl="no"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -441,10 +441,10 @@ linux)
|
|||||||
# Do we have libnl?
|
# Do we have libnl?
|
||||||
#
|
#
|
||||||
AC_ARG_WITH(libnl,
|
AC_ARG_WITH(libnl,
|
||||||
AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
|
AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=disabled@:>@]),
|
||||||
with_libnl=$withval,,)
|
with_libnl=$withval,,)
|
||||||
|
|
||||||
if test x$with_libnl != xno ; then
|
if test x$with_libnl = xyes ; then
|
||||||
have_any_nl="no"
|
have_any_nl="no"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user