diff options
| author | Charlie Sharpsteen | 2012-02-21 21:43:35 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-02-22 11:50:14 -0800 |
| commit | cf4509fd9cd849a3fa3d529dc75b1ef6718e2ebd (patch) | |
| tree | 80f3d562046104c01835294514039daaf5999dff /Library | |
| parent | 5c5150da6e06cfa3ee58337736467c1b8f7ae292 (diff) | |
| download | homebrew-cf4509fd9cd849a3fa3d529dc75b1ef6718e2ebd.tar.bz2 | |
wxMac: Fix build flags
Use the standard `ENV.m32` to force a 32-bit build now that Homebrew's
environment tools can work with Objective C flags.
Only specify `-arch` flags when building Python modules---this prevents Python
from trying to build for more architectures than it should.
Fixes #10348.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/wxmac.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/Library/Formula/wxmac.rb b/Library/Formula/wxmac.rb index a1c172480..922df041c 100644 --- a/Library/Formula/wxmac.rb +++ b/Library/Formula/wxmac.rb @@ -62,6 +62,8 @@ def install_wx_python ] Dir.chdir "wxPython" do if ARGV.build_devel? + ENV.append_to_cflags '-arch x86_64' if MacOS.prefer_64_bit? + system "python", "setup.py", "build_ext", "WXPORT=osx_cocoa", @@ -72,12 +74,8 @@ def install_wx_python "WXPORT=osx_cocoa", *opts else # for wx 2.8 force 32-bit install with the 10.6 sdk: - %w{ CFLAGS CXXFLAGS LDFLAGS }.each do |compiler_flag| - ENV.remove compiler_flag, "-arch x86_64" - ENV.append compiler_flag, "-arch i386" - # The python extension for wx2.8 has to be built with the 10.6 sdk, but we have no configure step, so: - ENV.append compiler_flag, "-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6" - end + ENV.append_to_cflags '-arch i386' + system "arch", "-i386", "python", "setup.py", @@ -122,15 +120,10 @@ def install_wx_python unless ARGV.build_devel? # Force i386 wor wx 2.8 - %w{ CFLAGS CXXFLAGS LDFLAGS OBJCFLAGS OBJCXXFLAGS }.each do |compiler_flag| - ENV.remove compiler_flag, "-arch x86_64" - ENV.append compiler_flag, "-arch i386" - end + ENV.m32 + # build will fail on Lion unless we use the 10.6 sdk (note wx 2.9 does fine) - if MacOS.lion? - args << "--with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk" - args << "--with-macosx-version-min=10.6" - end + ENV.append_to_cflags '-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6' if MacOS.lion? end system "./configure", *args |
