From e0d24922474f2a10b82b8dede1b54552ed72ebed Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 20 Nov 2013 12:54:34 -0600 Subject: Move optimization flag selection out of cc wrapper The mapping of architectures to optimization flags is now retrieved from Hardware::CPU and the selected flags are passed as an environmen variable, rather than duplicated in the cc wrapper and re-calculated on every invocation of the compiler. Closes Homebrew/homebrew#24540. --- Library/ENV/4.3/cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'Library/ENV') diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 383941807..92b09a48c 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -184,22 +184,7 @@ class Cmd def optflags args = [] args << "-#{ENV['HOMEBREW_OPTIMIZATION_LEVEL']}" - - # When bottling use the oldest supported CPU type. - if cccfg? 'bc' - # Custom bottle specified during the build - args << ENV['HOMEBREW_ARCHFLAGS'] - elsif cccfg? 'bi6' - args << '-march=core2' - elsif cccfg? 'bi' - args << '-march=prescott' - elsif cccfg? 'bpA' - args << '-mcpu=7400' - elsif cccfg? 'bp' - args << '-mcpu=750' - else - args << '-march=native' if tool =~ /clang/ - end + args.concat ENV['HOMEBREW_OPTFLAGS'].split(' ') if ENV['HOMEBREW_OPTFLAGS'] args end def archflags -- cgit v1.2.3