summaryrefslogtreecommitdiff
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
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
-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 66c91f2172..791b89160a 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.
+
Thu Jul 20 15:07:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.h: export classes/modules to implement sandbox.
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 5badcc755f..bbcb3c09b8 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -382,7 +382,10 @@ end
if $extout
Config.expand(extout = "#$extout", Config::CONFIG.merge("topdir"=>$topdir))
if $install
- Config.expand(dest = "#{$destdir}#{$rubylibdir}")
+ dest = Config.expand($rubylibdir.dup)
+ unless $destdir.empty?
+ dest.sub!($dest_prefix_pattern, Config.expand($destdir.dup))
+ end
FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop => $dryrun)
exit
end
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')