Browse files

Unset variables that can affect cross-compilation. Closes #55

Environment variables like CC, CXX, LDFLAGS, CPPFLAGS and RUBYOPT
might be leaking from user's environment or tools like Bundler.

Unset those to avoid these alter the cross-compilation of Ruby.
  • Loading branch information...
1 parent cb48426 commit a7c113e580c1565000166f9967da82ff2ecdaeaa @luislavena luislavena committed Jan 11, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 tasks/bin/cross-ruby.rake
5 tasks/bin/cross-ruby.rake
@@ -53,6 +53,11 @@ MAJOR = RUBY_CC_VERSION.match(/.*-(\d.\d).\d/)[1]
MINGW_HOST = ENV['HOST'] || Rake::ExtensionCompiler.mingw_host
MINGW_TARGET = MINGW_HOST.gsub('msvc', '')
+# Unset any possible variable that might affect compilation
+["CC", "CXX", "CPPFLAGS", "LDFLAGS", "RUBYOPT"].each do |var|
+ ENV.delete(var)
# define a location where sources will be stored
directory "#{USER_HOME}/sources/#{RUBY_CC_VERSION}"
directory "#{USER_HOME}/builds/#{RUBY_CC_VERSION}"

0 comments on commit a7c113e

Please sign in to comment.