Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2023-08-10T13:50:53Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/2999configure makes erroneous assumption to discover location of OpenSSL librarie...2023-08-10T13:50:53ZMark Priorconfigure makes erroneous assumption to discover location of OpenSSL libraries on macOSThe configure script supplied in the tarball aborts when trying to determine support for OpenSSL routines on macOS due to an erroneous assumption.
The configure script builds code snippets to determine availability of various EVP routin...The configure script supplied in the tarball aborts when trying to determine support for OpenSSL routines on macOS due to an erroneous assumption.
The configure script builds code snippets to determine availability of various EVP routines. To determine the location of the OpenSSL libraries it executes the following code
```
# Now search for the system OpenSSL library.
if test "${use_openssl}" = "yes" ; then
for d in /usr /usr/local /usr/local/ssl /usr/local/opt/openssl /usr/pkg /usr/sfw; do
if test -f $d/include/openssl/opensslv.h; then
use_openssl="${d}"
openssl_headers="${d}/include"
for l in lib lib64; do
if test -f "${d}/${l}/libssl.so"; then
openssl_libraries="${d}/${l}"
break
fi
done
if test -n "${openssl_headers}" && test -n "${openssl_libraries}"; then
break
fi
fi
done
fi
```
macOS does not use .so type libraries and so even though this code successfully sets use_openssl and openssl_headers if OpenSSL is installed it fails to set openssl_libraries.
The following code is then executed
```
if test "${openssl_headers}" = "/usr/include" ; then
CRYPTO_CFLAGS=""
CRYPTO_INCLUDES=""
CRYPTO_LIBS="-lssl -lcrypto"
else
CRYPTO_CFLAGS=""
CRYPTO_INCLUDES="-I${openssl_headers}"
case $host in
*-solaris*)
CRYPTO_LIBS="-L${openssl_libraries} -R${openssl_libraries} -lssl -lcrypto"
;;
*-hp-hpux*)
CRYPTO_LIBS="-L${openssl_libraries} -Wl,+b: -lssl -lcrypto"
;;
*-apple-darwin*)
if test -f "${openssl_libraries}/libcrypto.dylib" ; then
CRYPTO_LIBS="-L${openssl_libraries} -lssl -lcrypto"
else
CRYPTO_LIBS="${openssl_libraries}/libssl.a ${openssl_libraries}/libcrypto.a"
fi
;;
*)
CRYPTO_LIBS="-L${openssl_libraries} -lssl -lcrypto"
;;
esac
fi
```
If openssl_headers is NOT `/usr/include`, which is likely on macOS since it's not an Apple supplied library and a standard build of OpenSSL will install in `/usr/local` instead of `/usr`, then CRYPTO_LIBS will be set to `/libssl.a /lib/crypto.a`, neither of which exist.
This will cause the following code snippets that test the existence of various EVP routing to all fail and hence configure aborts.
**Environment:**
- Kea version: kea-2.4.0
- OS: macOS 10.13.6next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/860on macOS 10.14.6 when configuring --with-lcov libssl is not recognized2022-11-02T15:10:19ZRazvan Becheriuon macOS 10.14.6 when configuring --with-lcov libssl is not recognized```
checking for OpenSSL library... yes
checking OpenSSL version... OpenSSL 1.0.2s 28 May 2019
checking support of SHA-2... configure: error: missing EVP entry for SHA-2
```
however, without --with-lcov works fine```
checking for OpenSSL library... yes
checking OpenSSL version... OpenSSL 1.0.2s 28 May 2019
checking support of SHA-2... configure: error: missing EVP entry for SHA-2
```
however, without --with-lcov works finebacklog