aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-11-12 12:00:18 -0600
committerJack Nagel2013-11-12 13:53:29 -0600
commitc7b7fdf0ca45d0b139c28f55caf9392023f6f0ad (patch)
tree9dd057b2a9d9113df88bfdfdf885d77346a04ce9 /Library
parent0b793e321ee3b2984185f93178103b38db21369e (diff)
downloadbrew-c7b7fdf0ca45d0b139c28f55caf9392023f6f0ad.tar.bz2
Simplify ENV.0x methods in stdenv
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/std.rb46
1 files changed, 8 insertions, 38 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb
index 74d48df37..633ad9010 100644
--- a/Library/Homebrew/extend/ENV/std.rb
+++ b/Library/Homebrew/extend/ENV/std.rb
@@ -103,44 +103,14 @@ module Stdenv
end
alias_method :j1, :deparallelize
- # recommended by Apple, but, eg. wget won't compile with this flag, so…
- def fast
- remove_from_cflags(/-O./)
- append_to_cflags '-fast'
- end
- def O4
- # LLVM link-time optimization
- remove_from_cflags(/-O./)
- append_to_cflags '-O4'
- end
- def O3
- # Sometimes O4 just takes fucking forever
- remove_from_cflags(/-O./)
- append_to_cflags '-O3'
- end
- def O2
- # Sometimes O3 doesn't work or produces bad binaries
- 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 Og
- # Sometimes you want a debug build
- remove_from_cflags(/-O./)
- append_to_cflags '-g -O0'
- end
- def O1
- # Sometimes even O2 doesn't work :(
- remove_from_cflags(/-O./)
- append_to_cflags '-O1'
- end
- def O0
- remove_from_cflags(/-O./)
- append_to_cflags '-O0'
+ # These methods are no-ops for compatibility.
+ %w{fast Og}.each { |opt| define_method(opt) {} }
+
+ %w{O4 O3 O2 O1 O0 Os}.each do |opt|
+ define_method opt do
+ remove_from_cflags(/-O./)
+ append_to_cflags "-#{opt}"
+ end
end
def gcc_4_0_1