stdenv: fix self.cc check

Since ENV.cc/cxx are accessors to ENV, any values being passed through
are coerced into strings, which means that a nil `ENV.cc` is actually
an empty string - which isn't considered to be false in Ruby.

Fixes mistydemeo/tigerbrew#161.
Fixes mistydemeo/tigerbrew#135.
This commit is contained in:
Misty De Meo 2014-01-03 17:58:31 -08:00
parent 5413ebca53
commit 97bb9c5b73

View File

@ -131,7 +131,7 @@ module Stdenv
self.cc = MacOS.locate("gcc-4.2")
self.cxx = MacOS.locate("g++-4.2")
unless cc
if cc.empty?
self.cc = "#{HOMEBREW_PREFIX}/bin/gcc-4.2"
self.cxx = "#{HOMEBREW_PREFIX}/bin/g++-4.2"
raise "GCC could not be found" unless File.exist? cc