Created
July 17, 2013 14:05
Add support for using a homebrew-compiled gcc 4.8 to compile other formulas.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb | |
index 8d971eb..47ae246 100644 | |
--- a/Library/Homebrew/extend/ENV.rb | |
+++ b/Library/Homebrew/extend/ENV.rb | |
@@ -164,6 +164,16 @@ module HomebrewEnvExtension | |
end | |
alias_method :gcc_4_2, :gcc | |
+ def gcc48 | |
+ self['CC'] = self['OBJC'] = "#{HOMEBREW_PREFIX}/bin/gcc-4.8" | |
+ self['CXX'] = self['OBJCXX'] = "#{HOMEBREW_PREFIX}/bin/g++-4.8" | |
+ raise "GCC could not be found" unless File.exist? self['CC'] | |
+ | |
+ replace_in_cflags '-O4', '-O3' | |
+ set_cpu_cflags | |
+ @compiler = :gcc48 | |
+ end | |
+ | |
def llvm | |
self['CC'] = self['OBJC'] = MacOS.locate("llvm-gcc") | |
self['CXX'] = self['OBJCXX'] = MacOS.locate("llvm-g++") | |
@@ -351,6 +361,8 @@ module HomebrewEnvExtension | |
:llvm | |
elsif ARGV.include? '--use-clang' | |
:clang | |
+ elsif ARGV.include? '--use-gcc48' | |
+ :gcc48 | |
elsif self['HOMEBREW_USE_CLANG'] | |
:clang | |
elsif self['HOMEBREW_USE_LLVM'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment