2016-07-19 13:54:17 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# output_env.sh
|
|
|
|
#
|
|
|
|
# This file is part of mbed TLS (https://tls.mbed.org)
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016, ARM Limited, All Rights Reserved
|
|
|
|
#
|
|
|
|
# Purpose
|
|
|
|
#
|
|
|
|
# To print out all the relevant information about the development environment.
|
|
|
|
#
|
|
|
|
# This includes:
|
|
|
|
# - architecture of the system
|
|
|
|
# - type and version of the operating system
|
2016-09-04 11:28:44 +00:00
|
|
|
# - version of armcc, clang, gcc-arm and gcc compilers
|
|
|
|
# - version of libc, clang, asan and valgrind if installed
|
2016-07-19 13:54:17 +00:00
|
|
|
# - version of gnuTLS and OpenSSL
|
|
|
|
|
|
|
|
echo
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* Operating system and architecture:"
|
2016-07-19 13:54:17 +00:00
|
|
|
uname -a
|
|
|
|
|
|
|
|
echo
|
2016-09-27 14:05:15 +00:00
|
|
|
if [ -n "${ARMC5_CC+set}" ]; then
|
|
|
|
if `hash "$ARMC5_CC" > /dev/null 2>&1`; then
|
|
|
|
echo "* $ARMC5_CC at environment variable 'ARMC5_CC':"
|
|
|
|
$ARMC5_CC --vsn | head -n 2
|
|
|
|
else
|
|
|
|
echo "* $ARMC5_CC at environment variable 'ARMC5_CC' not found!"
|
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
else
|
2016-09-27 14:05:15 +00:00
|
|
|
if `hash armcc > /dev/null 2>&1`; then
|
|
|
|
echo "* armcc:"
|
|
|
|
armcc --vsn | head -n 2
|
|
|
|
else
|
|
|
|
echo "* armcc not found!"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${ARMC6_CC+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$ARMC6_CC" > /dev/null 2>&1`; then
|
|
|
|
echo "* $ARMC6_CC at environment variable 'ARMC6_CC':"
|
|
|
|
$ARMC6_CC --vsn | head -n 2
|
|
|
|
else
|
|
|
|
echo "* $ARMC6_CC at environment variable 'ARMC6_CC' not found!"
|
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash arm-none-eabi-gcc > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gcc-arm:"
|
2016-07-19 13:54:17 +00:00
|
|
|
arm-none-eabi-gcc --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gcc-arm not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash gcc > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gcc:"
|
2016-07-19 13:54:17 +00:00
|
|
|
gcc --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gcc not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash clang > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* clang:"
|
2016-07-19 13:54:17 +00:00
|
|
|
clang --version | head -n 2
|
|
|
|
clang -v 2>&1 | grep Selected
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* clang not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash ldd > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* libc:"
|
2016-07-19 13:54:17 +00:00
|
|
|
ldd --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* No ldd present: can't determine libc version!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash valgrind > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* valgrind:"
|
2016-07-19 13:54:17 +00:00
|
|
|
valgrind --version
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* valgrind not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash openssl > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* openssl:"
|
2016-07-19 13:54:17 +00:00
|
|
|
openssl version
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* openssl not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${OPENSSL+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$OPENSSL" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $OPENSSL at environment variable 'OPENSSL':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$OPENSSL version
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $OPENSSL at environment variable 'OPENSSL' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${OPENSSL_LEGACY+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$OPENSSL_LEGACY" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$OPENSSL_LEGACY version
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash gnutls-cli > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gnuTLS client:"
|
2016-07-19 13:54:17 +00:00
|
|
|
gnutls-cli --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gnuTLS client not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash gnutls-serv > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gnuTLS server:"
|
2016-07-19 13:54:17 +00:00
|
|
|
gnutls-serv --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* gnuTLS server not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${GNUTLS_CLI+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$GNUTLS_CLI" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$GNUTLS_CLI --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${GNUTLS_SERV+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$GNUTLS_SERV" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$GNUTLS_SERV --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$GNUTLS_LEGACY_CLI" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$GNUTLS_LEGACY_CLI --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
|
|
|
|
echo
|
|
|
|
if `hash "$GNUTLS_LEGACY_SERV" > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV':"
|
2016-09-05 11:24:47 +00:00
|
|
|
$GNUTLS_LEGACY_SERV --version | head -n 1
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV' not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
if `hash dpkg > /dev/null 2>&1`; then
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* asan:"
|
2016-07-19 13:54:17 +00:00
|
|
|
dpkg -s libasan2 2> /dev/null | grep -i version
|
|
|
|
dpkg -s libasan1 2> /dev/null | grep -i version
|
|
|
|
dpkg -s libasan0 2> /dev/null | grep -i version
|
|
|
|
else
|
2016-09-09 14:30:29 +00:00
|
|
|
echo "* No dpkg present: can't determine asan version!"
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2016-09-04 11:28:44 +00:00
|
|
|
|