aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-12-02 12:17:14 +0000
committerMax Howell2009-12-02 12:17:14 +0000
commitf6d0acfe597674d76b032abd0dd7ec644f377a6f (patch)
treec04b0e29db01ee35ea75d92b47ef775e8b2cbae7 /Library
parent4a1fd95e6f815b4fcf78ff7a7e599f50cc60d231 (diff)
downloadhomebrew-f6d0acfe597674d76b032abd0dd7ec644f377a6f.tar.bz2
Remove redundant cflags
-fomit-frame-pointer is included for any optimisation level above O2 (including Os) Setting MACOS_DEPLOYMENT_TARGET is unecessary if you are just setting it the same as the OS X you are running.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 909b8a535..9fbd04749 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -24,14 +24,12 @@
module HomebrewEnvExtension
# -w: keep signal to noise high
- # -fomit-frame-pointer: we are not debugging this software, we are using it
- SAFE_CFLAGS_FLAGS = "-w -pipe -fomit-frame-pointer"
+ SAFE_CFLAGS_FLAGS = "-w -pipe"
def setup_build_environment
# Clear CDPATH to avoid make issues that depend on changing directories
ENV.delete('CDPATH')
- ENV['MACOSX_DEPLOYMENT_TARGET']=MACOS_VERSION.to_s
ENV['MAKEFLAGS']="-j#{Hardware.processor_count}"
unless HOMEBREW_PREFIX.to_s == '/usr/local'
@@ -51,7 +49,7 @@ module HomebrewEnvExtension
ENV['CC'] = "#{prefix}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2"
ENV['CXX'] = "#{prefix}/usr/llvm-gcc-4.2/bin/llvm-g++-4.2"
- cflags = ['-O4'] # O4 baby!
+ cflags = %w{-O4} # link time optimisation baby!
else
ENV['CC']="gcc-4.2"
ENV['CXX']="g++-4.2"
@@ -94,7 +92,7 @@ module HomebrewEnvExtension
cflags<<"-msse3"
end
- ENV['CFLAGS']=ENV['CXXFLAGS']="#{cflags*' '} #{SAFE_CFLAGS_FLAGS} -mmacosx-version-min=#{MACOS_VERSION}"
+ ENV['CFLAGS'] = ENV['CXXFLAGS'] = "#{cflags*' '} #{SAFE_CFLAGS_FLAGS}"
end
def deparallelize
@@ -104,15 +102,19 @@ module HomebrewEnvExtension
def O3
# Sometimes O4 just takes fucking forever
- remove_from_cflags '-O4'
+ remove_from_cflags /-O./
append_to_cflags '-O3'
end
def O2
# Sometimes O3 doesn't work or produces bad binaries
- remove_from_cflags '-O4'
- remove_from_cflags '-O3'
+ remove_from_cflags /-O./
append_to_cflags '-O2'
end
+ def Os
+ # Sometimes you just want a small one
+ remove_from_cflags /-O./
+ append_to_cflags '-Os'
+ end
def gcc_4_0_1
case MACOS_VERSION
@@ -157,6 +159,7 @@ module HomebrewEnvExtension
def no_optimization
self['CFLAGS']=self['CXXFLAGS'] = SAFE_CFLAGS_FLAGS
end
+
def libxml2
append_to_cflags ' -I/usr/include/libxml2'
end
@@ -195,11 +198,7 @@ module HomebrewEnvExtension
# i386 and x86_64 only, no PPC
def universal_binary
append_to_cflags '-arch i386 -arch x86_64'
- if self['CFLAGS'].include? '-O4'
- # O4 seems to cause the build to fail
- remove_from_cflags '-O4'
- append_to_cflags '-O3'
- end
+ ENV.O3 if self['CFLAGS'].include? '-O4' # O4 seems to cause the build to fail
end
def prepend key, value, separator = ' '