* ext/extmk.rb (extract_makefile): default to true if not compiled

previously.

* ext/extmk.rb (extmake): create dummy makefile if extconf failed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-02-10 03:09:27 +00:00
parent 80f4330973
commit 0bb45af103
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,10 @@
Thu Feb 10 12:09:16 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extract_makefile): default to true if not compiled
previously.
* ext/extmk.rb (extmake): create dummy makefile if extconf failed.
Thu Feb 10 12:07:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Feb 10 12:07:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (init_stdhandle): assign standard file handles. * win32/win32.c (init_stdhandle): assign standard file handles.

View File

@ -45,21 +45,20 @@ def relative_from(path, base)
end end
end end
def extract_makefile(makefile, force = false) def extract_makefile(makefile, keep = true)
m = File.read(makefile) m = File.read(makefile)
if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1]) if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
return force return keep
end end
installrb = {} installrb = {}
m.scan(/^install-rb-default:[ \t]*(\S+)\n\1:[ \t]*(\S+)/) {installrb[$2] = $1} m.scan(/^install-rb-default:[ \t]*(\S+)\n\1:[ \t]*(\S+)/) {installrb[$2] = $1}
oldrb = installrb.keys.sort oldrb = installrb.keys.sort
newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort
unless (oldrb -= newrb).empty?
FileUtils.rm_f(oldrb.collect {|old| Config.expand(installrb[old])}, :verbose => true)
return false
end
if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1] if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
target = "#{target_prefix}/#{target}" target = "#{target_prefix}/#{target}"
unless (oldrb -= newrb).empty?
return false
end
end end
$target = target $target = target
/^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil /^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil
@ -113,6 +112,7 @@ def extmake(target)
!(t = modified?(makefile, MTIMES)) || !(t = modified?(makefile, MTIMES)) ||
%W"#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb #{$srcdir}/depend".any? {|f| modified?(f, [t])}) %W"#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb #{$srcdir}/depend".any? {|f| modified?(f, [t])})
then then
ok = false
init_mkmf init_mkmf
Logging::logfile 'mkmf.log' Logging::logfile 'mkmf.log'
rm_f makefile rm_f makefile