Correctly find Homebrew-installed fortran

Fixes Homebrew/homebrew#26338.
Closes Homebrew/homebrew#26352.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Camillo Lugaresi 2014-02-02 12:57:46 -06:00 committed by Jack Nagel
parent d885d98164
commit cbd14fde1e

View File

@ -161,11 +161,17 @@ module SharedEnvExtension
EOS EOS
end end
elsif (gfortran = which('gfortran', ORIGINAL_PATHS.join(File::PATH_SEPARATOR))) else
ohai "Using Homebrew-provided fortran compiler." if (gfortran = which('gfortran', (HOMEBREW_PREFIX/'bin').to_s))
puts "This may be changed by setting the FC environment variable." ohai "Using Homebrew-provided fortran compiler."
self['FC'] = self['F77'] = gfortran elsif (gfortran = which('gfortran', ORIGINAL_PATHS.join(File::PATH_SEPARATOR)))
flags = FC_FLAG_VARS 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 end
flags.each { |key| self[key] = cflags } flags.each { |key| self[key] = cflags }