mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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.
This commit is contained in:
parent
cb396d4214
commit
5e2e8ad9a9
Notes:
git
2021-03-22 00:21:01 +09:00
Merged: https://github.com/ruby/ruby/pull/4300 Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 3 additions and 1 deletions
|
@ -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 <<EOS if /darwin/ =~ arch
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue