From eca5e5c59d474e0b5f0515885125ff874aa2b520 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 5 Feb 2026 11:17:52 +0900 Subject: Bypass the conversion of drive letter in `with_destdir` --- spec/ruby/optional/capi/spec_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'spec/ruby') 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 -- cgit v1.2.3