CONFIG: adjustments to environment

- provide default WM_DIR if not already set, to improve robustness if a
  reduced environment is used

- add etc/ to WM_PROJECT_SITE search. This makes the site directory
  structure consistent with the OpenFOAM structure.
  Eg,

      WM_PROJECT_SITE/etc/..
      WM_PROJECT_SITE/bin/..
      WM_PROJECT_SITE/platforms/..

- Don't set/export WM_OSTYPE.  The default is POSIX and is properly
  defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
  Catalyst)
This commit is contained in:
Mark Olesen
2018-12-03 09:50:48 +01:00
parent e917586574
commit b8c257d6ad
19 changed files with 112 additions and 69 deletions

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -18,7 +18,14 @@
# Ensure these variables are always defined
MakeDir=Make
: ${Script:=wmakeFunctions}
: "${Script:=wmakeFunctions}"
# Environment defaults
if [ -z "$WM_DIR" ]
then
WM_DIR="$WM_PROJECT_DIR/wmake"
export WM_DIR
fi
#------------------------------------------------------------------------------
@ -27,13 +34,18 @@ MakeDir=Make
checkEnv()
{
local check failed
for check in WM_PROJECT_DIR WM_OPTIONS WM_DIR
do
eval test "\$$check" || {
echo "$Script error: Environment variable \$$check not set" 1>&2
exit 1
}
eval test "\$$check" || failed="$failed $check"
done
[ -z "$failed" ] || {
echo "$Script error: Environment variable(s) not set" 1>&2
echo " $failed" 1>&2
exit 1
}
}