diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-05 05:26:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-05 05:26:22 +0000 |
commit | 1fbd605da88c62a3a4d31ea3baf687ba9128e722 (patch) | |
tree | 9b72143ea3e9a20630fa60684624152932fe5618 /mkconfig.rb | |
parent | a2c7fdc70939e9c8a57a560aec786f3a7303f378 (diff) |
* configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
* mkconfig.rb (prefix): uses ruby_version in config.status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mkconfig.rb')
-rwxr-xr-x | mkconfig.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mkconfig.rb b/mkconfig.rb index c27c210557..fb608137e5 100755 --- a/mkconfig.rb +++ b/mkconfig.rb @@ -101,6 +101,8 @@ File.foreach "config.status" do |line| has_version = true when "PATCHLEVEL" has_patchlevel = true + when "ruby_version" + version = val[/\A"(.*)"\z/, 1] end end # break if /^CEOF/ @@ -108,14 +110,14 @@ end drive = File::PATH_SEPARATOR == ';' -prefix = '/lib/ruby/' + RUBY_VERSION + '/' + RUBY_PLATFORM +prefix = "/lib/ruby/#{version}/#{RUBY_PLATFORM}" print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" print " CONFIG = {}\n" print " CONFIG[\"DESTDIR\"] = DESTDIR\n" unless has_version - RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) { + version.scan(/(\d+)\.(\d+)(?:\.(\d+))?/) { print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n" print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n" print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n" |