From ef92d9dc377d50f2b43b6dc6899ee9b172f0a725 Mon Sep 17 00:00:00 2001 From: Tom von Schwerdtner Date: Fri, 2 Oct 2009 18:46:27 -0400 Subject: Introduce ENV.O2 and use that for the postgresql build Also only set ARCHFLAGS on non-Core Duo machines... though it seemed to build fine even with it, it doenst make much sense to me... these changes are kind of up for debate but it "works for me" this way... Closes #75 --- Library/Formula/postgresql.rb | 10 +++++++--- Library/Homebrew/brewkit.rb | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 8cd9a1d93..64592e1d1 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -20,15 +20,19 @@ class Postgresql = 10.6 - configure_args << "ARCHFLAGS='-arch x86_64'" + if MACOS_VERSION >= 10.6 && Hardware.is_64_bit? + configure_args << "ARCHFLAGS='-arch x86_64'" + end + + # Fails on Core Duo with O4 and O3 + if Hardware.intel_family == :core + ENV.O2 end system "./configure", *configure_args system "make install" (prefix+'org.postgresql.postgres.plist').write startup_plist - end def skip_clean? path diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb index 6c85c406f..3d25edc92 100644 --- a/Library/Homebrew/brewkit.rb +++ b/Library/Homebrew/brewkit.rb @@ -128,6 +128,12 @@ module HomebrewEnvExtension remove_from_cflags '-O4' append_to_cflags '-O3' end + def O2 + # Sometimes O3 doesn't work or produces bad binaries + remove_from_cflags '-O4' + remove_from_cflags '-O3' + append_to_cflags '-O2' + end def gcc_4_2 # Sometimes you want to downgrade from LLVM to GCC 4.2 self['CC']="gcc-4.2" -- cgit v1.2.3