STYLE: eliminate most use of _foamSource outside of the etc/ hierarchy

This commit is contained in:
Mark Olesen
2017-02-23 10:58:55 +01:00
parent cc51def1fd
commit 07ec2b3abd
4 changed files with 35 additions and 20 deletions

View File

@ -1,24 +1,33 @@
#!/bin/sh #!/bin/sh
#
# Build optional components (eg, may depend on third-party libraries)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Optional component: continue-on-error
# - may not have third-party installed
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for compilation (at least for error catching) # Parse arguments for compilation (at least for error catching)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Get version info and arch-path warning="==> skip ccmio"
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
then
. $settings
else
echo "$warning (no config.sh/ccmio settings)"
exit
fi
# Build libccmio (.a|.so) # Build libccmio (.a|.so) - use static linkage for fewer issues
$WM_THIRD_PARTY_DIR/makeCCMIO lib # libso $WM_THIRD_PARTY_DIR/makeCCMIO lib
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \ if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a \( -e $CCMIO_ARCH_PATH/lib/libccmio.a -o $FOAM_EXT_LIBBIN/libccmio.so \) ] -a \( -e $CCMIO_ARCH_PATH/lib/libccmio.a -o $FOAM_EXT_LIBBIN/libccmio.so \) ]
then then
wmake $targetType ccm26ToFoam wmake $targetType ccm26ToFoam
else
echo $warning
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
@ -31,9 +31,10 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# First load the standard versions, if necessary # First load the standard versions, if necessary
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler \ if foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler)
2>/dev/null) then
[ $? -eq 0 ] && _foamSource $foamFile . $foamFile
fi
unset foamFile unset foamFile
@ -57,7 +58,7 @@ Gcc48u)
export WM_CC='gcc-4.8' export WM_CC='gcc-4.8'
export WM_CXX='g++-4.8' export WM_CXX='g++-4.8'
;; ;;
Icc) Icc*)
# Example for ensuring that 3rd software uses the Icc compilers # Example for ensuring that 3rd software uses the Icc compilers
export WM_CC='icc' export WM_CC='icc'
export WM_CXX='icpc' export WM_CXX='icpc'

View File

@ -43,7 +43,7 @@ then
do do
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2 [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2
. $1 . $1
shift shift
done done
} }

View File

@ -1,18 +1,23 @@
#!/bin/sh #!/bin/sh
# Build optional components (eg, may depend on third-party libraries)
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Optional component: (eg, may depend on third-party libraries)
# Parse arguments for compilation (at least for error catching) # Parse arguments for compilation (at least for error catching)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
# Link with static libccmio only (possibly fewer issues)
warning="==> skip optional libccm adapter" warning="==> skip optional libccm adapter"
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
then
. $settings
else
echo "$warning (no config.sh/ccmio settings)"
exit
fi
# Link with static libccmio only (possibly fewer issues)
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \ if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ] -a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
then then