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

ruby-changes:65614

From: Nobuyoshi <ko1@a...>
Date: Mon, 22 Mar 2021 00:20:51 +0900 (JST)
Subject: [ruby-changes:65614] 5e2e8ad9a9 (master): Add `RbConfig::CONFIG["platform"]`

https://git.ruby-lang.org/ruby.git/commit/?id=5e2e8ad9a9

From 5e2e8ad9a9d7b5b705d755f203d04a76236c5870 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 22 Mar 2021 00:20:27 +0900
Subject: Add `RbConfig::CONFIG["platform"]`

Means the platform with the actual CPU info on universal binary.
The CPU in "arch" is fixed as "universal" to refer the header and
library paths.
---
 tool/mkconfig.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index fbe4893..cd42661 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -29,6 +29,7 @@ continued_name = nil https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L29
 continued_line = nil
 install_name = nil
 so_name = nil
+platform = nil
 File.foreach "config.status" do |line|
   next if /^#/ =~ line
   name = nil
@@ -121,7 +122,7 @@ File.foreach "config.status" do |line| https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L122
       universal, val = val, 'universal' if universal
     when /^arch$/
       if universal
-        val.sub!(/universal/, %q[#{arch && universal[/(?:\A|\s)#{Regexp.quote(arch)}=(\S+)/, 1] || RUBY_PLATFORM[/\A[^-]*/]}])
+        platform = val.sub(/universal/, %q[#{arch && universal[/(?:\A|\s)#{Regexp.quote(arch)}=(\S+)/, 1] || RUBY_PLATFORM[/\A[^-]*/]}])
       end
     when /^oldincludedir$/
       val = '"$(SDKROOT)"'+val if /darwin/ =~ arch
@@ -271,6 +272,7 @@ print <<EOS if /darwin/ =~ arch https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L272
   CONFIG["SDKROOT"] = "\#{ENV['SDKROOT']}" # don't run xcrun every time, usually useless.
 EOS
 print <<EOS
+  CONFIG["platform"] = #{platform || '"$(arch)"'}
   CONFIG["archdir"] = "$(rubyarchdir)"
   CONFIG["topdir"] = File.dirname(__FILE__)
   # Almost same with CONFIG. MAKEFILE_CONFIG has other variable
-- 
cgit v1.1


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

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