diff options
| author | Ben Alpert | 2009-09-18 12:50:01 -0600 | 
|---|---|---|
| committer | Ben Alpert | 2009-09-24 16:30:26 -0600 | 
| commit | 5d7cab9703339c634228aacd7937a95e3bebd3a4 (patch) | |
| tree | cd488698f24dab7807fc464b944e7bc4ad164a95 /Library | |
| parent | e698609ada49a1700507f54cc5cc450566552262 (diff) | |
| download | homebrew-5d7cab9703339c634228aacd7937a95e3bebd3a4.tar.bz2 | |
Add Hardware.is_64_bit? method
Closes #53
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/erlang.rb | 2 | ||||
| -rw-r--r-- | Library/Formula/icu4c.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/hardware.rb | 4 | 
3 files changed, 6 insertions, 2 deletions
diff --git a/Library/Formula/erlang.rb b/Library/Formula/erlang.rb index 91671d3bc..cba000009 100644 --- a/Library/Formula/erlang.rb +++ b/Library/Formula/erlang.rb @@ -45,7 +45,7 @@ class Erlang <Formula                            "--enable-smp-support",                            "--enable-hipe"] -    if Hardware.intel_family == :core2 and MACOS_VERSION == 10.6 +    if Hardware.is_64_bit? and MACOS_VERSION == 10.6        config_flags << "--enable-darwin-64bit"         config_flags << "--enable-m64-build"      end diff --git a/Library/Formula/icu4c.rb b/Library/Formula/icu4c.rb index d8f9fcd72..72b1f1f63 100644 --- a/Library/Formula/icu4c.rb +++ b/Library/Formula/icu4c.rb @@ -12,7 +12,7 @@ class Icu4c <Formula    def install      config_flags = ["--prefix=#{prefix}", "--disable-samples", "--enable-static"] -    config_flags << "--with-library-bits=64" if Hardware.intel_family == :core2 and MACOS_VERSION == 10.6 +    config_flags << "--with-library-bits=64" if Hardware.is_64_bit? and MACOS_VERSION == 10.6      Dir.chdir "source" do        system "./configure", *config_flags        system "make" diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index 3059f0875..18d4e6665 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -60,6 +60,10 @@ class Hardware      @@processor_count ||= `/usr/sbin/sysctl -n hw.ncpu`.to_i    end +  def self.is_64_bit? +    self.sysctl_bool("hw.cpu64bit_capable") +  end +  protected    def self.sysctl_bool(property)      result = nil  | 
