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 <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2011-12-26 12:03:55 -06:00
parent 33db0a9665
commit f437c9040b

View File

@ -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