Get runtime version of libdnet if possible

This commit is contained in:
dmiller
2026-09-25 16:04:15 +00:00
parent bb69aeafb5
commit 248fe810c7
7 changed files with 33 additions and 7 deletions
Vendored
+14
View File
@@ -8262,8 +8262,22 @@ then :
printf "%s\n" "#define DNET_INCLUDED 1" >>confdefs.h
printf "%s\n" "#define HAVE_DNET_LIB_VERSION 1" >>confdefs.h
else $as_nop
LIBS_OLD="$LIBS"
LIBS="$LIBS -ldnet"
ac_fn_c_check_func "$LINENO" "dnet_lib_version" "ac_cv_func_dnet_lib_version"
if test "x$ac_cv_func_dnet_lib_version" = xyes
then :
printf "%s\n" "#define HAVE_DNET_LIB_VERSION 1" >>confdefs.h
fi
LIBS="$LIBS_OLD"
LIBDNET_LIBS="-ldnet"
DNET_BUILD=""
DNET_CLEAN=""
+6
View File
@@ -819,7 +819,13 @@ AS_IF([test "x$have_dnet" != "xyes"], [
DNET_CLEAN="clean-dnet"
DNET_DIST_CLEAN="distclean-dnet"
AC_DEFINE(DNET_INCLUDED, 1, [Use included libdnet])
AC_DEFINE(HAVE_DNET_LIB_VERSION, 1, [Included libdnet has dnet_lib_version])
], [
LIBS_OLD="$LIBS"
LIBS="$LIBS -ldnet"
AC_CHECK_FUNCS([dnet_lib_version])
LIBS="$LIBS_OLD"
LIBDNET_LIBS="-ldnet"
DNET_BUILD=""
DNET_CLEAN=""
+1
View File
@@ -44,6 +44,7 @@ struct addr {
} while (0)
__BEGIN_DECLS
const char *dnet_lib_version(void);
int addr_cmp(const struct addr *a, const struct addr *b);
int addr_bcast(const struct addr *a, struct addr *b);
+5
View File
@@ -48,6 +48,11 @@ union sockunion {
#endif
};
const char *dnet_lib_version(void)
{
return (VERSION);
}
int
addr_cmp(const struct addr *a, const struct addr *b)
{
+5 -7
View File
@@ -123,12 +123,10 @@
#endif
/* To get the version number only. */
#ifdef WIN32
#include "libdnet-stripped/include/dnet_winconfig.h"
#else
#include "libdnet-stripped/include/config.h"
#include "dnet.h"
#ifndef HAVE_DNET_LIB_VERSION
#define dnet_lib_version() ("system")
#endif
#define DNET_VERSION VERSION
#ifdef LINUX
/* Check for Windows Subsystem for Linux (WSL) */
@@ -2879,9 +2877,9 @@ static void display_nmap_version() {
#endif
#ifdef DNET_INCLUDED
with.push_back(std::string("nmap-libdnet-") + DNET_VERSION);
with.push_back(std::string("nmap-libdnet-") + dnet_lib_version());
#else
with.push_back(std::string("libdnet-") + DNET_VERSION);
with.push_back(std::string("libdnet-") + dnet_lib_version());
#endif
#if HAVE_IPV6
+1
View File
@@ -152,6 +152,7 @@ extern "C" int gethostname (char *, unsigned int);
#undef LUA_INCLUDED
#undef PCAP_INCLUDED
#undef DNET_INCLUDED
#undef HAVE_DNET_LIB_VERSION
#undef PCRE_INCLUDED
#undef LIBSSH2_INCLUDED
#undef ZLIB_INCLUDED
+1
View File
@@ -79,6 +79,7 @@
#define LUA_INCLUDED 1
#undef PCAP_INCLUDED
#define DNET_INCLUDED 1
#define HAVE_DNET_LIB_VERSION 1
#define PCRE_INCLUDED 1
#define LIBSSH2_INCLUDED 1
#define ZLIB_INCLUDED 1