From ee8f40b5a62a15298c668b57b3504e177289972c Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 6 Aug 2007 04:00:09 +0000 Subject: [PATCH] * 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 --- ChangeLog | 7 +++++++ common.mk | 2 +- lib/vm/instruction.rb | 20 ++++++++++++++------ version.h | 6 +++--- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85338f5141..23ba9bb945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Aug 6 13:00:07 2007 Nobuyoshi Nakada + + * common.mk (INSNS): not chdir to srcdir. + + * lib/vm/instruction.rb (RubyVM::SourceCodeGenerator): --destdir + option. + Sun Aug 5 11:51:39 2007 Kouhei Sutou * lib/rss, sample/rss, test/rss: diff --git a/common.mk b/common.mk index 86dc9a0eb8..d085d1a93f 100644 --- a/common.mk +++ b/common.mk @@ -593,7 +593,7 @@ INSNS2VMOPT = --srcdir="$(srcdir)" $(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h $(RM) $(PROGRAM) - $(BASERUBY) -C $(srcdir) tool/insns2vm.rb $(INSNS2VMOPT) + $(BASERUBY) $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) minsns.inc: $(srcdir)/template/minsns.inc.tmpl diff --git a/lib/vm/instruction.rb b/lib/vm/instruction.rb index 20c0fb41da..ed59af0faa 100644 --- a/lib/vm/instruction.rb +++ b/lib/vm/instruction.rb @@ -97,6 +97,7 @@ module RubyVM @vpath = opts[:VPATH] || File @use_const = opts[:use_const] @verbose = opts[:verbose] + @destdir = opts[:destdir] (@vm_opts = load_vm_opts).each {|k, v| @vm_opts[k] = opts[k] if opts.key?(k) @@ -110,6 +111,7 @@ module RubyVM end attr_reader :vpath + attr_reader :destdir %w[use_const verbose].each do |attr| attr_reader attr @@ -252,11 +254,7 @@ module RubyVM insn_in = true body = '' - if /\/\/(.+)/ =~ rets_str - sp_inc = $1 - else - sp_inc = nil - end + sp_inc = rets_str[%r"//\s*(.+)", 1] raise unless /^\{$/ =~ f.gets.chomp line_no = f.line_no @@ -639,6 +637,12 @@ module RubyVM def use_const? @insns.use_const? end + + def output_path(fn) + d = @insns.destdir + fn = File.join(d, fn) if d + fn + end end ################################################################### @@ -1269,7 +1273,7 @@ module RubyVM args = Files.keys if args.empty? args.each{|fn| s = Files[fn].new(@insns).generate - open(fn, 'w') {|f| f.puts(s)} + open(output_path(fn), 'w') {|f| f.puts(s)} } end @@ -1310,6 +1314,10 @@ module RubyVM "use consts for default operands instead of macros") {|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| opts[:verbose] = v } diff --git a/version.h b/version.h index 4f3869062c..8573dac5ae 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #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_RELEASE_CODE 20070805 +#define RUBY_RELEASE_CODE 20070806 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 8 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_DAY 6 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];