2008年3月5日 星期三

Use the adapted "make options" to compile shared/static libpcap library

The method of how to compile and install libpcap as static/shared library

Following the command sequence
# make all
# make install
>> It will produce libpcap.a static library
# make shared
# make install-shared
It will produce the libpcap.so.0.9.7 shared library


How to compile and install openssl as a shared library
# use the following command to produce the Makefile
./config --prefix=/usr shared

# make
# make build-shared
# make install

The message output by the command "make install"
installing libcrypto.a
installing libssl.a
installing libcrypto.so.0.9.8
installing libssl.so.0.9.8
make[1]: Entering directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[1]: Leaving directory `/usr/lib'
cp libcrypto.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/openssl.pc


之後就會在目錄中產出libcrypto.so.0.9.8, libssl.so.0.9.8兩個shared library
(These two libraries are the mainly components of the openssl package)
# ls -la /usr/lib/lib*
[omit]
-rw-r--r-- 1 root root 2056086 2月 13 17:20 libcrypto.a
-rw-r--r-- 1 root root 251 2月 13 17:29 libcrypto.pc
lrwxrwxrwx 1 root root 18 2月 13 17:41 libcrypto.so -> libcrypto.so.0.9.8
-rwxr-xr-x 1 root root 1344300 2月 13 17:41 libcrypto.so.0.9.8
-rw-r--r-- 1 root root 362224 2月 13 17:23 libssl.a
-rw-r--r-- 1 root root 266 2月 13 17:29 libssl.pc
lrwxrwxrwx 1 root root 15 2月 13 17:41 libssl.so -> libssl.so.0.9.8
-rwxr-xr-x 1 root root 265219 2月 13 17:41 libssl.so.0.9.8
[omit]

沒有留言: