summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-02-05 11:17:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-02-05 13:12:24 +0900
commiteca5e5c59d474e0b5f0515885125ff874aa2b520 (patch)
treefe06e8516380c2344d5367d0de73a986644c80b5
parent103517d97e8267985304ca66c7630c424a69f1e3 (diff)
Bypass the conversion of drive letter in `with_destdir`
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/spec_helper.rb b/spec/ruby/optional/capi/spec_helper.rb
index 7b4027b21e..49ce23d874 100644
--- a/spec/ruby/optional/capi/spec_helper.rb
+++ b/spec/ruby/optional/capi/spec_helper.rb
@@ -89,6 +89,12 @@ def compile_extension(name)
$ruby = ENV.values_at('RUBY_EXE', 'RUBY_FLAGS').join(' ')
# MRI magic to consider building non-bundled extensions
$extout = nil
+ if RbConfig::CONFIG.key?("buildlibdir") # The top directory where the libruby is built.
+ # Prepend the dummy macro to bypass the conversion in `with_destdir` on DOSISH
+ # platforms, where the drive letter is replaced with `$(DESTDIR)`. `DESTDIR` is
+ # overridden by the command line argument bellow.
+ RbConfig::MAKEFILE_CONFIG["buildlibdir"] = "$(empty)" + RbConfig::CONFIG["buildlibdir"]
+ end
append_cflags '-Wno-declaration-after-statement'
#{"append_cflags #{ruby_repository_extra_include_dir.inspect}" if ruby_repository_extra_include_dir}
create_makefile(#{ext.inspect})
@@ -117,7 +123,7 @@ end
def setup_make
make = ENV['MAKE']
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
- env = %w[MFLAGS MAKEFLAGS GNUMAKEFLAGS].to_h {|var| [env, ENV[var]]}
+ env = %w[MFLAGS MAKEFLAGS GNUMAKEFLAGS].to_h {|var| [var, ENV[var]]}
make_flags = env["MAKEFLAGS"] || ''
# suppress logo of nmake.exe to stderr