Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: Version display: included vs. system libraries
From: David Fifield <david () bamsoftware com>
Date: Fri, 18 Feb 2011 13:12:04 -0800

On Thu, Feb 10, 2011 at 09:58:51AM +0530, ambarisha b wrote:
I like "nmap-" prefix because changing the library name indicates that
the library might have been edited for nmap as in libdnet.The other
two seem to indicate that we have just included the actual libraries
with nmap.

Okay, let's go with this. Option 2, the "nmap-" prefix. Would you like
to implement this, Ambarisha?

What you will need to do is find the places in configure.ac where the
included libraries are used. Then define a macro that we can test within
the program. For example, for libpcap, it will be something like this:

if test $have_libpcap != yes; then
  AC_CONFIG_SUBDIRS(libpcap)
  if test "${LIBPCAP_INC+set}" = "set"; then
    CPPFLAGS="$CPPFLAGS -I$LIBPCAP_INC"
  else
    CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/$libpcapdir"
  fi
  LIBPCAP_LIBS='$(LIBPCAPDIR)/libpcap.a'
  PCAP_DEPENDS='$(LIBPCAPDIR)/libpcap.a'
  PCAP_BUILD="pcap_build"
  PCAP_CLEAN="pcap_clean"
  PCAP_DIST_CLEAN="pcap_dist_clean"
  # This is the added line.
  AC_DEFINE(PCAP_INCLUDED)
else

You will then need to run the "autoconf" program to regenerate configure
from configure.ac. Also you will need to add a line for PCAP_INCLUDED to
nmap_config.h, following the format of the other lines in that file.

Then, in display_nmap_version, output the "nmap-" or not, depending on
whether PCAP_INCLUDED is defined.

The above instructions may not be completely correct but are probably
pretty close.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]