aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2013-08-01 20:24:18 -0700
committerMisty De Meo2013-08-15 22:46:56 -0700
commita892e52bfc441f267ee01511d7ee454de70a8350 (patch)
treec06fe8f68ae13ea293846079854f405428b1fb86 /Library
parent0f580953b49812587fb8636c147ae36197f95ba4 (diff)
downloadbrew-a892e52bfc441f267ee01511d7ee454de70a8350.tar.bz2
Add Hardware::CPU.universal_archs
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/os/mac/hardware.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb
index 05cd3da5e..b0ac99822 100644
--- a/Library/Homebrew/os/mac/hardware.rb
+++ b/Library/Homebrew/os/mac/hardware.rb
@@ -1,3 +1,5 @@
+require 'mach'
+
module MacCPUs
OPTIMIZATION_FLAGS = {
:penryn => '-march=core2 -msse4.1',
@@ -83,6 +85,18 @@ module MacCPUs
type == :intel ? :x86_64 : :ppc64
end
+ # Returns an array that's been extended with ArchitectureListExtension,
+ # which provides helpers like #as_arch_flags and #as_cmake_arch_flags.
+ def universal_archs
+ # Building 64-bit is a no-go on Tiger, and pretty hit or miss on Leopard.
+ # Don't even try unless Tigerbrew's experimental 64-bit Leopard support is enabled.
+ if MacOS.version <= :leopard and !MacOS.prefer_64_bit?
+ [arch_32_bit].extend ArchitectureListExtension
+ else
+ [arch_32_bit, arch_64_bit].extend ArchitectureListExtension
+ end
+ end
+
def altivec?
@altivec ||= sysctl_bool('hw.optional.altivec')
end