diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/extmk.rb | 9 | ||||
-rw-r--r-- | lib/mkmf.rb | 5 |
3 files changed, 11 insertions, 8 deletions
@@ -1,3 +1,8 @@ +Tue Mar 3 16:25:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/extmk.rb (extmake), lib/mkmf.rb (create_makefile): $objs and + $srcs are always Array or nil now. + Tue Mar 3 15:54:11 2009 NAKAMURA Usaku <usa@ruby-lang.org> * ext/dl/win32/lib/win32/{registry,resolv}.rb: use dl/import instead diff --git a/ext/extmk.rb b/ext/extmk.rb index ddbe495179..509c93e46f 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -105,8 +105,8 @@ def extmake(target) $mdir = target $srcdir = File.join($top_srcdir, "ext", $mdir) $preload = nil - $objs = "" - $srcs = "" + $objs = [] + $srcs = [] $compiled[target] = false makefile = "./Makefile" ok = File.exist?(makefile) @@ -137,9 +137,8 @@ def extmake(target) } begin $extconf_h = nil - $objs = [] ok &&= extract_makefile(makefile) - old_objs = $objs + old_objs = $objs conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)} if (($extconf_h && !File.exist?($extconf_h)) || !(t = modified?(makefile, MTIMES)) || @@ -180,7 +179,7 @@ def extmake(target) args += ["static"] unless $clean $extlist.push [$static, $target, File.basename($target), $preload] end - FileUtils.rm_f($objs.split - old_objs) + FileUtils.rm_f($objs - old_objs) unless system($make, *args) $ignore or $continue or return false end diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 8af18379e1..1afce2ae65 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1591,9 +1591,8 @@ def create_makefile(target, srcprefix = nil) for i in $objs i.sub!(/\.o\z/, ".#{$OBJEXT}") end - $objs = $objs.join(" ") - target = nil if $objs == "" + target = nil if $objs.empty? if target and EXPORT_PREFIX if File.exist?(File.join(srcdir, target + '.def')) @@ -1642,7 +1641,7 @@ target_prefix = #{target_prefix} LOCAL_LIBS = #{$LOCAL_LIBS} LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} SRCS = #{srcs.collect(&File.method(:basename)).join(' ')} -OBJS = #{$objs} +OBJS = #{$objs.join(" ")} TARGET = #{target} DLLIB = #{dllib} EXTSTATIC = #{$static || ""} |