Skip to content

Commit

Permalink
[Bug #21092] Fallback variables after execonf has done
Browse files Browse the repository at this point in the history
When reading from a dummy makefile, the global variables initialized
in `init_mkmf` may not be overridden.
  • Loading branch information
nobu committed Jan 30, 2025
1 parent 8f77e69 commit 2b6fc9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/extmk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -208,7 +206,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
begin
$extconf_h = nil
ok &&= extract_makefile(makefile)
old_objs = $objs
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)) ||
Expand Down Expand Up @@ -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
$objs ||= []
$srcs ||= []
if $static and ok and !$objs.empty? and !noinstall
args += ["static"]
$extlist.push [(maybestatic ? $static : false), target, $target, $preload]
Expand Down

0 comments on commit 2b6fc9e

Please sign in to comment.