From: Charlie Savage Date: 2009-01-27T17:36:44+09:00 Subject: [ruby-core:21603] [Bug #1060] mkmf refuses to find 3rd party extensions - ruby 1.9.1 trunk Issue #1060 has been updated by Charlie Savage. File mkmf_cfis.patch added Ok, I figured out what is going on here. I am building Ruby using msys plus mingw. I find that easier than just straight mingw (or vc++) because msys can easily build pdcurses, zlib, tlc, tk, etc. The problem is that mkmf calls Kernel::Sytem, which runs commands in a subshell, which I'm going to guess is windows command.exe. That of course breaks the build because paths such as /usr/local/include no longer work. This can be fixed by spawning bash instead. So something like this: --- mkmf.rb 2009-01-27 01:29:14 -0700 +++ mkmf.new.rb 2009-01-27 01:28:40 -0700 @@ -295,6 +295,11 @@ nil while command.gsub!(varpat) {vars[$1||$2]} end + if /mingw/ =~ CONFIG['build_os'] and + /sh/ =~ CONFIG['SHELL'] + command = "sh -c '#{command}'" + end + Logging::open do puts command.quote system(command) ---------------- Its hardly perfect of course - I can see ways of breaking it (like not having sh in your patch). Maybe a better approach is to patch mkmf so you can supply a shell as a command line parameter. It does seem reasonable when building ruby with msys+mingw, that extensions should also be built using the same shell. Without this change, you can't effectively build ruby with mingw+msys since you get no 3rd party extensions. I would guess the same issue would affect cygwin when using -mno-cygwin, but I haven't checked (and have no plans too). Thanks - Charlie ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1060 ---------------------------------------- http://redmine.ruby-lang.org