diff --git a/CHANGELOG b/CHANGELOG index a559f89ff..8b59d65cc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -34,8 +34,10 @@ o [Zenmap] Worked around a pycairo bug that prevented saving the (like StringIO)". The problem was reported by Alex Kah. [David] o The -V and --version options now show the platform Nmap was compiled - on, which features are compiled in, and the version numbers of - libraries it is linked against. [Ambarisha B., David] + on, which features are compiled in, the version numbers of + libraries it is linked against, and whether the libraries are the + ones that come with Nmap or are from the operating system. + [Ambarisha B., David] o Fixed some inconsistencies in nmap-os-db reported by Xavier Sudre from netVigilance. diff --git a/configure.ac b/configure.ac index 22a0349b3..3f6da13dd 100644 --- a/configure.ac +++ b/configure.ac @@ -416,6 +416,7 @@ if test $have_libpcap != yes; then PCAP_BUILD="pcap_build" PCAP_CLEAN="pcap_clean" PCAP_DIST_CLEAN="pcap_dist_clean" + AC_DEFINE(PCAP_INCLUDED) else AC_DEFINE(HAVE_LIBPCAP) LIBPCAP_LIBS="-lpcap" @@ -472,6 +473,7 @@ if test $have_pcre != yes ; then PCRE_BUILD="pcre_build" PCRE_CLEAN="pcre_clean" PCRE_DIST_CLEAN="pcre_dist_clean" + AC_DEFINE(PCRE_INCLUDED) else # We only need to check for and use this if we are NOT using included pcre AC_CHECK_HEADERS(pcre/pcre.h) @@ -524,6 +526,7 @@ if test $have_dnet != yes ; then DNET_BUILD="dnet_build" DNET_CLEAN="dnet_clean" DNET_DIST_CLEAN="dnet_dist_clean" + AC_DEFINE(DNET_INCLUDED) else LIBDNET_LIBS="-ldnet" DNET_DEPENDS="" @@ -621,6 +624,7 @@ else LUA_BUILD="lua_build" LUA_CLEAN="lua_clean" LUA_DIST_CLEAN="lua_dist_clean" + AC_DEFINE(LUA_INCLUDED) else AC_MSG_RESULT(yes) fi diff --git a/nmap.cc b/nmap.cc index ef77ab1ae..487aaa6a3 100644 --- a/nmap.cc +++ b/nmap.cc @@ -2854,7 +2854,11 @@ static void display_nmap_version() { unsigned int i; #ifndef NOLUA +#ifdef LUA_INCLUDED + with.push_back(std::string("nmap-liblua-") + get_word_or_quote(LUA_RELEASE, 1)); +#else with.push_back(std::string("liblua-") + get_word_or_quote(LUA_RELEASE, 1)); +#endif #else without.push_back("liblua"); #endif @@ -2865,11 +2869,23 @@ static void display_nmap_version() { without.push_back("openssl"); #endif +#ifdef PCRE_INCLUDED + with.push_back(std::string("nmap-libpcre-") + get_word_or_quote(pcre_version(), 0)); +#else with.push_back(std::string("libpcre-") + get_word_or_quote(pcre_version(), 0)); +#endif +#ifdef PCAP_INCLUDED + with.push_back(std::string("nmap-libpcap-") + get_word_or_quote(pcap_lib_version(), 2)); +#else with.push_back(std::string("libpcap-") + get_word_or_quote(pcap_lib_version(), 2)); +#endif +#ifdef DNET_INCLUDED + with.push_back(std::string("nmap-libdnet-") + DNET_VERSION); +#else with.push_back(std::string("libdnet-") + DNET_VERSION); +#endif #if HAVE_IPV6 with.push_back("ipv6"); diff --git a/nmap_config.h.in b/nmap_config.h.in index 33ba1c2dc..b9f59305d 100644 --- a/nmap_config.h.in +++ b/nmap_config.h.in @@ -178,6 +178,12 @@ extern "C" int gethostname (char *, unsigned int); #endif #endif +/* Used for -V. */ +#undef LUA_INCLUDED +#undef PCAP_INCLUDED +#undef DNET_INCLUDED +#undef PCRE_INCLUDED + #undef DEC #undef LINUX #undef FREEBSD diff --git a/nmap_winconfig.h b/nmap_winconfig.h index e62ef5ab7..fcd227e6b 100644 --- a/nmap_winconfig.h +++ b/nmap_winconfig.h @@ -104,4 +104,9 @@ #define HAVE_OPENSSL 1 +#define LUA_INCLUDED 1 +#undef PCAP_INCLUDED +#define DNET_INCLUDED 1 +#define PCRE_INCLUDED 1 + #endif /* NMAP_WINCONFIG_H */