aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/linux/hardware.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/os/linux/hardware.rb')
-rw-r--r--Library/Homebrew/os/linux/hardware.rb28
1 files changed, 19 insertions, 9 deletions
diff --git a/Library/Homebrew/os/linux/hardware.rb b/Library/Homebrew/os/linux/hardware.rb
index 507639e3a..c8d7f4954 100644
--- a/Library/Homebrew/os/linux/hardware.rb
+++ b/Library/Homebrew/os/linux/hardware.rb
@@ -1,15 +1,25 @@
module LinuxCPUs
OPTIMIZATION_FLAGS = {
- :penryn => '-march=core2 -msse4.1',
- :core2 => '-march=core2',
- :core => '-march=prescott',
+ :penryn => "-march=core2 -msse4.1",
+ :core2 => "-march=core2",
+ :core => "-march=prescott"
}.freeze
- def optimization_flags; OPTIMIZATION_FLAGS; end
+ 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
+ def arch_32_bit
+ :i386
+ end
+
+ def arch_64_bit
+ :x86_64
+ end
+
+ def universal_archs
+ [].extend ArchitectureListExtension
+ end
def cpuinfo
@cpuinfo ||= File.read("/proc/cpuinfo")
@@ -42,9 +52,9 @@ module LinuxCPUs
@features ||= flags[1..-1].map(&:intern)
end
- %w[aes altivec avx avx2 lm sse3 ssse3 sse4 sse4_2].each { |flag|
+ %w[aes altivec avx avx2 lm sse3 ssse3 sse4 sse4_2].each do |flag|
define_method(flag + "?") { flags.include? flag }
- }
+ end
alias_method :is_64_bit?, :lm?
def bits