postgresql: add 32-bit only build

master
Adam Vandenberg 2012-02-03 22:04:59 -08:00
parent 30bcd55da9
commit 1e9557c426
1 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@ class Postgresql < Formula
def options
[
['--32-bit', 'Build 32-bit only.'],
['--no-python', 'Build without Python support.'],
['--no-perl', 'Build without Perl support.'],
['--enable-dtrace', 'Build with DTrace support.']
@ -45,11 +46,14 @@ class Postgresql < Formula
ENV.append 'LDFLAGS', `uuid-config --ldflags`.strip
ENV.append 'LIBS', `uuid-config --libs`.strip
if MacOS.prefer_64_bit? and not ARGV.include? '--no-python'
if not ARGV.include? '--32-bit' and MacOS.prefer_64_bit? and not ARGV.include? '--no-python'
args << "ARCHFLAGS='-arch x86_64'"
check_python_arch
end
ENV.append 'CFLAGS', '-arch i386' if ARGV.include? '--32-bit'
ENV.append 'LDFLAGS', '-arch i386' if ARGV.include? '--32-bit'
# Fails on Core Duo with O4 and O3
ENV.O2 if Hardware.intel_family == :core
@ -150,6 +154,9 @@ EOS
if MacOS.prefer_64_bit? then
s << <<-EOS
To install postgresql ( and ossp-uuid ) in 32 bits mode; you may use --32-bit :
brew install postgresql --32-bit
If you want to install the postgres gem, including ARCHFLAGS is recommended:
env ARCHFLAGS="-arch x86_64" gem install pg