aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2012-01-01 13:48:30 -0800
committerAdam Vandenberg2012-01-02 14:53:36 -0800
commit4fb16996f9f800a32c7b43c3f965b1d7f5475042 (patch)
treee583c97a321cc4b15b04fc83c9ddb1d016f7d33c
parent0401df33b231315004a7a85220de061e4082230b (diff)
downloadhomebrew-4fb16996f9f800a32c7b43c3f965b1d7f5475042.tar.bz2
Standardize 32 bit build switch
-rw-r--r--Library/Formula/gmp.rb4
-rw-r--r--Library/Formula/mpfr.rb4
-rw-r--r--Library/Formula/opencv.rb4
-rw-r--r--Library/Formula/p7zip.rb6
-rw-r--r--Library/Formula/sbcl.rb4
-rw-r--r--Library/Homebrew/extend/ARGV.rb7
6 files changed, 17 insertions, 12 deletions
diff --git a/Library/Formula/gmp.rb b/Library/Formula/gmp.rb
index b8db0da49..bedb87f1c 100644
--- a/Library/Formula/gmp.rb
+++ b/Library/Formula/gmp.rb
@@ -8,7 +8,7 @@ class Gmp < Formula
def options
[
- ["--32-bit", "Force 32-bit."],
+ ["--32-bit", "Build 32-bit only."],
["--skip-check", "Do not run 'make check' to verify libraries."]
]
end
@@ -32,7 +32,7 @@ class Gmp < Formula
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
# see: http://gmplib.org/macos.html
- if MacOS.prefer_64_bit? and not ARGV.include? "--32-bit"
+ if MacOS.prefer_64_bit? and not ARGV.build_32_bit?
ENV.m64
args << "--build=x86_64-apple-darwin"
else
diff --git a/Library/Formula/mpfr.rb b/Library/Formula/mpfr.rb
index f0d0d2d50..77bf8e6e6 100644
--- a/Library/Formula/mpfr.rb
+++ b/Library/Formula/mpfr.rb
@@ -8,7 +8,7 @@ class Mpfr < Formula
depends_on 'gmp'
def options
- [["--32-bit", "Force 32-bit."]]
+ [["--32-bit", "Build 32-bit only."]]
end
def patches
@@ -20,7 +20,7 @@ class Mpfr < Formula
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
# Note: This logic should match what the GMP formula does.
- if MacOS.prefer_64_bit? and not ARGV.include? "--32-bit"
+ if MacOS.prefer_64_bit? and not ARGV.build_32_bit?
ENV.m64
args << "--build=x86_64-apple-darwin"
else
diff --git a/Library/Formula/opencv.rb b/Library/Formula/opencv.rb
index 00e4a8bbd..6f779fb18 100644
--- a/Library/Formula/opencv.rb
+++ b/Library/Formula/opencv.rb
@@ -34,12 +34,12 @@ class Opencv < Formula
end
def options
- [['--build32', 'Force a 32-bit build.']]
+ [["--32-bit", "Build 32-bit only."]]
end
def install
args = std_cmake_parameters.split
- args << "-DOPENCV_EXTRA_C_FLAGS='-arch i386 -m32'" if ARGV.include? '--build32'
+ args << "-DOPENCV_EXTRA_C_FLAGS='-arch i386 -m32'" if ARGV.build_32_bit?
# The CMake `FindPythonLibs` Module is dumber than a bag of hammers when
# more than one python installation is available---for example, it clings
diff --git a/Library/Formula/p7zip.rb b/Library/Formula/p7zip.rb
index 8e509998b..7df6f231a 100644
--- a/Library/Formula/p7zip.rb
+++ b/Library/Formula/p7zip.rb
@@ -1,18 +1,16 @@
require 'formula'
-def build_32bit?; ARGV.include? '--32-bit' or Hardware.is_32_bit?; end
-
class P7zip < Formula
url 'http://downloads.sourceforge.net/project/p7zip/p7zip/9.20.1/p7zip_9.20.1_src_all.tar.bz2'
homepage 'http://p7zip.sourceforge.net/'
md5 'bd6caaea567dc0d995c990c5cc883c89'
def options
- [["--32-bit", "Force 32-bit."]]
+ [["--32-bit", "Build 32-bit only."]]
end
def install
- if build_32bit?
+ if Hardware.is_32_bit? or ARGV.build_32_bit?
mv 'makefile.macosx_32bits', 'makefile.machine'
else
mv 'makefile.macosx_64bits', 'makefile.machine'
diff --git a/Library/Formula/sbcl.rb b/Library/Formula/sbcl.rb
index e09ddf06a..bac0c5354 100644
--- a/Library/Formula/sbcl.rb
+++ b/Library/Formula/sbcl.rb
@@ -22,7 +22,7 @@ class Sbcl < Formula
["--without-threads", "Build SBCL without support for native threads"],
["--with-ldb", "Include low-level debugger in the build"],
["--with-internal-xref", "Include XREF information for SBCL internals (increases core size by 5-6MB)"],
- ["--32bit", "Override arch detection and compile for 32-bits."]
+ ["--32-bit", "Build 32-bit only."]
]
end
@@ -69,7 +69,7 @@ class Sbcl < Formula
Dir.chdir(build_directory)
- if ARGV.include? "--32bit"
+ if ARGV.build_32_bit?
system "SBCL_ARCH=x86 ./make.sh --prefix='#{prefix}' --xc-host='#{xc_cmdline}'"
else
system "./make.sh --prefix='#{prefix}' --xc-host='#{xc_cmdline}'"
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index 959fd6a67..8503559d5 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -74,6 +74,13 @@ module HomebrewArgvExtension
include? '--universal'
end
+ # Request a 32-bit only build.
+ # This is needed for some use-cases though we prefer to build Universal
+ # when a 32-bit version is needed.
+ def build_32_bit?
+ include? '--32-bit'
+ end
+
def build_from_source?
return true if flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \
or not MacOS.lion? or HOMEBREW_PREFIX.to_s != '/usr/local'