libpcap icon indicating copy to clipboard operation
libpcap copied to clipboard

generated libpcap.pc file format error

Open leleliu008 opened this issue 4 years ago • 3 comments

generated libpcap.pc file syntax error

example:

#
# pkg-config file for libpcap.
#
# These variables come from the configure script, so includedir and
# libdir may be defined in terms of prefix and exec_prefix, so the
# latter must be defined as well.
#
prefix="/data/data/com.termux/files/home/.ndk-pkg/install.d/libpcap/arm64-v8a"
exec_prefix="${prefix}"
includedir="${prefix}/include"
libdir="${exec_prefix}/lib"

Name: libpcap
Description: Platform-independent network traffic capture library
Version: 1.10.1
Libs: -L${libdir} -lpcap  -l/data/data/com.termux/files/home/.ndk-pkg/install.d/openssl/arm64-v8a/lib/libssl.so -l/data/data/com.termux/files/home/.ndk-pkg/install.d/openssl/arm64-v8a/lib/libcrypto.so
Cflags: -I${includedir}
-l/data/data/com.termux/files/home/.ndk-pkg/install.d/openssl/arm64-v8a/lib/libssl.so

-l argument can not follow the fullpath of library.

leleliu008 avatar Nov 04 '21 01:11 leleliu008

Thank you for this bug report. Could you tell which libpcap version you are using and provide exact steps to reproduce?

infrastation avatar Nov 04 '21 08:11 infrastation

https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz

reproduce steps:

cmake -B build.d -S . -DCMAKE_INSTALL_PREFIX=./output
cmake --build   build.d
cmake --install build.d

relavent code:

https://github.com/the-tcpdump-group/libpcap/blob/master/CMakeLists.txt#L1053

https://github.com/the-tcpdump-group/libpcap/blob/master/CMakeLists.txt#L2735-L2737

OPENSSL_LIBRARIES is fullpath

leleliu008 avatar Nov 04 '21 08:11 leleliu008

This is what I get with CMake on Linux:

Libs: -L${libdir} -lpcap
Libs.private:  -libverbs -lnl-3 -l/usr/lib/x86_64-linux-gnu/libssl.so -l/usr/lib/x86_64-linux-gnu/libcrypto.so -l/usr/lib/x86_64-linux-gnu/libdbus-1.so

And with Autoconf:

Libs: -L${libdir} -lpcap
Libs.private: -libverbs -lnl-genl-3 -lnl-3  -ldbus-1

infrastation avatar Jul 11 '22 22:07 infrastation

This should be fixed by 6493919a4c7cf15d3d4f9878b2f290dd36efafc0.

guyharris avatar Sep 28 '22 06:09 guyharris

This should be fixed by [6493919]

Will this commit be backported to the git branch libpcap-1.10?

fxlb avatar Oct 05 '22 21:10 fxlb

Will this commit be backported to the git branch libpcap-1.10?

Yes, I backported the configuration fixes from the main branch to the 1.10 branch.

guyharris avatar Oct 06 '22 21:10 guyharris

OK. I backported the "configure: use pcap-config --static-pcap-only if available." tcpdump related commit from the main branch to tcpdump-4.99 branch.

fxlb avatar Oct 07 '22 12:10 fxlb