1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Retrieve configured gems info

This commit is contained in:
Nobuyoshi Nakada 2022-04-06 20:25:53 +09:00
parent db3d111c1d
commit 17ce0b9b84
Notes: git 2022-04-07 09:47:32 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ SCRIPT_ARGS = <%=script_args.gsub("#", "\\#")%>
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \ EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
--make-flags="MINIRUBY='$(MINIRUBY)'" --make-flags="MINIRUBY='$(MINIRUBY)'"
all: exts # gems all: exts gems
exts: exts:
gems: gems:

View file

@ -19,7 +19,7 @@ opt = OptionParser.new do |o|
o.on('--configure-exts=FILE') {|v| confexts = v} o.on('--configure-exts=FILE') {|v| confexts = v}
o.order!(ARGV) o.order!(ARGV)
end end
confexts &&= File.read(confexts).scan(/^exts: (.*\.mk)/).flatten rescue nil confexts &&= File.read(confexts).scan(/^(?:ext|gem)s: (.*\.mk)/).flatten rescue nil
confexts ||= [] confexts ||= []
macros["old_extensions"] = [] macros["old_extensions"] = []
@ -30,7 +30,7 @@ Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v| s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v|
v.gsub!(/\\\n[ \t]*/, ' ') v.gsub!(/\\\n[ \t]*/, ' ')
next if v.empty? next if v.empty?
next if gem and n != "extensions" next if n != "extensions"
n = "old_extensions" if n == "extensions" and !confexts.include?(e) n = "old_extensions" if n == "extensions" and !confexts.include?(e)
v = v.split v = v.split
m = macros[n] ||= [] m = macros[n] ||= []