summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-01-30 14:23:12 +0900
committerNobuyoshi Nakada <[email protected]>2025-01-30 14:52:01 +0900
commit2b6fc9ea7212543a1be26768403f59c7a759b5ea ()
tree9df3b9da06298f529974a2508b31bfa23896aa71 /ext/extmk.rb
parent8f77e694f999d4ccc344a5f4f4538a928705989f (diff)
[Bug #21092] Fallback variables after execonf has done
When reading from a dummy makefile, the global variables initialized in `init_mkmf` may not be overridden.
Notes: Merged: https://.com/ruby/ruby/pull/12673
-rwxr-xr-xext/extmk.rb6
1 files changed, 3 insertions, 3 deletions
@@ -173,8 +173,6 @@ def extmake(target, basedir = 'ext', maybestatic = true)
$mdir = target
$srcdir = File.join($top_srcdir, basedir, $mdir)
$preload = nil
- $objs = []
- $srcs = []
$extso = []
makefile = "./Makefile"
static = $static
@@ -208,7 +206,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
begin
$extconf_h = nil
ok &&= extract_makefile(makefile)
- old_objs = $objs
old_cleanfiles = $distcleanfiles | $cleanfiles
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
@@ -271,6 +269,8 @@ def extmake(target, basedir = 'ext', maybestatic = true)
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
args += ["DESTDIR=" + relative_from($destdir, "../"+prefix)]
end
if $static and ok and !$objs.empty? and !noinstall
args += ["static"]
$extlist.push [(maybestatic ? $static : false), target, $target, $preload]