33 Commits

Author SHA1 Message Date
Shaun Jackman
ecb2246ab0 OPTIMIZATION_FLAGS: Use -march=native for Penryn
Use -march=native for Penryn as for other systems rather than
-march=core2 -msse4.1.
2017-03-13 15:54:20 -07:00
Mike McQuaid
d0f1fa668c hardware: use march=native for generic module.
This matches Linux where this behaviour was original imported from.
2017-03-11 08:40:48 +00:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
569c80323b hardware: add ARM detection from Linuxbrew. 2016-07-29 21:21:02 -06:00
Mike McQuaid
892a3239bc hardware: more porting to generic layer. 2016-07-27 15:05:42 -06:00
Mike McQuaid
11624b9a7d hardware: move generic logic from linux. (#454) 2016-07-06 10:43:54 +01:00
Martin Afanasjew
7727c7764c hardware: prettify config output on 6/8-core CPUs (#313) 2016-06-14 15:08:04 +02:00
Mike McQuaid
8d995e961f Make hardware code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
ddb576b582 Add support for testing generic OS.
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that
neither Mac nor Linux-specific code is loaded. This allows easier
testing of cross-platform code on OS X and will make it easier to port
Homebrew to platforms other than OS X and Linux.
2016-05-08 16:51:22 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
977981dcb9 Remove ivars from default Hardware::CPU methods
These methods are always overridden in the per-OS modules, so let's just
provide sensible defaults for documentation purposes.
2015-02-27 20:38:00 -05:00
Jack Nagel
1dc4412f69 Provide Hardware::CPU.feature? 2015-02-23 21:38:36 -05:00
Jack Nagel
6e92716642 Define Hardware::CPU.features on the base module 2015-02-23 21:38:36 -05:00
Jack Nagel
cb18b9e77e Add Hardware::CPU.intel? and Hardware::CPU.ppc? 2013-11-26 20:23:19 -06:00
Jack Nagel
c511d7d2f4 Add OS.mac? and OS.linux? 2013-10-18 12:56:51 -05:00
Misty De Meo
ab633864d5 Mach: improve PPC arch detection
Also adds some reusable constants into the global Hardware::CPU
namespace, available on both OS X and Linux.
2013-08-15 22:46:56 -07:00
Jack Nagel
50db35e5d3 Use Hardware::CPU module 2013-06-14 10:34:17 -05:00
Jack Nagel
159b9d8e2d Move oldest_cpu to Hardware 2013-06-06 16:02:27 -05:00
Jack Nagel
3be67f7252 Reorganize compat 2013-05-10 23:27:28 -05:00
Misty De Meo
2476801613 Hardware: separate out CPU values into CPU module
* CPU functions now exist in Hardware::CPU
* Added compatibility functions in compat/hardware_compat.rb
* Names are less specific to Mac hardware, e.g. CPU.family instead of
  Hardware.intel_family
* Hardware::CPU.family works for both Intel and PowerPC
* New helper methods on CPU, like .sse4? and .altivec?

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2013-03-23 13:40:18 -05:00
Shaun Jackman
258d70028f Portability fixes to run Homebrew on Linux systems
Closes Homebrew/homebrew#16344.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-11 18:26:25 +00:00
Misty De Meo
cf9e25cfa5 Add Ivy Bridge CPU family
Fixes Homebrew/homebrew#13434.
2012-07-16 16:26:47 -05:00
Jack Nagel
ca71c038a1 Cache Hardware.is_64_bit?
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>
2012-07-02 01:10:21 -05:00
Austin Seipp
567711ed74 sandybridge hardware identifier for brew --config
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-07-05 09:38:41 -07:00
Adam Vandenberg
d8c2642b6d Add MacOS.prefer_64_bit?
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.

Fixes Homebrew/homebrew#4710
2011-03-18 10:30:26 -07:00
Adam Vandenberg
1e5b23f2db Define "snow_leopard_64?"
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>
2010-08-22 20:11:03 -07:00
listrophy
d7f19e7afb Add 'Arrandale' for core i7 MBP
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-04-29 11:51:05 -07:00
Adam Vandenberg
7c158e2350 Fix universal builds on 32-bit CPUs. 2010-04-22 17:23:59 -07:00
Adam Vandenberg
a9b19f0255 Move license block to separate LICENSE file. 2010-03-01 11:41:24 -08:00
Adam Vandenberg
4fbcf13e65 Move some helper functions into Hardware 2009-11-19 14:03:06 -08:00
Ben Alpert
e339a2a73f Add Hardware.is_64_bit? method
Closes Homebrew/homebrew#53
2009-09-24 16:30:26 -06:00
Max Howell
a12569699e Fix some "GCC cannot create executables"
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.
2009-09-03 22:39:49 +01:00
spicyj
ba8ba4c451 Improvements to build environment determination
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.
2009-09-03 16:34:31 +01:00