* 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
This commit is contained in:
parent
aa347ba042
commit
c2c6687ddb
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 20 23:22:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/extmk.rb (extract_makefile, extmake): regenerate makefiels
|
||||||
|
if globbed source file list is changed.
|
||||||
|
|
||||||
|
* lib/mkmf.rb (create_makefile): store ORIG_SRCS.
|
||||||
|
|
||||||
Sun Nov 20 22:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
Sun Nov 20 22:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
|
* enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
|
||||||
|
@ -73,6 +73,11 @@ def extract_makefile(makefile, keep = true)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
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
|
$target = target
|
||||||
$extconf_h = m[/^RUBY_EXTCONF_H[ \t]*=[ \t]*(\S+)/, 1]
|
$extconf_h = m[/^RUBY_EXTCONF_H[ \t]*=[ \t]*(\S+)/, 1]
|
||||||
if $static.nil?
|
if $static.nil?
|
||||||
@ -152,7 +157,7 @@ def extmake(target)
|
|||||||
old_objs = $objs
|
old_objs = $objs
|
||||||
old_cleanfiles = $distcleanfiles
|
old_cleanfiles = $distcleanfiles
|
||||||
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
|
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)) ||
|
!(t = modified?(makefile, MTIMES)) ||
|
||||||
[conf, "#{$srcdir}/depend"].any? {|f| modified?(f, [t])})
|
[conf, "#{$srcdir}/depend"].any? {|f| modified?(f, [t])})
|
||||||
then
|
then
|
||||||
|
@ -1924,8 +1924,9 @@ def create_makefile(target, srcprefix = nil)
|
|||||||
RbConfig.expand(srcdir = srcprefix.dup)
|
RbConfig.expand(srcdir = srcprefix.dup)
|
||||||
|
|
||||||
ext = ".#{$OBJEXT}"
|
ext = ".#{$OBJEXT}"
|
||||||
|
orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
|
||||||
if not $objs
|
if not $objs
|
||||||
srcs = $srcs || Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
|
srcs = $srcs || orig_srcs
|
||||||
objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
|
objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
|
||||||
$objs = objs.keys
|
$objs = objs.keys
|
||||||
unless objs.delete_if {|b, f| f.size == 1}.empty?
|
unless objs.delete_if {|b, f| f.size == 1}.empty?
|
||||||
@ -1990,7 +1991,8 @@ extout_prefix = #{$extout_prefix}
|
|||||||
target_prefix = #{target_prefix}
|
target_prefix = #{target_prefix}
|
||||||
LOCAL_LIBS = #{$LOCAL_LIBS}
|
LOCAL_LIBS = #{$LOCAL_LIBS}
|
||||||
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
|
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
|
||||||
SRCS = #{srcs.collect(&File.method(:basename)).join(' ')}
|
ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
|
||||||
|
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
|
||||||
OBJS = #{$objs.join(" ")}
|
OBJS = #{$objs.join(" ")}
|
||||||
TARGET = #{target}
|
TARGET = #{target}
|
||||||
DLLIB = #{dllib}
|
DLLIB = #{dllib}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user