Merge pull request #266 from eli-schwartz/master
Consistently use pkg-config to find libssl and document the versions required.
This commit is contained in:
commit
c6359f8a27
@ -39,7 +39,7 @@ To build this you'll need:
|
|||||||
- [GNU make](http://www.gnu.org/software/make/)
|
- [GNU make](http://www.gnu.org/software/make/)
|
||||||
- [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
|
- [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
|
||||||
- [zlib](http://www.zlib.net)
|
- [zlib](http://www.zlib.net)
|
||||||
- [openssl](http://www.openssl.org)
|
- [openssl < 1.1](http://www.openssl.org) or [libressl](https://www.libressl.org/)
|
||||||
- [libarchive >= 3.2.0](http://www.libarchive.org)
|
- [libarchive >= 3.2.0](http://www.libarchive.org)
|
||||||
|
|
||||||
and optionally:
|
and optionally:
|
||||||
|
46
configure
vendored
46
configure
vendored
@ -675,43 +675,21 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# OpenSSL libssl with pkg-config support is required when building
|
# libssl with pkg-config support is required.
|
||||||
# the static binaries.
|
|
||||||
#
|
#
|
||||||
if [ "$BUILD_STATIC" = "yes" ]; then
|
printf "Checking for libssl via pkg-config ... "
|
||||||
printf "Checking for OpenSSL via pkg-config ... "
|
if $PKGCONFIG_BIN --exists 'libssl < 1.1' && ! $PKGCONFIG_BIN --exists libtls ; then
|
||||||
if ! $PKGCONFIG_BIN --exists libssl; then
|
echo "found OpenSSL version $($PKGCONFIG_BIN --modversion libssl)."
|
||||||
echo "libssl.pc file not found, exiting."
|
elif $PKGCONFIG_BIN --exists libssl libtls; then
|
||||||
exit 1
|
echo "found LibreSSL version $($PKGCONFIG_BIN --modversion libssl)."
|
||||||
else
|
|
||||||
echo "found version $($PKGCONFIG_BIN --modversion libssl)."
|
|
||||||
echo "CFLAGS += $($PKGCONFIG_BIN --cflags libssl)" >>$CONFIG_MK
|
|
||||||
echo "LDFLAGS += $($PKGCONFIG_BIN --libs libssl)" >>$CONFIG_MK
|
|
||||||
echo "STATIC_LIBS += $($PKGCONFIG_BIN --libs --static libssl)" \
|
|
||||||
>>$CONFIG_MK
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
func=SHA256
|
echo "libssl.pc file not found or incompatible version detected, exiting."
|
||||||
printf "Checking for OpenSSL $func() ... "
|
exit 1
|
||||||
cat <<EOF > _$func.c
|
|
||||||
#include <openssl/sha.h>
|
|
||||||
int main(void) {
|
|
||||||
SHA256(NULL, NULL, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if $XCC _$func.c -lcrypto -o _$func 2>/dev/null; then
|
|
||||||
echo yes.
|
|
||||||
echo "LDFLAGS += -lcrypto" >>$CONFIG_MK
|
|
||||||
else
|
|
||||||
CRYPTO_SHA256=no
|
|
||||||
fi
|
|
||||||
rm -f _$func.c _$func
|
|
||||||
if [ "$CRYPTO_SHA256" = "no" ]; then
|
|
||||||
echo "Failed to link with your system's OpenSSL library, can't continue..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
echo "CFLAGS += $($PKGCONFIG_BIN --cflags libssl)" >>$CONFIG_MK
|
||||||
|
echo "LDFLAGS += $($PKGCONFIG_BIN --libs libssl)" >>$CONFIG_MK
|
||||||
|
echo "STATIC_LIBS += $($PKGCONFIG_BIN --libs --static libssl)" \
|
||||||
|
>>$CONFIG_MK
|
||||||
|
|
||||||
#
|
#
|
||||||
# If --enable-static enabled, build static binaries.
|
# If --enable-static enabled, build static binaries.
|
||||||
|
Loading…
Reference in New Issue
Block a user