Skip to content

Commit 5f846be

Browse files
committed
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 ```
1 parent fe7dcf9 commit 5f846be

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

f_check

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $config = shift(@ARGV);
1616
$nofortran = 0;
1717

1818
$compiler = join(" ", @ARGV);
19+
$compiler_bin = shift(@ARGV);
1920

2021
# f77 is too ambiguous
2122
$compiler = "" if $compiler eq "f77";
@@ -53,7 +54,7 @@ if ($compiler eq "") {
5354

5455
} else {
5556

56-
$data = `which $compiler > /dev/null 2> /dev/null`;
57+
$data = `which $compiler_bin > /dev/null 2> /dev/null`;
5758
$vendor = "";
5859

5960
if (!$?) {
@@ -204,7 +205,7 @@ if ($compiler eq "") {
204205
}
205206
}
206207

207-
$data = `which $compiler > /dev/null 2> /dev/null`;
208+
$data = `which $compiler_bin > /dev/null 2> /dev/null`;
208209

209210
if (!$?) {
210211

0 commit comments

Comments
 (0)