summaryrefslogtreecommitdiff
path: root/tool/mkconfig.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-10 21:19:58 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-31 06:33:16 +0900
commit3a7367ccc319499127ead147e5a08f769e44208e (patch)
treec76dd64b1da7c6725a79189259d9944259ddfd5f /tool/mkconfig.rb
parent344c16eba40457f937c6558299f52bc97d6f3ce7 (diff)
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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7197
Diffstat (limited to 'tool/mkconfig.rb')
-rwxr-xr-xtool/mkconfig.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 29a70287d0..7a447fb234 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -278,7 +278,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")) ||
@@ -289,6 +289,8 @@ print <<EOS if /darwin/ =~ arch
end
CONFIG["SDKROOT"] = sdkroot
EOS
+ CONFIG["SDKROOT"] = ""
+EOS
print <<EOS
CONFIG["platform"] = #{platform || '"$(arch)"'}
CONFIG["archdir"] = "$(rubyarchdir)"