mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove bash4-isms from configuration script
Getting uppercase of a string can be done in a way that is compatible with Bash 3.2. This creates a dependency on the `tr` utility, but I reckon it will/can be available everywhere Bash 3.2 is.
This commit is contained in:
24
cmake/Scripts/configure
vendored
24
cmake/Scripts/configure
vendored
@@ -139,6 +139,11 @@ if [ "${CMAKE_COMMAND}" = "" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# helper routine
|
||||
uppercase () {
|
||||
echo "$@" | tr [a-z-] [A-Z_]
|
||||
}
|
||||
|
||||
for OPT in "$@"; do
|
||||
case "$OPT" in
|
||||
--*)
|
||||
@@ -207,7 +212,7 @@ for OPT in "$@"; do
|
||||
dune |\
|
||||
dune-* |\
|
||||
zlib)
|
||||
rootvar="${pkgname^^}_ROOT"
|
||||
rootvar="$(uppercase ${pkgname})_ROOT"
|
||||
rootvar="${rootvar/-/_}"
|
||||
;;
|
||||
*)
|
||||
@@ -225,15 +230,6 @@ for OPT in "$@"; do
|
||||
pkgname=$OPTARG
|
||||
pkgname=${pkgname#disable-}
|
||||
pkgname=${pkgname#without-}
|
||||
# special aliases
|
||||
case "${pkgname}" in
|
||||
umfpack)
|
||||
pkgname="SuiteSparse"
|
||||
;;
|
||||
tinyxml)
|
||||
pkgname="TinyXML"
|
||||
;;
|
||||
esac
|
||||
# casing is of course different
|
||||
case "${pkgname}" in
|
||||
option-checking)
|
||||
@@ -291,7 +287,7 @@ for OPT in "$@"; do
|
||||
;;
|
||||
ert |\
|
||||
superlu)
|
||||
pkgname="${pkgname^^}"
|
||||
pkgname="$(uppercase ${pkgname})"
|
||||
;;
|
||||
openmp)
|
||||
pkgname="OpenMP"
|
||||
@@ -299,6 +295,12 @@ for OPT in "$@"; do
|
||||
gxx11check)
|
||||
pkgname="CXX11Features"
|
||||
;;
|
||||
umfpack)
|
||||
pkgname="SuiteSparse"
|
||||
;;
|
||||
tinyxml)
|
||||
pkgname="TinyXML"
|
||||
;;
|
||||
*)
|
||||
invalid_opt --disable-${pkgname}
|
||||
pkgname=""
|
||||
|
||||
Reference in New Issue
Block a user