aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index f75d40ecf..6256f8564 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -192,8 +192,9 @@ module SharedEnvExtension
version = name[GNU_GCC_REGEXP, 1]
gcc_version_name = "gcc#{version.delete('.')}"
- if HOMEBREW_PREFIX.join("opt", "gcc", "bin", name).exist?
- Formulary.factory("gcc")
+ gcc = Formulary.factory("gcc")
+ if gcc.opt_bin.join(name).exist?
+ gcc
else
Formulary.factory(gcc_version_name)
end