Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Fix compiler paths for Xcode 4 when 'brewing' with --use-gcc option #6830

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Library/Homebrew/extend/ENV.rb
Expand Up @@ -27,8 +27,10 @@ def setup_build_environment
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++"
cflags = ['-O4'] # link time optimisation baby!
elsif MACOS_VERSION >= 10.6 and self.use_gcc?
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc"
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++"
# Xcode 4 makes gcc and g++ #{MacOS.xcode_prefix}/usr/bin/ links to llvm versions
# so we need to use gcc-4.2 and g++-4.2 for real non-llvm compilers
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc-4.2"
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++-4.2"
cflags = ['-O3']
else
# If these aren't set, many formulae fail to build
Expand Down