-lmbedx509 needs to be before -lmbedcrypto, otherwise you end up with
unresolved symbols mbedtls_pk_load_file and mbedtls_pk_parse_subpubkey
on systems with static mbedtls libraries and a linker that only does
one left-to-right resolving pass through these.
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <
20160505115050.GA81579@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11605
Signed-off-by: Gert Doering <gert@greenie.muc.de>
if test -z "${MBEDTLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then
# if the user did not explicitly specify flags, try to autodetect
- LIBS="${LIBS} -lmbedtls -lmbedcrypto -lmbedx509"
+ LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"
AC_CHECK_LIB(
[mbedtls],
[mbedtls_ssl_init],
- [MBEDTLS_LIBS="-lmbedtls -lmbedcrypto -lmbedx509"],
+ [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"],
[AC_MSG_ERROR([Could not find mbed TLS.])],
[${PKCS11_HELPER_LIBS}]
)