commit 1afd6a68da181e3ea73fb1a8b9163b6e4d0f57b1 from: Omar Polo date: Mon Mar 25 08:55:04 2024 UTC configure: add a check to detect Libre/OpenSSL mixings Now that we're using also some bits from libcrypto, it's important to not mix different libcrypto/ssl implementation in the same program. This check is taken from OpenSMTPD. May have helped with https://github.com/macports/macports-ports/pull/23007 commit - f2a80e942a406dcda39fddc9fd879dfb766338a8 commit + 1afd6a68da181e3ea73fb1a8b9163b6e4d0f57b1 blob - d6bc144f1bae7fe1008ce98010da60c49a6e6f8b blob + 235228d13f4f3c087415e49d12fe99696e5022a0 --- configure.ac +++ configure.ac @@ -161,6 +161,22 @@ AC_SEARCH_LIBS([SSL_CTX_new], [ssl], [:], [ AC_MSG_ERROR([can't find libssl]) ]) +# Sanity check for Libre/OpenSSL headers vs library mismatch +AC_MSG_CHECKING([whether libcrypto headers match the library]) +AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +]], [[ + return (OpenSSL_version_num() != OPENSSL_VERSION_NUMBER); +]])], [ + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([libcrypto headers do not match the library.]) +], [ + AC_MSG_WARN([skip (due to cross-compiling)]) +]) + AC_CHECK_HEADERS([linux/landlock.h]) dnl after all the function checks, add optional support for -Werror