aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-09-05 12:26:13 +0100
committerMax Howell2009-09-05 14:38:38 +0100
commita2cd3367a8221c757f50f8cece0dcaaff10846a3 (patch)
tree87ee4d1dcb5d8b905bbcff7eae7d4915a11a2d05 /Library
parent87605d534bd75151df532f507f4bd10d3225aeed (diff)
downloadbrew-a2cd3367a8221c757f50f8cece0dcaaff10846a3.tar.bz2
ENV.no_optimization
For when we optimize too much and things seem to break. In my experience the GCC optimizer is pretty safe nowadays, but at least this allows you to test the hypothesis the optimization is breaking the build.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brewkit.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 204213dec..bf97e648a 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -40,12 +40,11 @@ ENV['MACOSX_DEPLOYMENT_TARGET']=$1
# ignore existing build vars, thus we should have less bugs to deal with
ENV['LDFLAGS']=""
-cflags=%w[-O3]
-
# optimise all the way to eleven, references:
# http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
# http://forums.mozillazine.org/viewtopic.php?f=12&t=577299
# http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/i386-and-x86_002d64-Options.html
+cflags=[]
if MACOS_VERSION >= 10.6
case Hardware.intel_family
when :penryn, :core2
@@ -80,7 +79,8 @@ end
# -w: keep signal to noise high
# -fomit-frame-pointer: we are not debugging this software, we are using it
-ENV['CFLAGS']=ENV['CXXFLAGS']="#{cflags*' '} -w -pipe -fomit-frame-pointer -mmacosx-version-min=#{MACOS_VERSION}"
+BREWKIT_SAFE_FLAGS="-w -pipe -fomit-frame-pointer -mmacosx-version-min=#{MACOS_VERSION}"
+ENV['CFLAGS']=ENV['CXXFLAGS']="-O3 #{cflags*' '} #{BREWKIT_SAFE_FLAGS}"
# compile faster
ENV['MAKEFLAGS']="-j#{Hardware.processor_count}"
@@ -115,8 +115,12 @@ module HomebrewEnvExtension
self['MACOSX_DEPLOYMENT_TARGET']=nil
remove_from_cflags(/ ?-mmacosx-version-min=10\.\d/)
end
- def generic_i386
- %w[-mfpmath=sse -msse3 -mmmx -march=\w+].each {|s| remove_from_cflags s}
+ def minimal_optimization
+ self['CFLAGS']=self['CXXFLAGS']="-Os #{BREWKIT_SAFE_FLAGS}"
+
+ end
+ def no_optimization
+ self['CFLAGS']=self['CXXFLAGS']=BREWKIT_SAFE_FLAGS
end
def libxml2
append_to_cflags ' -I/usr/include/libxml2'