brew/Library/Homebrew/os/linux/hardware.rb
Shaun Jackman f7b8fb1da0 os/linux/hardware: uname -m may be /i[3-6]86/
Closes homebrew/linuxbrew#16

Closes Homebrew/homebrew#20903.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-06-29 13:15:59 -05:00

32 lines
520 B
Ruby

module LinuxCPUs
OPTIMIZATION_FLAGS = {}.freeze
def optimization_flags; OPTIMIZATION_FLAGS; end
def type
@cpu_type ||= case `uname -m`
when /i[3-6]86/, /x86_64/
:intel
else
:dunno
end
end
def family
:dunno
end
alias_method :intel_family, :family
def cores
`grep -c ^processor /proc/cpuinfo`.to_i
end
def bits
is_64_bit? ? 64 : 32
end
def is_64_bit?
return @is_64_bit if defined? @is_64_bit
@is_64_bit = /64/ === `uname -m`
end
end