[PATCH] configure.ac: Use pkg-config to determine engines directory

Fredrik Ternerot
 

Use pkg-config to determine engines directory based on libcrypto.pc.
Previously the directory was determined by compiling and executing a
test program which caused problem when cross compiling.

Signed-off-by: Fredrik Ternerot <fredrikt@...>
---
configure.ac | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3c4127d..a2ff6e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,20 +52,7 @@ AC_ARG_WITH(openssl,
AC_SUBST(OPENSSL_LIB_DIR)
AC_SUBST(OPENSSL_INCLUDE_DIR)])

-AC_LANG(C)
-AC_LANG_CONFTEST(
- [AC_LANG_PROGRAM(
- [[#define HEADER_CRYPTLIB_H
- #include <openssl/crypto.h>
- #include <stdio.h>]],
- [[#if OPENSSL_VERSION_NUMBER < 0x10100000
- puts(ENGINESDIR);
- #else
- puts(OpenSSL_version(OPENSSL_ENGINES_DIR));
- #endif
- ]])])
-gcc $CFLAGS conftest.c -lcrypto
-enginesdir=`./a.out|sed 's/ENGINESDIR: //'`
+PKG_CHECK_VAR([enginesdir], [libcrypto], [enginesdir])
if test -z "$enginesdir" ; then
AC_MSG_FAILURE([Failed to find SSL engines directory])
fi
--
2.11.0

Join openssl-tpm2-engine@groups.io to automatically receive all group messages.