mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* mkconfig.rb (MAJOR, MINOR, TEENY): reads from version.h always.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
22a3520dee
commit
e5ffb6df0f
2 changed files with 13 additions and 17 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Mar 25 07:44:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* mkconfig.rb (MAJOR, MINOR, TEENY): reads from version.h always.
|
||||||
|
|
||||||
Tue Mar 24 19:23:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Mar 24 19:23:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (RUBY_CHECK_SIZEOF): need to include $4.
|
* configure.in (RUBY_CHECK_SIZEOF): need to include $4.
|
||||||
|
|
26
mkconfig.rb
26
mkconfig.rb
|
@ -37,8 +37,6 @@ module RbConfig
|
||||||
v_fast = []
|
v_fast = []
|
||||||
v_others = []
|
v_others = []
|
||||||
vars = {}
|
vars = {}
|
||||||
has_version = false
|
|
||||||
has_patchlevel = false
|
|
||||||
continued_name = nil
|
continued_name = nil
|
||||||
continued_line = nil
|
continued_line = nil
|
||||||
File.foreach "config.status" do |line|
|
File.foreach "config.status" do |line|
|
||||||
|
@ -97,10 +95,6 @@ File.foreach "config.status" do |line|
|
||||||
v_others << v
|
v_others << v
|
||||||
end
|
end
|
||||||
case name
|
case name
|
||||||
when "MAJOR"
|
|
||||||
has_version = true
|
|
||||||
when "PATCHLEVEL"
|
|
||||||
has_patchlevel = true
|
|
||||||
when "ruby_version"
|
when "ruby_version"
|
||||||
version = val[/\A"(.*)"\z/, 1]
|
version = val[/\A"(.*)"\z/, 1]
|
||||||
end
|
end
|
||||||
|
@ -116,18 +110,16 @@ print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' u
|
||||||
print " CONFIG = {}\n"
|
print " CONFIG = {}\n"
|
||||||
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
||||||
|
|
||||||
unless has_version
|
versions = {}
|
||||||
version.scan(/(\d+)\.(\d+)(?:\.(\d+))?/) {
|
IO.foreach(File.join(srcdir, "version.h")) do |l|
|
||||||
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
|
m = /^\s*#\s*define\s+RUBY_(VERSION_(MAJOR|MINOR|TEENY)|PATCHLEVEL)\s+(-?\d+)/.match(l)
|
||||||
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
|
if m
|
||||||
print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
|
versions[m[2]||m[1]] = m[3]
|
||||||
}
|
break if versions.size == 4
|
||||||
|
end
|
||||||
end
|
end
|
||||||
unless has_patchlevel
|
%w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|
|
||||||
patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l|
|
print " CONFIG[#{v.dump}] = #{versions[v].dump}\n"
|
||||||
m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(-?\d+)/.match(l) and break m[1]
|
|
||||||
}
|
|
||||||
print " CONFIG[\"PATCHLEVEL\"] = \"#{patchlevel}\"\n"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
|
dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
|
||||||
|
|
Loading…
Reference in a new issue