Received the following when I attempt to build a static version of
tcpdump on HP-UX 11.11 (PA-RISC 2.0) using the vendor's compiler.
checking for pcap_loop... no
configure: error: Report this to tcpdump-workers@lists.tcpdump.org,
and include the config.log file in your report
Tried subscribing to the mailing list, but never get a return email.
Using the web interface results in Error 500.
So here I am :)
Backstory:
I've pulled all the packages needed to run and build tcpdump from
http://hpux.connect.org.uk/hppd/
However, I have a need for a statically compiled tcpdump that we can
encode in a script and drop-off on a large group of servers.
(Installing a few packages on each HP-UX system isn't desirable for a
myriad of reasons)
I was able to build an unshared version of libpcap without issue, and
I'm running into the above problem even if I use the pre-packaged
libpcap from the aforementioned site.
Oddly enough, when I use GCC, I can get tcpdump to compile statically,
however anything other than 'tcpdump -h' generates a core-file :(
Config.log as requested.
config.log says:
/usr/ccs/bin/ld: Unsatisfied symbols:
shl_load (first referenced in /usr/lib/libc.a(nss_deffinder.o)) (code)
shl_findsym (first referenced in /usr/lib/libc.a(nss_deffinder.o)) (code)
Have you ever successfully built a 100% static binary for HP-UX? Many UN*Xes don't support 100% static binaries or require some very specialized mechanisms to do so. In this particular case, it appears that the "system library" (libc on HP-UX) uses the run-time linker to load Name Service Switch modules (as is the case on a number of UN*Xes) - true even of the static version of libc - and a 100% static binary doesn't include the run-time linker, so it appears that, at least on your version of HP-UX, it's either impossible to build a 100% static binary or difficult to do so (there might have to be a special version of libc, not supporting the Name Service Switch, for those binaries - and that version of libc probably, as a result of not supporting the Name Service Switch, won't support a number of APIs that tcpdump uses, e.g. gethostbyaddr()).
However, I don't think you *need* a 100% static binary; *every* HP-UX machine is going to have the dynamic libc library (otherwise, few if any of the critical system binaries in HP-UX will run!). There are presumably specific libraries with which you want to statically link tcpdump; one of them is probably libpcap, and that might well be the *only* such library. If it's the only such library, either just explicitly link with libpcap.a or try putting "-B static" before "-lpcap" *AND* putting "-B dynamic" after "-lpcap" (so that it *only* links statically with libpcap). This will require manually editing the Makefile.
Administrators of the "tcpdump" SourceForge project have superseded this tracker item (formerly artifact 3522541, now bug 144) with issue 148 of the "tcpdump" GitHub project.