From 9588319e72a110fc303482d64cc073292d707a33 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 9 Nov 2024 20:37:40 +0900 Subject: [PATCH] [Bug #20800] Use config target for bin directory as-is The "target" in `RbConfig::CONFIG` is being changed from config.sub to align to the system `uname`. Use the value modified by config.sub, and make the directory same as GNU utilities, such as binutils. --- configure.ac | 1 + tool/rbinstall.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9a35d4eda3..8b803ef1f4 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,7 @@ dnl checks for alternative programs AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET +AC_SUBST(config_target, $target) AS_CASE(["$target_cpu-$target_os"], [aarch64-darwin*], [ target_cpu=arm64 diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index c550a9485f..d6feac2cb8 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -367,7 +367,7 @@ goruby_install_name = "go" + ruby_install_name bindir = CONFIG["bindir", true] if CONFIG["libdirname"] == "archlibdir" - archbindir = bindir.sub(%r[/\K(?=[^/]+\z)]) {CONFIG["target"] + "/"} + archbindir = bindir.sub(%r[/\K(?=[^/]+\z)]) {CONFIG["config_target"] + "/"} end libdir = CONFIG[CONFIG.fetch("libdirname", "libdir"), true] rubyhdrdir = CONFIG["rubyhdrdir", true]