aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMisty De Meo2011-11-25 19:30:42 -0600
committerAdam Vandenberg2011-11-25 17:50:14 -0800
commit7992c66560172cf80da87796749a9c650380923e (patch)
tree64347b5906bfe5823ca75cb0b1e3143c6757c215 /Library/Homebrew/utils.rb
parent46a4ef73b4a4b5d8ecad399496981907c1dfded6 (diff)
downloadhomebrew-7992c66560172cf80da87796749a9c650380923e.tar.bz2
Utils: update gcc version detection logic
Homebrew was attempting to check the version of gcc-4.0 and gcc-4.2 even if they don't exist, causing `doctor` and `--config` to throw nasty errors. Also fixes the broken missing gcc-4.2 detection, which was confusing Xcode 4.2 users. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb18
1 files changed, 4 insertions, 14 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 02f286a94..8eca952de 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -261,26 +261,16 @@ module MacOS extend self
end
def gcc_42_build_version
- `/usr/bin/gcc-4.2 --version` =~ /build (\d{4,})/
- if $1
+ @gcc_42_build_version ||= if File.exist? "/usr/bin/gcc-4.2"
+ `/usr/bin/gcc-4.2 --version` =~ /build (\d{4,})/
$1.to_i
- elsif system "/usr/bin/which gcc"
- # Xcode 3.0 didn't come with gcc-4.2
- # We can't change the above regex to use gcc because the version numbers
- # are different and thus, not useful.
- # FIXME I bet you 20 quid this causes a side effect — magic values tend to
- 401
- else
- nil
end
end
def gcc_40_build_version
- `/usr/bin/gcc-4.0 --version` =~ /build (\d{4,})/
- if $1
+ @gcc_40_build_version ||= if File.exist? "/usr/bin/gcc-4.0"
+ `/usr/bin/gcc-4.0 --version` =~ /build (\d{4,})/
$1.to_i
- else
- nil
end
end