Use Fortran ENV helpers

This commit is contained in:
Adam Vandenberg 2013-06-23 20:39:26 -07:00
parent 5852d2fbe3
commit 0f7f5229f1
5 changed files with 12 additions and 12 deletions

View file

@ -11,7 +11,7 @@ class Dotwrp < Formula
def install
# note: fno-underscoring is vital to override the symbols in Accelerate
system "#{ENV["FC"]} #{ENV["FFLAGS"]} -fno-underscoring -c dotwrp.f90"
system "#{ENV.fc} #{ENV.fflags} -fno-underscoring -c dotwrp.f90"
system "ar -cru libdotwrp.a dotwrp.o"
system "ranlib libdotwrp.a"

View file

@ -36,7 +36,7 @@ class Netcdf < Formula
# the library libnetcdff.dylib to be missing all the f90 symbols.
# http://www.unidata.ucar.edu/software/netcdf/docs/known_problems.html#intel-fortran-macosx
# https://github.com/mxcl/homebrew/issues/13050
ENV['lt_cv_ld_force_load'] = 'no' if ENV['FC'] == 'ifort'
ENV['lt_cv_ld_force_load'] = 'no' if ENV.fc == 'ifort'
end
common_args = %W[

View file

@ -45,8 +45,8 @@ class Pgplot < Formula
ATHENA_INCL=""
TK_INCL=""
RV_INCL=""
FCOMPL="#{ENV['FC']}"
FFLAGC="#{ENV['FCFLAGS']}"
FCOMPL="#{ENV.fc}"
FFLAGC="#{ENV.fcflags}"
FFLAGD=""
CCOMPL="#{ENV.cc}"
CFLAGC="#{ENV.cppflags}"
@ -58,13 +58,13 @@ class Pgplot < Formula
TK_LIBS=""
RANLIB="#{which 'ranlib'}"
SHARED_LIB="libpgplot.dylib"
SHARED_LD="#{ENV['FC']} -dynamiclib -single_module $LDFLAGS -lX11 -install_name libpgplot.dylib"
SHARED_LD="#{ENV.fc} -dynamiclib -single_module $LDFLAGS -lX11 -install_name libpgplot.dylib"
SHARED_LIB_LIBS="#{ENV.ldflags} -lpng -lX11"
MCOMPL=""
MFLAGC=""
SYSDIR="$SYSDIR"
CSHARED_LIB="libcpgplot.dylib"
CSHARED_LD="#{ENV['FC']} -dynamiclib -single_module $LDFLAGS -lX11"
CSHARED_LD="#{ENV.fc} -dynamiclib -single_module $LDFLAGS -lX11"
EOS
mkdir 'build' do
@ -90,7 +90,7 @@ class Pgplot < Formula
# install libbutton
if build.include? 'with-button'
Button.new.brew do
inreplace 'Makefile', 'f77', "#{ENV['FC']} #{ENV['FCFLAGS']}"
inreplace 'Makefile', 'f77', "#{ENV.fc} #{ENV.fcflags}"
system "make"
lib.install 'libbutton.a'
end

View file

@ -13,9 +13,9 @@ class Qrupdate < Formula
ENV['PREFIX'] = prefix
inreplace 'Makeconf' do |s|
s.gsub! /^(FC=).*/, "\\1#{HOMEBREW_PREFIX}/bin/gfortran"
s.gsub! /^(FFLAGS=).*/, "\\1#{ENV['FCFLAGS']}"
s.gsub! /^(BLAS=).*/, "\\1#{ENV["LDFLAGS"]} -ldotwrp -framework Accelerate"
s.gsub! /^(LAPACK=).*/, "\\1#{ENV["LDFLAGS"]} -ldotwrp -framework Accelerate"
s.gsub! /^(FFLAGS=).*/, "\\1#{ENV.fcflags}"
s.gsub! /^(BLAS=).*/, "\\1#{ENV.ldflags} -ldotwrp -framework Accelerate"
s.gsub! /^(LAPACK=).*/, "\\1#{ENV.ldflags} -ldotwrp -framework Accelerate"
end
cd "./src"
inreplace 'Makefile' do |s|

View file

@ -12,8 +12,8 @@ class Slicot < Formula
def install
args = [
"FORTRAN=#{ENV['FC']}",
"LOADER=#{ENV['FC']}",
"FORTRAN=#{ENV.fc}",
"LOADER=#{ENV.fc}",
"LAPACKLIB='-framework Accelerate'",
]