aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index f26fdb4ab..fec709ffb 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -161,11 +161,17 @@ module SharedEnvExtension
EOS
end
- elsif (gfortran = which('gfortran', ORIGINAL_PATHS.join(File::PATH_SEPARATOR)))
- ohai "Using Homebrew-provided fortran compiler."
- puts "This may be changed by setting the FC environment variable."
- self['FC'] = self['F77'] = gfortran
- flags = FC_FLAG_VARS
+ else
+ if (gfortran = which('gfortran', (HOMEBREW_PREFIX/'bin').to_s))
+ ohai "Using Homebrew-provided fortran compiler."
+ elsif (gfortran = which('gfortran', ORIGINAL_PATHS.join(File::PATH_SEPARATOR)))
+ ohai "Using a fortran compiler found at #{gfortran}."
+ end
+ if gfortran
+ puts "This may be changed by setting the FC environment variable."
+ self['FC'] = self['F77'] = gfortran
+ flags = FC_FLAG_VARS
+ end
end
flags.each { |key| self[key] = cflags }