From 5f846be2e4a83f380eb41773d1493c637b0d5cd3 Mon Sep 17 00:00:00 2001 From: Mike Nolta Date: Tue, 2 Dec 2014 20:47:40 -0500 Subject: [PATCH] fix fortran compiler detection on FreeBSD On FreeBSD, passing extra options to `which` causes it to report a non-zero status: ``` $ which gfortran48 -m64 /usr/local/bin/gfortran48 $ echo $? 1 ``` ``` $ which gfortran48 /usr/local/bin/gfortran48 $ echo $? 0 ``` --- f_check | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/f_check b/f_check index 90ae2fe97..5719faff1 100644 --- a/f_check +++ b/f_check @@ -16,6 +16,7 @@ $config = shift(@ARGV); $nofortran = 0; $compiler = join(" ", @ARGV); +$compiler_bin = shift(@ARGV); # f77 is too ambiguous $compiler = "" if $compiler eq "f77"; @@ -53,7 +54,7 @@ if ($compiler eq "") { } else { - $data = `which $compiler > /dev/null 2> /dev/null`; + $data = `which $compiler_bin > /dev/null 2> /dev/null`; $vendor = ""; if (!$?) { @@ -204,7 +205,7 @@ if ($compiler eq "") { } } -$data = `which $compiler > /dev/null 2> /dev/null`; +$data = `which $compiler_bin > /dev/null 2> /dev/null`; if (!$?) {