summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rwxr-xr-xtool/mkconfig.rb18
2 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 91e206c61c..567a36deba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Aug 13 22:17:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb: do not make the entries related to sitedir and
+ verdordir if disabled by --without options. [ruby-core:38922]
+ [Bug #5187]
+
Sat Aug 13 17:03:22 2011 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_core.c: [ruby-core:38861]
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index a2221f0032..b707c4bd64 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -175,14 +175,22 @@ end
print " CONFIG[#{v.dump}] = #{versions[v].dump}\n"
end
-dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
+dest = drive ? %r'= "(?!\$[\(\{])(?i:[a-z]:)' : %r'= "(?!\$[\(\{])'
+v_disabled = {}
v_others.collect! do |x|
- if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"\]/ === x
+ if /^\s*CONFIG\["((?!abs_|old)[a-z]+(?:_prefix|dir))"\]/ === x
+ name = $1
+ if /= "no"$/ =~ x
+ v_disabled[name] = true
+ v_others.delete(name)
+ next
+ end
x.sub(dest, '= "$(DESTDIR)')
else
x
end
end
+v_others.compact!
if $install_name
v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
@@ -197,10 +205,16 @@ print(*v_others)
print <<EOS
CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+EOS
+print <<EOS unless v_disabled["sitedir"]
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+EOS
+print <<EOS unless v_disabled["vendordir"]
CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
+EOS
+print <<EOS
CONFIG["topdir"] = File.dirname(__FILE__)
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}