diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-23 12:44:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-23 12:44:30 +0000 |
commit | de9093ad2941a4c1ae64fe5a6e48166d155397e5 (patch) | |
tree | f49bea387b6f30b5156e1c7939e33a212b05769f /lib | |
parent | 87fe2bfdcf16b37608b5c1b51da63f024818cc85 (diff) | |
download | ruby-de9093ad2941a4c1ae64fe5a6e48166d155397e5.tar.gz |
mkmf.rb: use internal path
* lib/mkmf.rb (MakeMakefile#configuration): make prefix paths
internal to deal with in Makefile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 808aeaa4e5..4734d5f60e 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1718,6 +1718,12 @@ SRC path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') path end + when 'cygwin' + if CONFIG['target_os'] != 'cygwin' + def mkintpath(path) + IO.popen(["cygpath", "-u", path], &:read).chomp + end + end end end unless method_defined?(:mkintpath) @@ -1729,14 +1735,6 @@ SRC def configuration(srcdir) mk = [] vpath = $VPATH.dup - if !CROSS_COMPILING - case CONFIG['build_os'] - when 'cygwin' - if CONFIG['target_os'] != 'cygwin' - vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')} - end - end - end CONFIG["hdrdir"] ||= $hdrdir mk << %{ SHELL = /bin/sh @@ -1759,12 +1757,13 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])} if $extmk mk << "RUBYLIB =\n""RUBYOPT = -\n" end - if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1] + prefix = mkintpath(CONFIG["prefix"]) + if destdir = prefix[$dest_prefix_pattern, 1] mk << "\nDESTDIR = #{destdir}\n" end + mk << "prefix = #{with_destdir(prefix)}\n" CONFIG.each do |key, var| - next unless /prefix$/ =~ key - mk << "#{key} = #{with_destdir(var)}\n" + mk << "#{key} = #{with_destdir(mkintpath(var))}\n" if /.prefix$/ =~ key end CONFIG.each do |key, var| next if /^abs_/ =~ key |