Skip to content

Commit eca5e5c

Browse files
committed
Bypass the conversion of drive letter in with_destdir
1 parent 103517d commit eca5e5c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/ruby/optional/capi/spec_helper.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def compile_extension(name)
8989
$ruby = ENV.values_at('RUBY_EXE', 'RUBY_FLAGS').join(' ')
9090
# MRI magic to consider building non-bundled extensions
9191
$extout = nil
92+
if RbConfig::CONFIG.key?("buildlibdir") # The top directory where the libruby is built.
93+
# Prepend the dummy macro to bypass the conversion in `with_destdir` on DOSISH
94+
# platforms, where the drive letter is replaced with `$(DESTDIR)`. `DESTDIR` is
95+
# overridden by the command line argument bellow.
96+
RbConfig::MAKEFILE_CONFIG["buildlibdir"] = "$(empty)" + RbConfig::CONFIG["buildlibdir"]
97+
end
9298
append_cflags '-Wno-declaration-after-statement'
9399
#{"append_cflags #{ruby_repository_extra_include_dir.inspect}" if ruby_repository_extra_include_dir}
94100
create_makefile(#{ext.inspect})
@@ -117,7 +123,7 @@ def compile_extension(name)
117123
def setup_make
118124
make = ENV['MAKE']
119125
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
120-
env = %w[MFLAGS MAKEFLAGS GNUMAKEFLAGS].to_h {|var| [env, ENV[var]]}
126+
env = %w[MFLAGS MAKEFLAGS GNUMAKEFLAGS].to_h {|var| [var, ENV[var]]}
121127
make_flags = env["MAKEFLAGS"] || ''
122128

123129
# suppress logo of nmake.exe to stderr

0 commit comments

Comments
 (0)