From 5e2e8ad9a9d7b5b705d755f203d04a76236c5870 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 22 Mar 2021 00:20:27 +0900 Subject: [PATCH] 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 fbe4893a06..cd42661661 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb @@ -29,6 +29,7 @@ continued_name = nil 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| 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 <