aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-02-16 19:26:31 +0000
committerMax Howell2012-02-16 19:29:56 +0000
commit91042a1577ec3aab8c1132eb2c31b5b9cba8af62 (patch)
tree0a62a0fcdf52acc0d2c523365d1298c020c05b70 /Library
parent6223ac3e422fc8ed91e0dd10340284657ed86ad6 (diff)
downloadhomebrew-91042a1577ec3aab8c1132eb2c31b5b9cba8af62.tar.bz2
Fix default_cc
Dumb logic error. Also same one in MacOS.compiler. Am I getting old? Also it returns a string and not a float.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 452f1fd13..0357317ce 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -267,13 +267,11 @@ module MacOS extend self
end
def default_cc
- cc = if !File.file? "/usr/bin/cc" and xcode_version > 4.3
- # there is no cc file in Xcode 4.3.0 in the /Developer/usr/bin directory
- "llvm-gcc"
- else
- "cc"
- end
- Pathname.new("#{dev_tools_path}/cc").realpath.basename.to_s
+ cc = Pathname.new("#{dev_tools_path}/cc")
+ # Xcode 4.3.0 has no /Applications/Xcode/Contents/Developer/usr/bin/cc
+ # Xcode 4.3.0 has no GCC
+ cc = Pathname.new("#{dev_tools_path}/llvm-gcc") unless cc.file?
+ cc.realpath.basename.to_s
end
def default_compiler
@@ -283,7 +281,7 @@ module MacOS extend self
when "clang" then :clang
else
# guess :(
- if xcode_version > 4.2
+ if xcode_version >= "4.2"
:llvm
else
:gcc