CONFIG: accept module-prefix 'none' as equivalent to 'false' (ie, disabled)
This commit is contained in:
parent
53e91f12db
commit
aab61cc6b3
4
Allwmake
4
Allwmake
@ -73,10 +73,10 @@ echo
|
|||||||
applications/Allwmake $targetType $*
|
applications/Allwmake $targetType $*
|
||||||
|
|
||||||
# Additional components/modules
|
# Additional components/modules
|
||||||
if [ "$FOAM_MODULE_PREFIX" = false ]
|
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||||
then
|
then
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "OpenFOAM modules disabled (prefix=false)"
|
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||||
echo
|
echo
|
||||||
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
||||||
then
|
then
|
||||||
|
@ -12,7 +12,13 @@ targetType=libso
|
|||||||
export FOAM_MODULE_PREFIX
|
export FOAM_MODULE_PREFIX
|
||||||
|
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "Compile OpenFOAM modules"
|
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||||
|
then
|
||||||
|
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||||
|
echo
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "prefix = $FOAM_MODULE_PREFIX"
|
echo "prefix = $FOAM_MODULE_PREFIX"
|
||||||
echo
|
echo
|
||||||
echo " ignoring possible compilation errors"
|
echo " ignoring possible compilation errors"
|
||||||
|
@ -111,8 +111,8 @@ do
|
|||||||
# Prefix: openfoam (other)
|
# Prefix: openfoam (other)
|
||||||
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
# Prefix: false (ie, 'disabled')
|
# Prefix: false | none (ie, 'disabled')
|
||||||
(false) FOAM_MODULE_PREFIX=false ;;
|
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||||
|
|
||||||
# Prefix: directory (absolute or relative)
|
# Prefix: directory (absolute or relative)
|
||||||
(*)
|
(*)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2015-2016 OpenFOAM Foundation
|
# Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -55,6 +55,43 @@ checkEnv()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Set FOAM_MODULE_PREFIX according to
|
||||||
|
# - absolute/relative path
|
||||||
|
# - predefined type (u,user | g,group | o,openfoam)
|
||||||
|
setModulePrefix()
|
||||||
|
{
|
||||||
|
export FOAM_MODULE_PREFIX="$1"
|
||||||
|
case "$FOAM_MODULE_PREFIX" in
|
||||||
|
# Prefix: user
|
||||||
|
(u | user) FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: group
|
||||||
|
(g | group) FOAM_MODULE_PREFIX="${FOAM_SITE_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: openfoam (other)
|
||||||
|
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||||
|
|
||||||
|
# Prefix: false | none (ie, 'disabled')
|
||||||
|
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||||
|
|
||||||
|
# Prefix: directory (absolute or relative)
|
||||||
|
(*)
|
||||||
|
: "${FOAM_MODULE_PREFIX:=/usr/local}" # Fallback (autoconf-like)
|
||||||
|
|
||||||
|
# Require absolute path
|
||||||
|
[ "${FOAM_MODULE_PREFIX#/}" != "${FOAM_MODULE_PREFIX}" ] || \
|
||||||
|
FOAM_MODULE_PREFIX="${PWD}/${FOAM_MODULE_PREFIX}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Avoid potential conflicts
|
||||||
|
unset FOAM_MODULE_APPBIN FOAM_MODULE_LIBBIN
|
||||||
|
echo "Module prefix = ${FOAM_MODULE_PREFIX:-[]}" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Return the absolute (physical) path for a directory or
|
# Return the absolute (physical) path for a directory or
|
||||||
# for a file's parent directory
|
# for a file's parent directory
|
||||||
# expandPath dirName
|
# expandPath dirName
|
||||||
|
Loading…
Reference in New Issue
Block a user