The only way to pass tests on OpenBSD is to link with the upstream
libpcap using ../libpcap/libpcap.a (hence not using CMake) because
-lpcap always results in linking with OpenBSD /usr/lib/libpcap.so
regardless of the libpcap.a and libpcap.so that build.sh installs under
/tmp/local/.
Work around by not cleaning in ../libpcap on MATRIX_BUILD_LIBPCAP=yes,
so Autoconf can pick the static library up. On MATRIX_BUILD_LIBPCAP=no
do the cleaning so it cannot.
(cherry picked from commit
40733327128628b8b0db270c4220beaaad1d6e02)
if [ "$BUILD_LIBPCAP" = no ]; then
echo_magenta 'Use system libpcap'
rm -rf $PREFIX
+ make -C ../libpcap distclean || :
else
# Build libpcap with autoconf
CMAKE_SAVE=$CMAKE
CMAKE=no
echo_magenta "Build libpcap (CMAKE=$CMAKE REMOTE=$REMOTE)"
- (cd ../libpcap && ./build.sh && make distclean)
+ (cd ../libpcap && ./build.sh)
CMAKE=$CMAKE_SAVE
fi
}