mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Read GNUmakefile when the build directory has no Makefile
`configure.bat --with-gnu-make` writes only `GNUmakefile`. The tests under `test/mkmf` failed to load with `Errno::ENOENT`, and `spec/default.mspec` lost `srcdir` and ran specs without `tool/runruby.rb`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bae2f78378
commit
2bd5b04e60
2 files changed
+5
-2
Notes:
git
2026-10-14 23:01:07 +00:00
No files matched your search
+2
-1
@@ -22,7 +22,8 @@ class MSpecScript
|
||||
|
||||
builddir = Dir.pwd
|
||||
srcdir = ENV['SRCDIR']
|
||||
srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil
|
||||
makefile = File.exist?("Makefile") ? "Makefile" : "GNUmakefile"
|
||||
srcdir ||= File.read(makefile, encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil
|
||||
config = RbConfig::CONFIG
|
||||
|
||||
# The default implementation to run the specs.
|
||||
|
||||
+3
-1
@@ -2,7 +2,9 @@
|
||||
$extmk = true
|
||||
require 'rbconfig'
|
||||
RbConfig.fire_update!("top_srcdir", File.expand_path("../..", __dir__))
|
||||
File.foreach(RbConfig::CONFIG["topdir"]+"/Makefile") do |line|
|
||||
makefile = RbConfig::CONFIG["topdir"]+"/Makefile"
|
||||
makefile = RbConfig::CONFIG["topdir"]+"/GNUmakefile" unless File.exist?(makefile)
|
||||
File.foreach(makefile) do |line|
|
||||
if /^CC_WRAPPER\s*=\s*/ =~ line
|
||||
RbConfig.fire_update!('CC_WRAPPER', $'.strip)
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user