From 899bf4981a17846ac205383e47fa0cf8428dacd0 Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 18 May 2012 06:19:25 +0000 Subject: * ext/extmk.rb: Show a message when extconf.rb raised an exception. * ext/openssl/extconf.rb: Use exception raising instead of message and/or abort. We want to display error message to console _and_ logging into mkmf.log. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/extmk.rb | 12 +++++++++++- ext/openssl/extconf.rb | 5 ++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/extmk.rb b/ext/extmk.rb index e7593ac9f6..a498268114 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -205,6 +205,8 @@ def extmake(target) end rescue SystemExit # ignore + rescue => error + ok = false ensure rm_f "conftest*" $0 = $PROGRAM_NAME @@ -217,7 +219,15 @@ def extmake(target) f.puts "# " + DUMMY_SIGNATURE f.print(*dummy_makefile(CONFIG["srcdir"])) end - print "Failed to configure #{target}. It will not be installed.\n" + + mess = "Failed to configure #{target}. It will not be installed.\n" + if error + mess.prepend(error.to_s + "\n") + end + + Logging::message(mess) + print(mess) + $stdout.flush return true end args = sysquote($mflags) diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index ff27fad327..6d89fd5f64 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -55,11 +55,10 @@ unless result end unless have_header("openssl/conf_api.h") - message "OpenSSL 0.9.6 or later required.\n" - exit 1 + raise "OpenSSL 0.9.6 or later required." end unless OpenSSL.check_func("SSL_library_init()", "openssl/ssl.h") - abort "Ignore OpenSSL broken by Apple" + raise "Ignore OpenSSL broken by Apple" end message "=== Checking for OpenSSL features... ===\n" -- cgit v1.2.3