aboutsummaryrefslogtreecommitdiffstats
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
commit53f6b89e7e2f9c602e12ed840e374690ef04a4d4 (patch)
treee37ffce270471202b50f4f399665a6cfd2bbacc9
parent58f09b091649b5e575c16f6a6b98fcac32ac7c84 (diff)
downloadruby-53f6b89e7e2f9c602e12ed840e374690ef04a4d4.tar.gz
* 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/trunk@10580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/extmk.rb5
-rw-r--r--lib/mkmf.rb11
3 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 41a0cbff3a..32169aa824 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 21 12:11:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb, lib/mkmf.rb (with_destdir): remove drive letter before
+ prepending destdir on DOSISH.
+
Fri Jul 21 04:17:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call): try local method look-up first for fcall, then
diff --git a/ext/extmk.rb b/ext/extmk.rb
index b0bc9f3c4f..dbc1c92e57 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -382,7 +382,10 @@ end
if $extout
RbConfig.expand(extout = "#$extout", RbConfig::CONFIG.merge("topdir"=>$topdir))
if $install
- RbConfig.expand(dest = "#{$destdir}#{$rubylibdir}")
+ dest = RbConfig.expand($rubylibdir.dup)
+ unless $destdir.empty?
+ dest.sub!($dest_prefix_pattern, RbConfig.expand($destdir.dup))
+ end
FileUtils.cp_r(extout+"/.", dest, :remove_destination => true, :verbose => true, :noop => $dryrun)
exit
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 497a14424b..8b2115eb65 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
@@ -916,7 +917,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)
@@ -946,18 +948,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')