Actually, what I'd do:

```ruby
require 'rake/extensioncompiler'
MINGW_AVAILABLE = defined? (Rake::ExtensionCompiler.mingw_host)
```