From f437c9040b08d1950aeaedb8417e22752b285c25 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 26 Dec 2011 12:03:55 -0600 Subject: Resolve multi-level gcc symlinks In later XCodes, gcc is a symlink to gcc-4.2 which is itself a symlink to llvm-gcc, so it is necessary to resolve multiple symlinks. Signed-off-by: Jack Nagel --- Library/Homebrew/extend/ENV.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 9f9579109..b1ff5d9cf 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -90,8 +90,7 @@ module HomebrewEnvExtension @compiler = :gcc raise "GCC could not be found" if args[:force] and not File.exist? ENV['CC'] \ - or (File.symlink? ENV['CC'] \ - and File.readlink(ENV['CC']) =~ /llvm/) + or (Pathname.new(ENV['CC']).realpath.to_s =~ /llvm/) end alias_method :gcc_4_2, :gcc -- cgit v1.2.3