diff options
Diffstat (limited to 'mkconfig.rb')
-rwxr-xr-x | mkconfig.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mkconfig.rb b/mkconfig.rb index 255bfa7436..f662c825e3 100755 --- a/mkconfig.rb +++ b/mkconfig.rb @@ -37,6 +37,7 @@ v_fast = [] v_others = [] vars = {} has_version = false +has_patchlevel = false continued_name = nil continued_line = nil File.foreach "config.status" do |line| @@ -95,7 +96,12 @@ File.foreach "config.status" do |line| else v_others << v end - has_version = true if name == "MAJOR" + case name + when "MAJOR" + has_version = true + when "PATCHLEVEL" + has_patchlevel = true + end end # break if /^CEOF/ end @@ -114,6 +120,8 @@ unless has_version print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n" print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n" } +end +unless has_patchlevel patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l| m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(\d+)/.match(l) and break m[1] } |