summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-30 03:06:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-30 03:06:08 +0000
commitf366a687c97b75aa3437a7eb0d956442bd21c4b4 (patch)
treeb95fa8aa18d7f8c4fcce32ee07df9808d36f661a
parent4d0ec108afbf565ac7b4c0c92b65da4e6827ae3f (diff)
* mkconfig.rb: autoconf 2.61 support. [ruby-core:10016]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rwxr-xr-xmkconfig.rb35
2 files changed, 35 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d5efe21723..ba931add63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jan 30 12:05:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * mkconfig.rb: autoconf 2.61 support. [ruby-core:10016]
+
Sat Jan 27 15:20:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (dyna_var_lookup): should not alter dvar->val not to
diff --git a/mkconfig.rb b/mkconfig.rb
index e605db7ddf..ce1c8a7465 100755
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -36,11 +36,38 @@ v_fast = []
v_others = []
vars = {}
has_version = false
+continued_name = nil
+continued_line = nil
File.foreach "config.status" do |line|
next if /^#/ =~ line
- if /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/ =~ line
+ name = nil
+ case line
+ when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
name = $2
val = $3.gsub(/\\(?=,)/, '')
+ when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
+ name = $1
+ val = $2
+ if $3
+ continued_line = []
+ continued_line << val
+ continued_name = name
+ next
+ end
+ when /^"(.+)"\s*(\\)?$/
+ if continued_line
+ continued_line << $1
+ unless $2
+ val = continued_line.join("")
+ name = continued_name
+ continued_line = nil
+ end
+ end
+ when /^(?:ac_given_)?INSTALL=(.*)/
+ v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
+ end
+
+ if name
next if /^(?:ac_.*|DEFS|configure_input|(?:top_)?srcdir|\w+OBJS)$/ =~ name
next if /^\$\(ac_\w+\)$/ =~ val
next if /^\$\{ac_\w+\}$/ =~ val
@@ -54,6 +81,7 @@ File.foreach "config.status" do |line|
name = "ruby_install_name"
val = "ruby".sub(/#{ptn[0]}/, ptn[1])
end
+ val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
if /^prefix$/ =~ name
val = "(TOPDIR || DESTDIR + #{val})"
@@ -66,8 +94,6 @@ File.foreach "config.status" do |line|
v_others << v
end
has_version = true if name == "MAJOR"
- elsif /^(?:ac_given_)?INSTALL=(.*)/ =~ line
- v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
end
# break if /^CEOF/
end
@@ -105,7 +131,8 @@ if $so_name
v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
end
-print v_fast, v_others
+print(*v_fast)
+print(*v_others)
print <<EOS
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"