* enc/depend (ENCOBJS): add dependencies.
* enc/make_encmake.rb (target_encodings): extract dependencies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-05-21 03:11:28 +00:00
Родитель 52f0c6780e
Коммит fb2e6803b0
3 изменённых файлов: 36 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Mon May 21 12:11:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/depend (ENCOBJS): add dependencies.
* enc/make_encmake.rb (target_encodings): extract dependencies.
Mon May 21 11:26:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
* lib/net/ftp.rb (Net::FTP#transfercmd): rescue shutdown.

Просмотреть файл

@ -84,6 +84,9 @@ srcs: $(TRANSCSRCS)
% unless ENCS.empty?
$(ENCOBJS): regenc.h oniguruma.h config.h defines.h
% end
% ENC_DEPS.each do |e, deps|
enc/<%=e%>.$(OBJEXT): <%=deps.map {|n| rule_subst % n}.join(' ')%>
% end
% unless TRANS.empty?
$(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.h st.h transcode_data.h
% end

Просмотреть файл

@ -48,8 +48,32 @@ def target_encodings
encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty?
encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
encs = encs.sort_by(&ALPHANUMERIC_ORDER)
encs.unshift(encs.delete("encdb"))
return encs
deps = Hash.new {[]}
inc_srcs = Hash.new {[]}
default_deps = %w[regenc.h oniguruma.h config.h defines.h]
db = encs.delete("encdb")
encs.each do |e|
File.foreach("#$srcdir/#{e}.c") do |l|
if /^\s*#\s*include\s+(?:"([^\"]+)"|<(ruby\/\sw+.h)>)/ =~ l
n = $1 || $2
if /\.c$/ =~ n
inc_srcs[e] <<= $`
n = "enc/#{n}"
end
deps[e] <<= n unless default_deps.include?(n)
end
end
end
class << inc_srcs; self; end.class_eval do
define_method(:expand) do |d|
d.map {|n| deps[n] | self.expand(self[n])}.flatten
end
end
inc_srcs.each do |e, d|
deps[e].concat(inc_srcs.expand(d))
end
encs.unshift(db)
return encs, deps
end
def target_transcoders
@ -79,7 +103,7 @@ end
# Constants that "depend" needs.
MODULE_TYPE = module_type
ENCS = target_encodings
ENCS, ENC_DEPS = target_encodings
ATRANS, TRANS = target_transcoders
if File.exist?(depend = File.join($srcdir, "depend"))