ruby-changes:24961
From: nobu <ko1@a...>
Date: Sun, 23 Sep 2012 21:44:41 +0900 (JST)
Subject: [ruby-changes:24961] nobu:r37013 (trunk): mkmf.rb: use internal path
nobu 2012-09-23 21:44:30 +0900 (Sun, 23 Sep 2012) New Revision: 37013 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37013 Log: mkmf.rb: use internal path * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths internal to deal with in Makefile. Modified files: trunk/ChangeLog trunk/lib/mkmf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 37012) +++ ChangeLog (revision 37013) @@ -1,5 +1,8 @@ -Sun Sep 23 21:42:22 2012 Nobuyoshi Nakada <nobu@r...> +Sun Sep 23 21:44:20 2012 Nobuyoshi Nakada <nobu@r...> + * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths + internal to deal with in Makefile. + * lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now. Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@g...> Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 37012) +++ lib/mkmf.rb (revision 37013) @@ -1718,6 +1718,12 @@ 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 @@ 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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/