aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-05-14 00:00:59 -0500
committerJack Nagel2014-05-14 00:00:59 -0500
commit858da0063d2fca5748e62c74ab8851baa638574c (patch)
tree0f2268e7a9cab466351839c4b2c75b8138aafa35 /Library
parent230161c1deb4bee497c12e7dfe87f41a236b2d44 (diff)
downloadbrew-858da0063d2fca5748e62c74ab8851baa638574c.tar.bz2
Allow disabling arch flag filtering
Closes Homebrew/homebrew#17352.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc9
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb2
-rw-r--r--Library/Homebrew/extend/ENV/super.rb5
3 files changed, 14 insertions, 2 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index a67aae02a..1c8db1238 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -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?
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index bda1f509c..b7db7df62 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -239,4 +239,6 @@ module SharedEnvExtension
EOS
end
end
+
+ def permit_arch_flags; end
end
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index b9179c89c..5b3b8c5c5 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -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"