diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-20 14:22:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-20 14:22:44 +0000 |
commit | c2c6687ddb5b8531ac71f816c3b769ea68cb154a (patch) | |
tree | 5a4c2d49a8779e7ec97d7aa62eabac6077eee7af /ext/extmk.rb | |
parent | aa347ba042d6a1adf27d9ef139be9436634b9ce8 (diff) | |
download | ruby-c2c6687ddb5b8531ac71f816c3b769ea68cb154a.tar.gz |
* 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
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-x | ext/extmk.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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 |