From c5775a5a4a4ac0f37658dadea0460850603dd4b1 Mon Sep 17 00:00:00 2001
From: Lars Kanis <kanis@comcard.de>
Date: Tue, 31 Jan 2012 11:31:35 +0100
Subject: [PATCH] use CROSS_PREFIX determined by rake-compiler also for g++

---
 Rakefile.cross       | 1 +
 ext/fox16/extconf.rb | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Rakefile.cross b/Rakefile.cross
index 4b9033e..38fbdee 100644
--- a/Rakefile.cross
+++ b/Rakefile.cross
@@ -391,6 +391,7 @@ task :mingw32 do
     warn "Please refer to your distribution/package manager documentation about installation."
     fail
   end
+  ENV['CROSS_PREFIX'] = Rake::ExtensionCompiler.mingw_host
 end
 
 
diff --git a/ext/fox16/extconf.rb b/ext/fox16/extconf.rb
index 90091d3..6e5f66d 100755
--- a/ext/fox16/extconf.rb
+++ b/ext/fox16/extconf.rb
@@ -79,7 +79,7 @@ def do_rake_compiler_setup
     have_library( 'opengl32' ) && append_library( $libs, 'opengl32' )
     have_library( 'winspool', 'EnumPrintersA') && append_library( $libs, 'winspool' )
 
-    CONFIG['CC'] += "\nCXX=i586-mingw32msvc-g++" # Hack CXX into Makefile for cross compilation
+    CONFIG['CC'] += "\nCXX=#{ENV['CROSS_PREFIX']}-g++" # Hack CXX into Makefile for cross compilation
     $CFLAGS += " -D_SYS_TIME_H_" # fix incompatible types for gettimeofday()
   elsif RUBY_PLATFORM =~ /mingw/
     $CFLAGS = $CFLAGS + " -I/usr/local/include"
-- 
GitLab