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

* common.mk (INSNS): not chdir to srcdir.

* lib/vm/instruction.rb (RubyVM::SourceCodeGenerator): --destdir
  option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-08-06 04:00:09 +00:00
parent d690c9283c
commit ee8f40b5a6
4 changed files with 25 additions and 10 deletions

View file

@ -1,3 +1,10 @@
Mon Aug 6 13:00:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (INSNS): not chdir to srcdir.
* lib/vm/instruction.rb (RubyVM::SourceCodeGenerator): --destdir
option.
Sun Aug 5 11:51:39 2007 Kouhei Sutou <kou@cozmixng.org> Sun Aug 5 11:51:39 2007 Kouhei Sutou <kou@cozmixng.org>
* lib/rss, sample/rss, test/rss: * lib/rss, sample/rss, test/rss:

View file

@ -593,7 +593,7 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
$(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h $(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h
$(RM) $(PROGRAM) $(RM) $(PROGRAM)
$(BASERUBY) -C $(srcdir) tool/insns2vm.rb $(INSNS2VMOPT) $(BASERUBY) $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT)
minsns.inc: $(srcdir)/template/minsns.inc.tmpl minsns.inc: $(srcdir)/template/minsns.inc.tmpl

View file

@ -97,6 +97,7 @@ module RubyVM
@vpath = opts[:VPATH] || File @vpath = opts[:VPATH] || File
@use_const = opts[:use_const] @use_const = opts[:use_const]
@verbose = opts[:verbose] @verbose = opts[:verbose]
@destdir = opts[:destdir]
(@vm_opts = load_vm_opts).each {|k, v| (@vm_opts = load_vm_opts).each {|k, v|
@vm_opts[k] = opts[k] if opts.key?(k) @vm_opts[k] = opts[k] if opts.key?(k)
@ -110,6 +111,7 @@ module RubyVM
end end
attr_reader :vpath attr_reader :vpath
attr_reader :destdir
%w[use_const verbose].each do |attr| %w[use_const verbose].each do |attr|
attr_reader attr attr_reader attr
@ -252,11 +254,7 @@ module RubyVM
insn_in = true insn_in = true
body = '' body = ''
if /\/\/(.+)/ =~ rets_str sp_inc = rets_str[%r"//\s*(.+)", 1]
sp_inc = $1
else
sp_inc = nil
end
raise unless /^\{$/ =~ f.gets.chomp raise unless /^\{$/ =~ f.gets.chomp
line_no = f.line_no line_no = f.line_no
@ -639,6 +637,12 @@ module RubyVM
def use_const? def use_const?
@insns.use_const? @insns.use_const?
end end
def output_path(fn)
d = @insns.destdir
fn = File.join(d, fn) if d
fn
end
end end
################################################################### ###################################################################
@ -1269,7 +1273,7 @@ module RubyVM
args = Files.keys if args.empty? args = Files.keys if args.empty?
args.each{|fn| args.each{|fn|
s = Files[fn].new(@insns).generate s = Files[fn].new(@insns).generate
open(fn, 'w') {|f| f.puts(s)} open(output_path(fn), 'w') {|f| f.puts(s)}
} }
end end
@ -1310,6 +1314,10 @@ module RubyVM
"use consts for default operands instead of macros") {|v| "use consts for default operands instead of macros") {|v|
opts[:use_const] = v opts[:use_const] = v
} }
opt.on("-d", "--destdir", "--output-directory=DIR",
"make output file underneath DIR") {|v|
opts[:destdir] = v
}
opt.on("-V", "--[no-]verbose") {|v| opt.on("-V", "--[no-]verbose") {|v|
opts[:verbose] = v opts[:verbose] = v
} }

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0" #define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-08-05" #define RUBY_RELEASE_DATE "2007-08-06"
#define RUBY_VERSION_CODE 190 #define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070805 #define RUBY_RELEASE_CODE 20070806
#define RUBY_PATCHLEVEL 0 #define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0 #define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8 #define RUBY_RELEASE_MONTH 8
#define RUBY_RELEASE_DAY 5 #define RUBY_RELEASE_DAY 6
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];