summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-21 03:12:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-21 03:12:45 +0000
commit08046447bb17f2effa6e67da63c19f2820638555 (patch)
tree3ffc3e2017249b773ccc58ae649a65f6fe2d9127 /lib
parentae441f7a525a54fd1c6fe94462dc6ecd267822cd (diff)
* ext/extmk.rb, lib/mkmf.rb (with_destdir): remove drive letter before
prepending destdir on DOSISH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index e711bb2dc4..f0e783595f 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -61,6 +61,7 @@ $netbsd = /netbsd/ =~ RUBY_PLATFORM
$os2 = /os2/ =~ RUBY_PLATFORM
$beos = /beos/ =~ RUBY_PLATFORM
$solaris = /solaris/ =~ RUBY_PLATFORM
+$dest_prefix_pattern = (File::PATH_SEPARATOR == ';' ? /\A([[:alpha:]]:)?/ : /\A/)
def config_string(key, config = CONFIG)
s = config[key] and !s.empty? and block_given? ? yield(s) : s
@@ -911,7 +912,8 @@ def pkg_config(pkg)
end
def with_destdir(dir)
- /^\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
+ dir = dir.sub($dest_prefix_pattern, '')
+ /\A\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
end
def winsep(s)
@@ -941,18 +943,17 @@ topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote}
hdrdir = #{$extmk ? CONFIG["hdrdir"].quote : '$(topdir)'}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
- drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/
- if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty?
+ if $destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
mk << "\nDESTDIR = #{destdir}\n"
end
CONFIG.each do |key, var|
next unless /prefix$/ =~ key
- mk << "#{key} = #{with_destdir(var.sub(drive, ''))}\n"
+ mk << "#{key} = #{with_destdir(var)}\n"
end
CONFIG.each do |key, var|
next if /^abs_/ =~ key
next unless /^(?:src|top|hdr|(.*))dir$/ =~ key and $1
- mk << "#{key} = #{with_destdir(var.sub(drive, ''))}\n"
+ mk << "#{key} = #{with_destdir(var)}\n"
end
if !$extmk and !$configure_args.has_key?('--ruby') and
sep = config_string('BUILD_FILE_SEPARATOR')