mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
3 changed files with 17 additions and 3 deletions
|
@ -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>
|
||||
|
||||
* enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1924,8 +1924,9 @@ def create_makefile(target, srcprefix = nil)
|
|||
RbConfig.expand(srcdir = srcprefix.dup)
|
||||
|
||||
ext = ".#{$OBJEXT}"
|
||||
orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
|
||||
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 = objs.keys
|
||||
unless objs.delete_if {|b, f| f.size == 1}.empty?
|
||||
|
@ -1990,7 +1991,8 @@ extout_prefix = #{$extout_prefix}
|
|||
target_prefix = #{target_prefix}
|
||||
LOCAL_LIBS = #{$LOCAL_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(" ")}
|
||||
TARGET = #{target}
|
||||
DLLIB = #{dllib}
|
||||
|
|
Loading…
Reference in a new issue