summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2023-03-21 15:25:32 +0900
committernagachika <nagachika@ruby-lang.org>2023-03-21 15:25:32 +0900
commit485e0e46a58ff1a28eecd63b804b3dbea4b95b98 (patch)
tree449ca81c84f1a8ba666fb9210656dd97b9fef1af
parent0d00732d39de1e5ecce738260a1e49d8af52e12a (diff)
downloadruby-485e0e46a58ff1a28eecd63b804b3dbea4b95b98.tar.gz
merge revision(s) 3a7367ccc319499127ead147e5a08f769e44208e: [Backport #19403]
mkconfig: Map `includedir` only for system ruby Only when installing to the system path on macOS, prepend '$(SDKROOT)' and remap `includedir`. Fix https://github.com/rbenv/ruby-build/discussions/2123 --- test/mkmf/test_config.rb | 4 ++-- test/test_rbconfig.rb | 9 --------- tool/mkconfig.rb | 4 +++- 3 files changed, 5 insertions(+), 12 deletions(-)
-rw-r--r--test/mkmf/test_config.rb4
-rw-r--r--test/test_rbconfig.rb9
-rwxr-xr-xtool/mkconfig.rb4
-rw-r--r--version.h2
4 files changed, 6 insertions, 13 deletions
diff --git a/test/mkmf/test_config.rb b/test/mkmf/test_config.rb
index 3878db1964..93ebe3a4ea 100644
--- a/test/mkmf/test_config.rb
+++ b/test/mkmf/test_config.rb
@@ -7,9 +7,9 @@ require 'mkmf'
class TestMkmfConfig < Test::Unit::TestCase
def test_dir_config
bug8074 = '[Bug #8074]'
- lib = RbConfig.expand(RbConfig::MAKEFILE_CONFIG["libdir"], "exec_prefix"=>"")
+ lib = RbConfig.expand(RbConfig::MAKEFILE_CONFIG["libdir"], "exec_prefix"=>"/test/foo")
assert_separately %w[-rmkmf - -- --with-foo-dir=/test/foo], %{
- assert_equal(%w[/test/foo/include /test/foo#{lib}], dir_config("foo"), #{bug8074.dump})
+ assert_equal(%w[/test/foo/include #{lib}], dir_config("foo"), #{bug8074.dump})
}
end
end
diff --git a/test/test_rbconfig.rb b/test/test_rbconfig.rb
index fcbbbd8500..1bbf01b9a6 100644
--- a/test/test_rbconfig.rb
+++ b/test/test_rbconfig.rb
@@ -51,13 +51,4 @@ class TestRbConfig < Test::Unit::TestCase
assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}")
end
end
-
- if /darwin/ =~ RUBY_PLATFORM
- def test_sdkroot
- assert_separately([{"SDKROOT" => "$(prefix)/SDKRoot"}], "#{<<~"begin;"}\n#{<<~'end;'}")
- begin;
- assert_equal RbConfig::CONFIG["prefix"]+"/SDKRoot", RbConfig::CONFIG["SDKROOT"]
- end;
- end
- end
end
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 6e23af5185..41bee02247 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -268,7 +268,7 @@ EOS
print <<EOS if $unicode_emoji_version
CONFIG["UNICODE_EMOJI_VERSION"] = #{$unicode_emoji_version.dump}
EOS
-print <<EOS if /darwin/ =~ arch
+print prefix.start_with?("/System/") ? <<EOS : <<EOS if /darwin/ =~ arch
if sdkroot = ENV["SDKROOT"]
sdkroot = sdkroot.dup
elsif File.exist?(File.join(CONFIG["prefix"], "include")) ||
@@ -279,6 +279,8 @@ print <<EOS if /darwin/ =~ arch
end
CONFIG["SDKROOT"] = sdkroot
EOS
+ CONFIG["SDKROOT"] = ""
+EOS
print <<EOS
CONFIG["platform"] = #{platform || '"$(arch)"'}
CONFIG["archdir"] = "$(rubyarchdir)"
diff --git a/version.h b/version.h
index c601685980..b5bbcf46d5 100644
--- a/version.h
+++ b/version.h
@@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 4
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 203
+#define RUBY_PATCHLEVEL 204
#define RUBY_RELEASE_YEAR 2023
#define RUBY_RELEASE_MONTH 3