From 10f16a41ffe7edf364d6e9334664e09270378087 Mon Sep 17 00:00:00 2001
From: Lars Kanis <kanis@comcard.de>
Date: Wed, 25 Jan 2012 17:43:52 +0100
Subject: [PATCH] let Rake::ExtensionCompiler detect the cross compiler prefix

---
 Rakefile.cross | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Rakefile.cross b/Rakefile.cross
index 5ea8734..c787efa 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')
-- 
GitLab