aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCamillo Lugaresi2014-02-02 12:57:46 -0600
committerJack Nagel2014-02-02 14:13:53 -0500
commit9f3c074e12523bcbf2381ec6757db01b29336a77 (patch)
tree680bc16d7b307d944cda312c1ea92c9b944a2178 /Library
parentd9c23fbd990ec4e4d6a32c25ed65d4634432f2e6 (diff)
downloadhomebrew-9f3c074e12523bcbf2381ec6757db01b29336a77.tar.bz2
Correctly find Homebrew-installed fortran
Fixes #26338. Closes #26352. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
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 }