From de9093ad2941a4c1ae64fe5a6e48166d155397e5 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 23 Sep 2012 12:44:30 +0000 Subject: 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 --- lib/mkmf.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'lib/mkmf.rb') 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 -- cgit v1.2.3