diff --git a/Rakefile.cross b/Rakefile.cross
index 5ea87349dfeca9026139520829c25021f5333fdf..c787efadb5c72718f840d6fee0800793cb736b1a 100644
--- a/Rakefile.cross
+++ b/Rakefile.cross
@@ -17,10 +17,11 @@ STATIC_SOURCESDIR          = COMPILE_HOME + 'sources'
 STATIC_BUILDDIR            = COMPILE_HOME + 'builds'
 STATIC_INSTALLDIR          = COMPILE_HOME + 'install'
 RUBY_BUILD                 = RbConfig::CONFIG["host"]
-CROSS_PREFIX = if RUBY_PLATFORM.include?( 'darwin' )
-    'i386-mingw32'
-else
-    'i586-mingw32msvc'
+CROSS_PREFIX = begin
+  Rake::ExtensionCompiler.mingw_host
+rescue => err
+  $stderr.puts "Cross-compilation disabled -- %s" % [ err.message ]
+  'unknown'
 end
 
 NUM_CPUS = if File.exist?('/proc/cpuinfo')