aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-07-06 10:43:54 +0100
committerGitHub2016-07-06 10:43:54 +0100
commit11624b9a7da00448e660f1454121a63b3d401729 (patch)
tree9b620ae52dedab8b40069d08fcc8cc7d6c88e211
parent416e51bca94910cb93eb4f0d9b1c0d40056fb8e4 (diff)
downloadbrew-11624b9a7da00448e660f1454121a63b3d401729.tar.bz2
hardware: move generic logic from linux. (#454)
-rw-r--r--Library/Homebrew/extend/os/linux/hardware/cpu.rb19
-rw-r--r--Library/Homebrew/extend/os/mac/hardware/cpu.rb10
-rw-r--r--Library/Homebrew/hardware.rb19
3 files changed, 22 insertions, 26 deletions
diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
index 48028da87..d8c281bfc 100644
--- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb
+++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
@@ -1,25 +1,6 @@
module Hardware
class CPU
class << self
-
- OPTIMIZATION_FLAGS = {
- :penryn => "-march=core2 -msse4.1",
- :core2 => "-march=core2",
- :core => "-march=prescott"
- }.freeze
- def optimization_flags
- OPTIMIZATION_FLAGS
- end
-
- # Linux supports x86 only, and universal archs do not apply
- def arch_32_bit
- :i386
- end
-
- def arch_64_bit
- :x86_64
- end
-
def universal_archs
[].extend ArchitectureListExtension
end
diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb
index 5f6b4c3a6..8733c4933 100644
--- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb
+++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb
@@ -3,19 +3,15 @@ require "os/mac/pathname"
module Hardware
class CPU
class << self
-
- OPTIMIZATION_FLAGS = {
- :penryn => "-march=core2 -msse4.1",
- :core2 => "-march=core2",
- :core => "-march=prescott",
+ PPC_OPTIMIZATION_FLAGS = {
:g3 => "-mcpu=750",
:g4 => "-mcpu=7400",
:g4e => "-mcpu=7450",
:g5 => "-mcpu=970",
- :g5_64 => "-mcpu=970 -arch ppc64"
+ :g5_64 => "-mcpu=970 -arch ppc64",
}.freeze
def optimization_flags
- OPTIMIZATION_FLAGS
+ OPTIMIZATION_FLAGS.merge(PPC_OPTIMIZATION_FLAGS)
end
# These methods use info spewed out by sysctl.
diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb
index c493ff27a..c705c5e50 100644
--- a/Library/Homebrew/hardware.rb
+++ b/Library/Homebrew/hardware.rb
@@ -8,6 +8,25 @@ module Hardware
PPC_64BIT_ARCHS = [:ppc64].freeze
class << self
+ OPTIMIZATION_FLAGS = {
+ :penryn => "-march=core2 -msse4.1",
+ :core2 => "-march=core2",
+ :core => "-march=prescott",
+ :dunno => "",
+ }.freeze
+
+ def optimization_flags
+ OPTIMIZATION_FLAGS
+ end
+
+ def arch_32_bit
+ :i386
+ end
+
+ def arch_64_bit
+ :x86_64
+ end
+
def type
:dunno
end