tcpdump mailing list archives

Re: Fw: Building 32 bit libpcap on 64 bit OS


From: Guy Harris <guy () alum mit edu>
Date: Tue, 5 Jan 2010 23:42:45 -0800


On Jan 5, 2010, at 2:49 PM, Bryan W Budak wrote:

When building libpcap on 64 bit OS it is placed in the /usr/lib directory

If you build libpcap from our source code, it is installed, by default, in /usr/local/lib, not /usr/lib.  You need 
special configuration options to install in /usr/lib.

rather than the /usr/lib64      This then causes the compile for a 32 bit 
version of my application to fail since there is a 64 bit version in a 32 
bit directory. 
So, is there a way to build a 32 bit version of libpcap on 64 bit OS and 
install in /usr/lib?

The configure script has a --prefix option, but that would control where the header files go as well, e.g. 
"--prefix=/usr" to put the headers in /usr/include and the libraries in /usr/lib, rather than putting them in 
/usr/local/include and /usr/local/lib, respectively.

If you are trying to install in standard system directories, rather than under /usr/local, try

        CFLAGS=<appropriate settings to build a 64-bit library> ./configure --prefix=/usr --libdir=/usr/lib64

to build 64-bit libraries and install them in /usr/lib64, and

        CFLAGS=<appropriate settings to build a 32-bit library> ./configure --prefix=/usr

to build 32-bit libraries and install them in /usr/lib.  Both will install the header files under /usr/include; the 
header files' contents don't differ between ILP32 and LP64.  (You say "/usr/lib", so you're presumably discussing UN*X, 
and thus presumably don't have to worry about Windows-style LLP64.)

(Of cource, there *are* OSes where the 32-bit and 64-bit versions are not only put in the same directory, but are put 
in the same *file*:

        $ file /usr/lib/libpcap.dylib
        /usr/lib/libpcap.dylib: Mach-O universal binary with 3 architectures
        /usr/lib/libpcap.dylib (for architecture x86_64):       Mach-O 64-bit dynamically linked shared library x86_64
        /usr/lib/libpcap.dylib (for architecture i386): Mach-O dynamically linked shared library i386
        /usr/lib/libpcap.dylib (for architecture ppc7400):      Mach-O dynamically linked shared library ppc

but I digress. :-))-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: