Allow disabling arch flag filtering

Closes Homebrew/homebrew#17352.
This commit is contained in:
Jack Nagel 2014-05-14 00:00:59 -05:00
parent 230161c1de
commit 858da0063d
3 changed files with 14 additions and 2 deletions

View File

@ -127,10 +127,15 @@ class Cmd
loop do
case arg = enum.next
when "-arch"
enum.next
if cccfg?("K")
args << arg << enum.next
else
enum.next
end
when "-m32"
args << arg if cccfg?("3")
args << arg if cccfg?("3") || cccfg?("K")
when "-m64"
args << arg if cccfg?("K")
when /^-Xarch_/
refurbished = refurbish_arg(enum.next, enum)
unless refurbished.empty?

View File

@ -239,4 +239,6 @@ module SharedEnvExtension
EOS
end
end
def permit_arch_flags; end
end

View File

@ -81,6 +81,7 @@ module Superenv
# x - Enable C++11 mode.
# g - Enable "-stdlib=libc++" for clang.
# h - Enable "-stdlib=libstdc++" for clang.
# K - Don't strip -arch <arch>, -m32, or -m64
#
# On 10.8 and newer, these flags will also be present:
# s - apply fix for sed's Unicode support
@ -266,6 +267,10 @@ module Superenv
end
end
def permit_arch_flags
append "HOMEBREW_CCCFG", "K"
end
def cxx11
case self["HOMEBREW_CC"]
when "clang"