diff --git a/etc/bashrc b/etc/bashrc index 56d1663509..cd5e43239e 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -90,6 +90,22 @@ _foamSource() foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` && _foamSource $foamPrefs unset foamPrefs +# Evaluate command-line parameters +while [ $# -gt 0 ] +do + case "$1" in + *=) + # name= -> unset name + eval "unset ${1%=}" + ;; + *=*) + # name=value -> export name=value + eval "export $1" + ;; + esac + shift +done + # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/cshrc b/etc/cshrc index 77d2d6543c..95a594da6b 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -78,6 +78,21 @@ if ( $status == 0 ) then endif unset foamPrefs +# Evaluate command-line parameters +while ( $#argv > 0 ) + switch ($argv[1]) + case *=: + # name= -> unsetenv name + eval "unsetenv $argv[1]:s/=//" + breaksw + case *=*: + # name=value -> setenv name value + eval "setenv $argv[1]:s/=/ /" + breaksw + endsw + shift +end + # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/settings.csh b/etc/settings.csh index 4bde0e7ee0..dc70c7fb48 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -121,7 +121,10 @@ case OpenFOAM: set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version - set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version + if ( $?mpc_version ) then + set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version + endif + # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then