aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-22 11:15:03 -0700
committerAdam Vandenberg2010-04-22 17:23:59 -0700
commitee8c805b65e41356f76c0aa40d0a464c587cca04 (patch)
tree8b8a932e08438a780a81207572e10d7dece24a1b
parent0d3e1d1fa3ae19ddebc07130c9fde650e97f8a01 (diff)
downloadhomebrew-ee8c805b65e41356f76c0aa40d0a464c587cca04.tar.bz2
Fix universal builds on 32-bit CPUs.
-rw-r--r--Library/Homebrew/extend/ENV.rb3
-rw-r--r--Library/Homebrew/hardware.rb4
2 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 0e37b9f17..c0b6318a2 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -179,6 +179,9 @@ module HomebrewEnvExtension
append_to_cflags '-arch i386 -arch x86_64'
ENV.O3 if self['CFLAGS'].include? '-O4' # O4 seems to cause the build to fail
ENV.append 'LDFLAGS', '-arch i386 -arch x86_64'
+
+ # Can't mix "-march" for a 32-bit CPU with "-arch x86_64"
+ remove_from_cflags(/-march=\S*/) if Hardware.is_32_bit?
end
def prepend key, value, separator = ' '
diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb
index 549e02543..b10b2770c 100644
--- a/Library/Homebrew/hardware.rb
+++ b/Library/Homebrew/hardware.rb
@@ -46,6 +46,10 @@ class Hardware
end
end
+ def self.is_32_bit?
+ not self.is_64_bit?
+ end
+
def self.is_64_bit?
self.sysctl_bool("hw.cpu64bit_capable")
end