diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 38852b817b..21c841caba 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -127,6 +127,10 @@ module HomebrewEnvExtension if MacOS.xcode_version < '4' self['CC'] = '/usr/bin/cc' self['CXX'] = '/usr/bin/c++' + elsif MacOS.xcode_version >= '4.2' + # Apple stopped adding the -4.2 suffixes + self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc" + self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++" else # With Xcode4 cc, c++, gcc and g++ are actually symlinks to llvm-gcc self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc-4.2"