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:
		
							parent
							
								
									5413ebca53
								
							
						
					
					
						commit
						97bb9c5b73
					
				@ -131,7 +131,7 @@ module Stdenv
 | 
				
			|||||||
    self.cc  = MacOS.locate("gcc-4.2")
 | 
					    self.cc  = MacOS.locate("gcc-4.2")
 | 
				
			||||||
    self.cxx = MacOS.locate("g++-4.2")
 | 
					    self.cxx = MacOS.locate("g++-4.2")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    unless cc
 | 
					    if cc.empty?
 | 
				
			||||||
      self.cc  = "#{HOMEBREW_PREFIX}/bin/gcc-4.2"
 | 
					      self.cc  = "#{HOMEBREW_PREFIX}/bin/gcc-4.2"
 | 
				
			||||||
      self.cxx = "#{HOMEBREW_PREFIX}/bin/g++-4.2"
 | 
					      self.cxx = "#{HOMEBREW_PREFIX}/bin/g++-4.2"
 | 
				
			||||||
      raise "GCC could not be found" unless File.exist? cc
 | 
					      raise "GCC could not be found" unless File.exist? cc
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user