IO#popen is called for each call to Hardware.is_64_bit?; this becomes
costly when it is repeatedly invoked. Luckily it is an invariant, so we
can store it in a class variable.
False is a valid value for this method, so the usual ||= idiom is not
applicable.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Moved snow_leopard_64? to compatibility and replaced it with
a function MacOS.prefer_64_bit?. This method is in a better
place and has a better name once Lion comes out.
FixesHomebrew/homebrew#4710
snow_leopard_64? (defined in Hardware) is a short-cut for:
MACOS_VERSION >= 10.6 and Hardware.is_64_bit?
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This regards Issue Homebrew/homebrew#30.
Turns out -march=native isn't supported by Apple's GCC, but while investigating it I found they'd back ported the -march=core2 option, so we win anyway.
Logic reverted to how it was yesterday.
I moved the gcc options stuff back to brewkit.rb as we manipulate the cflags more later and it seemed bad form to split the logic for this area over two files.
Additionally the brew command exits immediately on powerpc now. Brewkit doesn't throw as theoretically it is a useful library file for other projects.
Simplified hardware model testing.
Even smarter compiler option generation using sysctl and new GCC 4.2 features.
Get processor count from sysctl and thus remove our dependency on RubyCocoa.