diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index c0e0c33965..99704ec69f 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -76,7 +76,7 @@ class DevelopmentTools def non_apple_gcc_version(cc) (@non_apple_gcc_version ||= {}).fetch(cc) do - path = HOMEBREW_PREFIX/"opt/gcc/bin"/cc + path = HOMEBREW_PREFIX/"opt/#{CompilerSelector.preferred_gcc}/bin"/cc path = locate(cc) unless path.exist? version = if path && build_version = `#{path} --version`[/gcc(?:(?:-\d+(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1]