Nmap Development mailing list archives

Re: Can't build Nmap --with-libpcap=path/to/libpcap


From: olli hauer <ohauer () gmx de>
Date: Wed, 11 Dec 2013 19:46:53 +0100

On 2013-12-11 18:37, Daniel Miller wrote:
Hi List,

So I was trying to clean up Nsock a bit, since it unconditionally uses the pcap.h that ships with Nmap, even when a 
system-installed libpcap-dev package is available. But that's a separate issue, since I can't fix it without changing 
compatibility, as follows:

Download and build libpcap. Call the directory $MY_PCAP.

Configure Nmap: ./configure --with-libpcap=$MY_PCAP

Watch in consternation as these messages fly past:
checking pcap.h usability... no
checking pcap.h presence... no
checking for pcap.h... no

The problem is that Nmap's configure script checks for $MY_PCAP/include/pcap.h, when the file is really in 
$MY_PCAP/pcap.h. The same problem would surface when linking, since the LDFLAGS are set to -L$MY_PCAP/lib, and the 
libraries are also in the top-level directory. This is true of the latest libpcap (1.5.2), the one that ships with 
Nmap (1.2.1), and the source package for the one in Ubuntu 12.04 (1.1.1).

The fix, as I see it, is to alter configure.ac to remove the include/ and lib/ subdirectories for libpcap. I want to 
know how this may affect others before I commit it, though, in case somebody's libpcap is structured differently. An 
alternative would be to have separate configure options for the include and lib directories.


Hi Dan,

I've just done a simple ./configure with libpcap-1.5.2 and in the generated Makefile the following line can be found.

...
# Pathname of directory to install the include files
includedir = ${prefix}/include
...
install: install-shared install-archive pcap-config
        [ -d $(DESTDIR)$(libdir) ] || \
            (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
        [ -d $(DESTDIR)$(includedir) ] || \
            (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
        [ -d $(DESTDIR)$(includedir)/pcap ] || \
            (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)

Can you check your parameters for libpcap, specially the generated Makefile.

-- 
olli
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: