diff --git a/ChangeLog b/ChangeLog index 1b9e031964..4975ae1365 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Sun Sep 23 21:42:22 2012 Nobuyoshi Nakada +Sun Sep 23 21:44:20 2012 Nobuyoshi Nakada + + * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths + internal to deal with in Makefile. * lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now. 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