summaryrefslogtreecommitdiff
path: root/tool/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 13:17:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 13:17:30 +0000
commit31e1fce2a3a4ba971aed17cf6544d04649ba4dc9 (patch)
treea1356c961466fb7d2767b1fd9086c096c5f32c3f /tool/mkconfig.rb
parent75de442dd0b7eb7325f61610f096e2a469c2eff5 (diff)
* tool/mkconfig.rb: do not make the entries related to sitedir and
verdordir if disabled by --without options. [ruby-core:38922] [Bug #5187] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/mkconfig.rb')
-rwxr-xr-xtool/mkconfig.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index a2221f0..b707c4b 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}