[前][次][番号順一覧][スレッド一覧]

ruby-changes:23634

From: kosaki <ko1@a...>
Date: Fri, 18 May 2012 15:19:33 +0900 (JST)
Subject: [ruby-changes:23634] kosaki:r35685 (trunk): * ext/extmk.rb: Show a message when extconf.rb raised an exception.

kosaki	2012-05-18 15:19:25 +0900 (Fri, 18 May 2012)

  New Revision: 35685

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35685

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/ext/extmk.rb
    trunk/ext/openssl/extconf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35684)
+++ ChangeLog	(revision 35685)
@@ -1,3 +1,10 @@
+Fri May 18 15:14:32 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* 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.
+
 Fri May 18 06:14:07 2012  Eric Hodel  <drbrain@s...>
 
 	* ext/syslog/lib/syslog/logger.rb:  Added Syslog::Logger which was
Index: ext/openssl/extconf.rb
===================================================================
--- ext/openssl/extconf.rb	(revision 35684)
+++ ext/openssl/extconf.rb	(revision 35685)
@@ -55,11 +55,10 @@
 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"
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 35684)
+++ ext/extmk.rb	(revision 35685)
@@ -205,6 +205,8 @@
 	end
       rescue SystemExit
 	# ignore
+      rescue => error
+        ok = false
       ensure
 	rm_f "conftest*"
 	$0 = $PROGRAM_NAME
@@ -217,7 +219,15 @@
         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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]