aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorEugene Ray2011-08-28 12:11:46 -0700
committerMax Howell2011-08-31 11:16:56 +0100
commitc901bbc577aaea671400ee159c628db00bfcdd68 (patch)
tree662ebbcb388f6c48c4b1bd5874c3124e53dab166 /Library
parent67244a2bb3e65417943f6229f867c32e003c7ea2 (diff)
downloadhomebrew-c901bbc577aaea671400ee159c628db00bfcdd68.tar.bz2
Fix Xcode 4.2 cc compiles
It seems like latest build of Xcode 4.2 doesn't create "-4.2" links in /usr/bin. Because of this recipes fail with "configure: error: C compiler cannot create executables" error. Closes #7254. Closes #7276. Signed-off-by: Max Howell <max@methylblue.com> Amended to work as intended, since /usr/bin/cc is actually since Xcode 4. Amended commit message. First line must be less than 72 characters! :P
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 38852b817..21c841cab 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"