Open leleliu008 opened 2 years ago
patch:
before compile:
sed -i 's|${OPENSSL_LIBRARIES}|OpenSSL::SSL OpenSSL::Crypto|g' CMakeLists.txt
after installing:
sed -i 's|-lOpenSSL::SSL|-lssl|' libpcap.pc
sed -i 's|-lOpenSSL::Crypto|-lcrypto|' libpcap.pc
https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz
the reason is
${OPENSSL_LIBRARIES}
is usedwhen
-static
is given, cmake will automatically convert libraries's fullpath (stored in${OPENSSL_LIBRARIES}
) to-Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic -ldl
I suggest you use
OpenSSL::SSL
andOpenSSL::Crypto
cmake imported targets instead of${OPENSSL_LIBRARIES}
cmake variable.cmake don't convert libraries's fullpath (stored in
OpenSSL::SSL
andOpenSSL::Crypto
) to-Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic -ldl
Reference: https://cmake.org/cmake/help/latest/module/FindOpenSSL.html