tcpdump mailing list archives

Re: installation of shared libraries for libpcap


From: Eloy Paris <peloy () chapus net>
Date: Thu, 8 May 2008 15:56:04 -0400

Hi Larry,

On Wed, May 07, 2008 at 10:05:45AM -0500, Adamiec, Larry wrote:

I am trying to install libpcap-0.9.8 on a Sun SPARC Solaris 9 server.  I
need to install it with shared libraries.

I use the following sequence of commands.

./configure --enable-shared
make
make install

However, the only library I can find is /usr/local/lib/libpcap.a.  I
need the /usr/local/lib/libpcap.so library.  All the documentation says
I am configuring things correctly, but, I must be doing something wrong
because it is not working.

I have also tried the following sequence of commands without success.

./configure
make install-shared

./configure --enable-shared
make install-shared

./configure --enable-shared
make
make install-shared

I am using the GNU version of make, version 3.81.

Any and all help will be appreciated.

I had to apply the following patch to libpcap to be able to get a
working shared libpcap library on Solaris (don't remember the version of
Solaris this was for, though):

----------------------------------------------------------------------
--- x/libpcap-0.9.5/Makefile.in Sun Dec 14 20:35:03 2003
+++ libpcap-0.9.5/Makefile.in   Tue Feb 13 12:32:12 2007
@@ -112,7 +112,8 @@
 #
 libpcap.so: $(OBJ)
        @rm -f $@
-       ld -shared -o $@.`cat VERSION` $(OBJ)
+       ld -L `pwd` -G -o $@.shared -lsocket -lnsl -lresolv -lc -z allextract -lpcap -zdefaultextract
+       mv $@.shared $@

 # the following rule succeeds, but the result is untested.
 libpcap.dylib: $(OBJ)
@@ -189,7 +190,7 @@

 install-shared: install-shared-$(DYEXT)
 install-shared-so: libpcap.so
-       $(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
+       $(INSTALL_PROGRAM) libpcap.so $(DESTDIR)$(libdir)/libpcap.so
 install-shared-dylib: libpcap.dylib
        $(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
        VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib;  ln -sf 
libpcap.0.dylib libpcap.dylib
----------------------------------------------------------------------

It's been a while since I used this but I remember that it worked back
then. It's kind of hackish (the real solution would be to move to
libtool, as Guy says) and no promises that it'll work but should give
you a starting point to play with.

Cheers,

Eloy Paris.-
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: