8000 [Bug #21092] Fallback variables after execonf has done · github/ruby@2b6fc9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b6fc9e

Browse files
committed
[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.
1 parent 8f77e69 commit 2b6fc9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/extmk.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ def extmake(target, basedir = 'ext', maybestatic = true)
173173
$mdir = target
174174
$srcdir = File.join($top_srcdir, basedir, $mdir)
175175
$preload = nil
176-
$objs = []
177-
$srcs = []
178176
$extso = []
179177
makefile = "./Makefile"
180178
static = $static
@@ -208,7 +206,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
208206
begin
209207
$extconf_h = nil
210208
ok &&= extract_makefile(makefile)
211-
old_objs = $objs
209+
old_objs = $objs || []
212210
old_cleanfiles = $distcleanfiles | $cleanfiles
213211
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
214212
if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
@@ -271,6 +269,8 @@ def extmake(target, basedir = 'ext', maybestatic = true)
271269
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
272270
args += ["DESTDIR=" + relative_from($destdir, "../"+prefix)]
273271
end
272+
$objs ||= []
273+
$srcs ||= []
274274
if $static and ok and !$objs.empty? and !noinstall
275275
args += ["static"]
276276
$extlist.push [(maybestatic ? $static : false), target, $target, $preload]

0 commit comments

Comments
 (0)
0