From c2c6687ddb5b8531ac71f816c3b769ea68cb154a Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 20 Nov 2011 14:22:44 +0000 Subject: * ext/extmk.rb (extract_makefile, extmake): regenerate makefiels if globbed source file list is changed. * lib/mkmf.rb (create_makefile): store ORIG_SRCS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/extmk.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/extmk.rb b/ext/extmk.rb index 5665a966a8..058c6db7de 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -73,6 +73,11 @@ def extract_makefile(makefile, keep = true) end return false end + srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].map {|fn| File.basename(fn)} + if !srcs.empty? + old_srcs = m[/^ORIG_SRCS[ \t]*=[ \t](.*)/, 1] or return false + old_srcs.split.sort == srcs or return false + end $target = target $extconf_h = m[/^RUBY_EXTCONF_H[ \t]*=[ \t]*(\S+)/, 1] if $static.nil? @@ -152,7 +157,7 @@ def extmake(target) old_objs = $objs old_cleanfiles = $distcleanfiles conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)} - if (($extconf_h && !File.exist?($extconf_h)) || + if (!ok || ($extconf_h && !File.exist?($extconf_h)) || !(t = modified?(makefile, MTIMES)) || [conf, "#{$srcdir}/depend"].any? {|f| modified?(f, [t])}) then -- cgit v1.2.3