aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb6
-rw-r--r--Library/Homebrew/extend/ENV/std.rb2
-rw-r--r--Library/Homebrew/extend/ENV/super.rb2
3 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index 13241403c..79bd28081 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -306,4 +306,10 @@ module SharedEnvExtension
end
end
end
+
+ def check_for_compiler_universal_support
+ if homebrew_cc =~ GNU_GCC_REGEXP
+ raise "Non-Apple GCC can't build universal binaries"
+ end
+ end
end
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb
index 9b150eae0..8bfc5ce57 100644
--- a/Library/Homebrew/extend/ENV/std.rb
+++ b/Library/Homebrew/extend/ENV/std.rb
@@ -269,6 +269,8 @@ module Stdenv
end
def universal_binary
+ check_for_compiler_universal_support
+
append_to_cflags Hardware::CPU.universal_archs.as_arch_flags
append "LDFLAGS", Hardware::CPU.universal_archs.as_arch_flags
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index 31000c592..8c88cf79b 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -268,6 +268,8 @@ module Superenv
end
def universal_binary
+ check_for_compiler_universal_support
+
self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags
# GCC doesn't accept "-march" for a 32-bit CPU with "-arch x86_64"