aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-03-13 16:40:32 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-03-13 16:40:32 +0900
commit9d91a329cd01b93c4fe731b475b49e9bc1cee508 (patch)
tree8cea8dcbfaf14d992e00212b8c34888906b3d87a /ext/openssl
parent67b500eb9c332113567c477ccafaea067e357ffb (diff)
downloadruby-openssl-9d91a329cd01b93c4fe731b475b49e9bc1cee508.tar.gz
extconf.rb: print informative message if OpenSSL can't be found
Describe --with-openssl-dir option that specifies the directory the OpenSSL installed if the libraries could not found, and suggest installing "development package" if just the headers are missing. Also, let it raise an exception instead of writing to Logging and terminating the process. This improves the look of the error message on 'gem install openssl' or 'make' (on the Ruby tree) failure.
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/extconf.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index a97883c1..7e014f8e 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -43,13 +43,17 @@ unless result
have_library("crypt32")
end
- result = have_header("openssl/ssl.h")
- result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "CRYPTO_malloc")}
+ result = %w[crypto libeay32].any? {|lib| have_library(lib, "CRYPTO_malloc")}
result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_new")}
unless result
- Logging::message "=== Checking for required stuff failed. ===\n"
- Logging::message "Makefile wasn't created. Fix the errors above.\n"
- exit 1
+ raise "OpenSSL library could not be found. You might want to use " \
+ "--with-openssl-dir=<dir> option to specify the prefix where OpenSSL " \
+ "is installed."
+ end
+ unless have_header("openssl/ssl.h")
+ raise "OpenSSL library itself was found, but the necessary header files " \
+ "are missing. Installing \"development package\" of OpenSSL on your " \
+ "system might help."
end
end