Commit 42b75855 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Replace grep with case.

* This saves on external commands in configure phase.
* Also, using sed -n 1,5p instead of sed 5q prevents ifort from dying on SIGPIPE.
parent f013bea3
......@@ -80,28 +80,26 @@ AC_DEFUN([_ACX_FIND_CFORTRAN_DEF],
AS_VAR_PUSHDEF([acx_FCFLAGS],[AC_LANG_CASE([Fortran],[FCFLAGS],[Fortran 77],[FFLAGS])])dnl
[acx_temp=`$acx_FC -V 2>&1 | sed 5q`
AS_IF([echo "$acx_temp" | grep '^Copyright.*\(The Portland Group\|NVIDIA CORPORATION\)' >/dev/null],
[echo "$acx_temp" | grep '^NAG Fortran Compiler Release' >/dev/null],
[AS_CASE([`$acx_FC -V 2>&1 | sed -n 1,5p`],
[*NAG\ Fortran\ Compiler\ Release*],
[echo "$acx_temp" | grep '^Intel(R) Fortran.*Compiler' >/dev/null],
[echo "$acx_temp" | grep '^Cray Fortran' >/dev/null],
[*Copyright*The\ Portland\ Group*|*Copyright*NVIDIA\ CORPORATION*|*Intel\(R\)\ Fortran*Compiler*|*Cray\ Fortran*],
[acx_temp=`$acx_FC --version 2>&1 | sed 5q` \
&& echo $acx_temp | grep '^GNU Fortran' >/dev/null],
[AS_IF([echo $acx_temp | grep g77 >/dev/null],
[AS_CASE([`$acx_FC --version 2>&1 | sed -n 1,5p`],
[*GNU\ Fortran*g77*],
[*GNU\ Fortran*],
[dnl assume gfortran
dnl check if compiling with f2c bindings or with default bindings
AS_IF([echo "$acx_FCFLAGS" | grep '^\(.* \)*-ff2c\( .*\)*$' >/dev/null],
AS_CASE([" $acx_FCFLAGS "],
[*\ -ff2c\ *],
[echo $acx_temp | grep '^G95' >/dev/null],
[$acx_FC -v 2>&1 | sed 5q | grep '^f2c' >/dev/null],
[AS_CASE([`$acx_FC -v 2>&1 | sed -n 1,5p`],
[AS_IF([$acx_FC -qversion 2>&1 | sed 5q | grep '^IBM XL Fortran' >/dev/null],
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment