From db1973d01277278b58253676337e568d5591c01f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 1 Mar 2007 13:30:46 +0000 Subject: [PATCH] * Look for the openssl program at compile time. If not found, call openssl through $PATH at runtime. --- configure.ac | 4 ++++ src/libstore/local-store.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7a83d8f355..7a1c283a20 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,10 @@ NEED_PROG(perl, perl) NEED_PROG(tar, tar) AC_PATH_PROG(dot, dot) +AC_PATH_PROG(openssl_prog, openssl, openssl) # if not found, call openssl in $PATH +AC_SUBST(openssl_prog) +AC_DEFINE_UNQUOTED(OPENSSL_PATH, ["$openssl_prog"], [Path of the OpenSSL binary]) + # Test that Perl has the open/fork feature (Perl 5.8.0 and beyond). AC_MSG_CHECKING([whether Perl is recent enough]) if ! $perl -e 'open(FOO, "-|", "true"); while () { print; }; close FOO or die;'; then diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index edbe567f49..0bf246f1e6 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -776,7 +776,7 @@ void LocalStore::exportPath(const Path & path, bool sign, args.push_back(secretKey); args.push_back("-in"); args.push_back(hashFile); - string signature = runProgram("openssl", true, args); + string signature = runProgram(OPENSSL_PATH, true, args); writeString(signature, hashAndWriteSink); @@ -852,7 +852,7 @@ Path LocalStore::importPath(bool requireSignature, Source & source) args.push_back("-pubin"); args.push_back("-in"); args.push_back(sigFile); - string hash2 = runProgram("openssl", true, args); + string hash2 = runProgram(OPENSSL_PATH, true, args); /* Note: runProgram() throws an exception if the signature is invalid. */