[pkg-opensc-commit] [engine-pkcs11] 23/43: Fixed OpenSSL engines directory autoselection

Eric Dorland eric at moszumanska.debian.org
Sun Jan 31 06:38:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository engine-pkcs11.

commit 60aa098b84e413cda7333300272851d90407f3f4
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Sat Jan 16 11:57:27 2016 +0100

    Fixed OpenSSL engines directory autoselection
---
 NEWS         |  1 +
 configure.ac | 24 ++++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 4d6e804..e1b8152 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 NEWS for Engine PKCS#11 -- History of user visible changes
 
 New in 0.2.1; unreleased;
+* Fixed OpenSSL engines directory autoselection (Michał Trojnara).
 * Fixed PIN-less access to public keys (Mouse).
 * Require new libp11 0.3.1 for PKCS11_enumerate_public_keys().
 
diff --git a/configure.ac b/configure.ac
index 5292d1a..c0a3fc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,7 +74,23 @@ AC_ARG_WITH(
 	[enginesdir],
 	[AS_HELP_STRING([--with-enginesdir],[OpenSSL engines directory @<:@LIBDIR/engines@:>@])],
 	[enginesdir="${withval}"],
-	[enginesdir="\$(libdir)/engines"]
+	[libcryptodir="`$PKG_CONFIG --variable=libdir --silence-errors libcrypto || \
+		$PKG_CONFIG --variable=libdir openssl`"
+	case "`$PKG_CONFIG --modversion --silence-errors libcrypto || \
+		$PKG_CONFIG --modversion openssl`" in
+	1.1.*) # Predicted engines directory prefix for OpenSSL 1.1.x
+		debian_ssl_prefix="openssl-1.1.0";;
+	1.0.*) # Engines directory prefix for OpenSSL 1.0.x
+		debian_ssl_prefix="openssl-1.0.0";;
+	*) # Engines directory prefix for OpenSSL 0.9.x
+		debian_ssl_prefix="ssl";;
+	esac
+	if test -d "$libcryptodir/$debian_ssl_prefix/engines"; then
+		# Debian-based OpenSSL package (for example Ubuntu)
+		enginesdir="$libcryptodir/$debian_ssl_prefix/engines"
+	else # Default OpenSSL engines directory
+		enginesdir="$libcryptodir/engines"
+	fi]
 )
 
 dnl Checks for programs.
@@ -125,6 +141,8 @@ AC_DEFINE([OPENSSL_NO_ECDSA], [], [ECDSA support was not detected in libp11])
 ])
 LIBS=$saved_LIBS
 
+# The "libcrypto" module is not defined in OpenSSL 0.9.7
+# TODO: Deprecate OpenSSL 0.9.7 and stop checking for the "openssl" module
 PKG_CHECK_MODULES(
 	[OPENSSL],
 	[libcrypto >= 0.9.7],
@@ -142,9 +160,7 @@ PKG_CHECK_MODULES(
 	)]
 )
 
-# ok, now we might (or not) have ssl and an engine.
-# still room for "improvements", i.e. hacks to work
-# with old engines.
+# TODO: Deprecate OpenSSL 0.9.7 and get rid of this mess
 
 AC_MSG_CHECKING([for openssl version])
 saved_CPPFLAGS="${CPPFLAGS}"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/engine-pkcs11.git



More information about the pkg-opensc-commit mailing list