configure: fix several shellcheck warnings
This commit is contained in:
parent
ad7852d9c2
commit
f16471aad4
27
configure
vendored
27
configure
vendored
@ -1,31 +1,34 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
printf "Running on "
|
printf 'Running on '
|
||||||
case `uname -s` in
|
case $(uname -s) in
|
||||||
Linux*) echo "Linux" ;;
|
Linux*) echo 'Linux' ;;
|
||||||
Darwin*) echo "Mac" ;;
|
Darwin*) echo 'Mac' ;;
|
||||||
[CIGWIN,MINGW]*) echo "Windows" ;;
|
CYGWIN*|MSYS*|MINGW*) echo 'Windows' ;;
|
||||||
*) echo "unknown OS" ;;
|
*) echo 'unknown OS' ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "OS version " && uname -r
|
os=$(uname -r)
|
||||||
|
printf 'OS version %s\n' "$os"
|
||||||
|
|
||||||
arch=`uname -m`
|
arch=$(uname -m)
|
||||||
echo "Processor architecture $arch"
|
printf 'Processor architecture %s\n' "$arch"
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
printf "Looking for %s... " $1 && command -v $1 || (echo "not found"; exit 1)
|
printf 'Looking for %s... ' "$1"
|
||||||
|
command -v "$1" || (echo 'not found'; exit 1)
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
for FC in ifort gfortran f77; do
|
for FC in ifort gfortran f77; do
|
||||||
check $FC && break
|
check $FC && break
|
||||||
done
|
done
|
||||||
|
# shellcheck disable=SC2181
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Fortran compiler not found. Cannot proceed"
|
printf 'Fortran compiler not found. Cannot proceed\n'
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Use $FC as Fortran compiler"
|
printf 'Use %s as Fortran compiler\n' "$FC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# $FC --version
|
# $FC --version
|
||||||
|
Loading…
Reference in New Issue
Block a user