all.sh: only check tools that are going to be used

Don't require openssl, mingw, etc. if we aren't going to run a
component that uses them.
This commit is contained in:
Gilles Peskine 2019-01-06 22:40:00 +00:00
parent e26ab189cb
commit 657f59a520

View file

@ -461,30 +461,50 @@ pre_print_configuration () {
echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR" echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR"
} }
# Make sure the tools we need are available.
pre_check_tools () { pre_check_tools () {
ARMC5_CC="$ARMC5_BIN_DIR/armcc" case " $RUN_COMPONENTS " in
ARMC5_AR="$ARMC5_BIN_DIR/armar" # Require OpenSSL and GnuTLS if running any tests (as opposed to
ARMC6_CC="$ARMC6_BIN_DIR/armclang" # only doing builds). Not all tests run OpenSSL and GnuTLS, but this
ARMC6_AR="$ARMC6_BIN_DIR/armar" # is a good enough approximation in practice.
*" test_"*)
# To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh # To avoid setting OpenSSL and GnuTLS for each call to compat.sh
# we just export the variables they require # and ssl-opt.sh, we just export the variables they require.
export OPENSSL_CMD="$OPENSSL" export OPENSSL_CMD="$OPENSSL"
export GNUTLS_CLI="$GNUTLS_CLI" export GNUTLS_CLI="$GNUTLS_CLI"
export GNUTLS_SERV="$GNUTLS_SERV" export GNUTLS_SERV="$GNUTLS_SERV"
# Avoid passing --seed flag in every call to ssl-opt.sh # Avoid passing --seed flag in every call to ssl-opt.sh
if [ -n "${SEED-}" ]; then if [ -n "${SEED-}" ]; then
export SEED export SEED
fi fi
# Make sure the tools we need are available.
check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$OPENSSL_NEXT" \ check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$OPENSSL_NEXT" \
"$GNUTLS_CLI" "$GNUTLS_SERV" \ "$GNUTLS_CLI" "$GNUTLS_SERV" \
"$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \ "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV"
"arm-none-eabi-gcc" "i686-w64-mingw32-gcc" "gdb" ;;
case $RUN_COMPONENTS in esac
case " $RUN_COMPONENTS " in
*_doxygen[_\ ]*) check_tools "doxygen" "dot";;
esac
case " $RUN_COMPONENTS " in
*_arm_none_eabi_gcc[_\ ]*) check_tools "arm-none-eabi-gcc";;
esac
case " $RUN_COMPONENTS " in
*_mingw[_\ ]*) check_tools "i686-w64-mingw32-gcc";;
esac
case " $RUN_COMPONENTS " in
*" test_zeroize "*) check_tools "gdb";;
esac
case " $RUN_COMPONENTS " in
*_armcc*) *_armcc*)
ARMC5_CC="$ARMC5_BIN_DIR/armcc"
ARMC5_AR="$ARMC5_BIN_DIR/armar"
ARMC6_CC="$ARMC6_BIN_DIR/armclang"
ARMC6_AR="$ARMC6_BIN_DIR/armar"
check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR";; check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR";;
esac esac
} }