aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-06-28 12:50:10 -0500
committerJack Nagel2012-06-28 14:12:50 -0500
commitf1667d9c31afa33b7ac9dbd0e469a8fb2a9644a5 (patch)
treecadfd9e838f80a915aefc43ad33c88a2b57f36e6 /Library
parent20cdf74e0876b9f44e66f5b6be7331817ef84d8c (diff)
downloadhomebrew-f1667d9c31afa33b7ac9dbd0e469a8fb2a9644a5.tar.bz2
Organize compiler methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/macos.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index d0b1670d9..b237ae94f 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -175,21 +175,6 @@ module MacOS extend self
end
end
- def gcc_42_build_version
- @gcc_42_build_version ||= if File.exist? "#{dev_tools_path}/gcc-4.2" \
- and not Pathname.new("#{dev_tools_path}/gcc-4.2").realpath.basename.to_s =~ /^llvm/
- `#{dev_tools_path}/gcc-4.2 --version` =~ /build (\d{4,})/
- $1.to_i
- end
- end
-
- def gcc_40_build_version
- @gcc_40_build_version ||= if File.exist? "#{dev_tools_path}/gcc-4.0"
- `#{dev_tools_path}/gcc-4.0 --version` =~ /build (\d{4,})/
- $1.to_i
- end
- end
-
def xcode_prefix
@xcode_prefix ||= begin
path = Pathname.new xcode_folder
@@ -305,6 +290,21 @@ module MacOS extend self
end
end
+ def gcc_40_build_version
+ @gcc_40_build_version ||= if locate("gcc-4.0")
+ `#{locate("gcc-4.0")} --version` =~ /build (\d{4,})/
+ $1.to_i
+ end
+ end
+
+ def gcc_42_build_version
+ @gcc_42_build_version ||= if locate("gcc-4.2") \
+ and not locate("gcc-4.2").realpath.basename.to_s =~ /^llvm/
+ `#{locate("gcc-4.2")} --version` =~ /build (\d{4,})/
+ $1.to_i
+ end
+ end
+
def llvm_build_version
# for Xcode 3 on OS X 10.5 this will not exist
# NOTE may not be true anymore but we can't test