2000-08-03 13:55:54 +04:00
|
|
|
#!./miniruby -ps
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
CONFIG = {}
|
|
|
|
|
2001-05-31 08:40:37 +04:00
|
|
|
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) do
|
2000-08-03 13:55:54 +04:00
|
|
|
# overridden if config.status has version
|
|
|
|
CONFIG['MAJOR'] = $1
|
|
|
|
CONFIG['MINOR'] = $2
|
|
|
|
CONFIG['TEENY'] = $3
|
|
|
|
end
|
|
|
|
|
2000-12-28 08:00:47 +03:00
|
|
|
File.foreach($config || "config.status") do |line|
|
|
|
|
next if /^#/ =~ line
|
2002-03-18 12:24:39 +03:00
|
|
|
if /^s[%,]@(\w+)@[%,](.*)[%,]g/ =~ line
|
2000-08-03 13:55:54 +04:00
|
|
|
name = $1
|
|
|
|
val = $2 || ""
|
|
|
|
next if /^(INSTALL|DEFS|configure_input|srcdir)$/ =~ name
|
|
|
|
val.gsub!(/\$\{([^{}]+)\}/) { "$(#{$1})" }
|
|
|
|
CONFIG[name] = val
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
CONFIG['top_srcdir'] = File.expand_path($srcdir || ".")
|
|
|
|
CONFIG['RUBY_INSTALL_NAME'] = $install_name if $install_name
|
|
|
|
CONFIG['RUBY_SO_NAME'] = $so_name if $so_name
|
|
|
|
$defout = open($output, 'w') if $output
|
|
|
|
}
|
|
|
|
|
|
|
|
gsub!(/@(\w+)@/) {CONFIG[$1] || $&}
|
|
|
|
|
|
|
|
# vi:set sw=2:
|