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
This commit is contained in:
Eugene Ray authored and Max Howell committed 2011-08-31 11:16:56 +01:00
1 parent 67244a2bb3
commit c901bbc577
1 file changed
+4
+4
View File
@@ -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"