Issue #10230 has been reported by Hiroshi Shirosaki.

----------------------------------------
Bug #10230: make install fails with mingw ruby
https://bugs.ruby-lang.org/issues/10230

* Author: Hiroshi Shirosaki
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-09-11 trunk 47535) [i386-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
`make install` fails with mingw ruby on Windows MSYS environemnt.

ruby 2.2.0dev (2014-09-11 trunk 47535) [i386-mingw32]

```
$ make install
...
make[2]: 'ruby.exe' is up to date.
make[2]: 'rubyw.exe' is up to date.
make[2]: Leaving directory '/c/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build'
make[1]: Leaving directory '/c/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build'
./miniruby.exe -I../../../ruby/lib -I. -I.ext/common  ../../../ruby/tool/runruby.rb --extout=.ext  -- --disable-gems -r.
/i386-mingw32-fake ../../../ruby/tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags=
"" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="man"
C:/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build/i386-mingw32-fake.rb:24:in `read': No such file or directory @
rb_sysopen - /c/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build/../../../ruby/tool/fake.rb (Errno::ENOENT)
        from C:/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build/i386-mingw32-fake.rb:24:in `<top (required)>'
        from ../../../ruby/tool/rbinstall.rb:1:in `require'
uncommon.mk:248: recipe for target 'do-install-nodoc' failed
make: *** [do-install-nodoc] Error 1
```

`i386-mingw32-fake.rb` has the following line.
`top_srcdir` is MSYS style path (/c/..) which is not handled by mingw ruby.

```
top_srcdir = "/c/Users/hiroshi/work/rubyinstaller/sandbox/ruby21_build/../../../ruby"
```


Reverting r47459 fixes this issue.

```patch
diff --git a/template/fake.rb.in b/template/fake.rb.in
index 8b4e6e5..0b454f1 100644
--- a/template/fake.rb.in
+++ b/template/fake.rb.in
@@ -18,7 +18,7 @@ class Object
   RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
 end
 builddir = File.dirname(__FILE__)
-top_srcdir = "@abs_top_srcdir@"
+top_srcdir = File.expand_path("@srcdir@", builddir)
 $:.unshift(File.expand_path(builddir))
 fake = File.join(top_srcdir, "tool/fake.rb")
 eval(File.read(fake), nil, fake)
```




-- 
https://bugs.ruby-lang.org/