summaryrefslogtreecommitdiffstats
path: root/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-05 05:26:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-05 05:26:22 +0000
commitea4d43f266b9a8fa4f93cc6f505b43bc14d8781d (patch)
tree9b72143ea3e9a20630fa60684624152932fe5618 /mkconfig.rb
parent5b865f39d788dbbdbb19562009b9e23b7c24e8bc (diff)
downloadruby-ea4d43f266b9a8fa4f93cc6f505b43bc14d8781d.tar.gz
ruby-ea4d43f266b9a8fa4f93cc6f505b43bc14d8781d.tar.xz
ruby-ea4d43f266b9a8fa4f93cc6f505b43bc14d8781d.zip
* configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
* mkconfig.rb (prefix): uses ruby_version in config.status. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mkconfig.rb')
-rwxr-xr-xmkconfig.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/mkconfig.rb b/mkconfig.rb
index c27c21055..fb608137e 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"