mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
extract version from version.h
* tool/mkconfig.rb: extract version numbers from version.h but not from API version in include/ruby/version.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1fbfa7180b
commit
d58e799d41
1 changed files with 7 additions and 7 deletions
|
@ -196,16 +196,16 @@ print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
|||
versions = {}
|
||||
IO.foreach(File.join(srcdir, "version.h")) do |l|
|
||||
m = /^\s*#\s*define\s+RUBY_(PATCHLEVEL)\s+(-?\d+)/.match(l)
|
||||
if m
|
||||
versions[m[1]] = m[2]
|
||||
break
|
||||
end
|
||||
end
|
||||
IO.foreach(File.join(srcdir, "include/ruby/version.h")) do |l|
|
||||
m = /^\s*#\s*define\s+RUBY_API_VERSION_(MAJOR|MINOR|TEENY)\s+(-?\d+)/.match(l)
|
||||
if m
|
||||
versions[m[1]] = m[2]
|
||||
break if versions.size == 4
|
||||
next
|
||||
end
|
||||
m = /^\s*#\s*define\s+RUBY_VERSION\s+\W?([.\d]+)/.match(l)
|
||||
if m
|
||||
versions['MAJOR'], versions['MINOR'], versions['TEENY'] = m[1].split('.')
|
||||
break if versions.size == 4
|
||||
next
|
||||
end
|
||||
end
|
||||
%w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|
|
||||
|
|
Loading…
Reference in a new issue