2016-10-04 18:14:38 +02:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
2016-07-19 15:54:17 +02:00
|
|
|
# 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 13:28:44 +02:00
|
|
|
# - version of armcc, clang, gcc-arm and gcc compilers
|
|
|
|
# - version of libc, clang, asan and valgrind if installed
|
2016-07-19 15:54:17 +02:00
|
|
|
# - version of gnuTLS and OpenSSL
|
|
|
|
|
2016-10-04 18:14:38 +02:00
|
|
|
print_version()
|
|
|
|
{
|
|
|
|
BIN="$1"
|
|
|
|
shift
|
|
|
|
ARGS="$1"
|
|
|
|
shift
|
2020-02-26 16:29:40 +01:00
|
|
|
VARIANT=$1
|
2016-10-04 18:14:38 +02:00
|
|
|
shift
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
if [ ! -z $VARIANT ]; then
|
|
|
|
VARIANT=" ($VARIANT)"
|
|
|
|
fi
|
|
|
|
|
2016-10-04 18:14:38 +02:00
|
|
|
if ! `type "$BIN" > /dev/null 2>&1`; then
|
2020-02-26 16:29:40 +01:00
|
|
|
echo " * ${BIN##*/}$VARIANT: Not found."
|
2016-10-04 18:14:38 +02:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
BIN=`which "$BIN"`
|
|
|
|
VERSION_STR=`$BIN $ARGS 2>&1`
|
|
|
|
|
|
|
|
# Apply all filters
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
FILTER="$1"
|
|
|
|
shift
|
|
|
|
VERSION_STR=`echo "$VERSION_STR" | $FILTER`
|
|
|
|
done
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
echo " * ${BIN##*/}$VARIANT: ${BIN} : ${VERSION_STR} "
|
2016-10-04 18:14:38 +02:00
|
|
|
}
|
2016-07-19 15:54:17 +02:00
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
echo "Platform:\n"
|
|
|
|
if `type "lsb_release" > /dev/null 2>&1`; then
|
|
|
|
echo "Linux variant"
|
|
|
|
lsb_release -d -c
|
|
|
|
else
|
|
|
|
echo "Unknown Unix variant"
|
|
|
|
fi
|
|
|
|
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
2016-09-27 16:05:15 +02:00
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "uname" "-a" ""
|
|
|
|
echo "\n"
|
|
|
|
echo "Tool Versions:\n"
|
|
|
|
|
2018-03-21 08:35:07 +01:00
|
|
|
if [ "${RUN_ARMCC:-1}" -ne 0 ]; then
|
|
|
|
: "${ARMC5_CC:=armcc}"
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$ARMC5_CC" "--vsn" "" "head -n 2"
|
2018-03-21 08:35:07 +01:00
|
|
|
echo
|
2016-07-19 15:54:17 +02:00
|
|
|
|
2018-03-21 08:35:07 +01:00
|
|
|
: "${ARMC6_CC:=armclang}"
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$ARMC6_CC" "--vsn" "" "head -n 2"
|
2018-03-21 08:35:07 +01:00
|
|
|
echo
|
|
|
|
fi
|
2016-07-19 15:54:17 +02:00
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "arm-none-eabi-gcc" "--version" "" "head -n 1"
|
|
|
|
echo
|
|
|
|
|
|
|
|
print_version "gcc" "--version" "" "head -n 1"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "clang" "--version" "" "head -n 2"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "ldd" "--version" "" "head -n 1"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "valgrind" "--version" ""
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "gdb" "--version" "" "head -n 1"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
2016-09-05 13:24:47 +02:00
|
|
|
|
2016-10-04 18:14:38 +02:00
|
|
|
: ${OPENSSL:=openssl}
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$OPENSSL" "version" "default"
|
2016-10-04 18:14:38 +02:00
|
|
|
echo
|
2016-09-05 13:24:47 +02:00
|
|
|
|
|
|
|
if [ -n "${OPENSSL_LEGACY+set}" ]; then
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$OPENSSL_LEGACY" "version" "legacy"
|
|
|
|
else
|
|
|
|
echo " * openssl (legacy): Not configured."
|
2016-07-19 15:54:17 +02:00
|
|
|
fi
|
2020-02-26 16:29:40 +01:00
|
|
|
echo
|
2016-07-19 15:54:17 +02:00
|
|
|
|
2016-10-04 18:14:38 +02:00
|
|
|
: ${GNUTLS_CLI:=gnutls-cli}
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$GNUTLS_CLI" "--version" "default" "head -n 1"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
|
|
|
|
2016-10-04 18:14:38 +02:00
|
|
|
: ${GNUTLS_SERV:=gnutls-serv}
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$GNUTLS_SERV" "--version" "default" "head -n 1"
|
2016-07-19 15:54:17 +02:00
|
|
|
echo
|
2016-09-05 13:24:47 +02:00
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$GNUTLS_LEGACY_CLI" "--version" "legacy" "head -n 1"
|
|
|
|
else
|
|
|
|
echo " * gnutls-cli (legacy): Not configured."
|
2016-09-05 13:24:47 +02:00
|
|
|
fi
|
2020-02-26 16:29:40 +01:00
|
|
|
echo
|
2016-09-05 13:24:47 +02:00
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
|
2020-02-26 16:29:40 +01:00
|
|
|
print_version "$GNUTLS_LEGACY_SERV" "--version" "legacy" "head -n 1"
|
|
|
|
else
|
|
|
|
echo " * gnutls-serv (legacy): Not configured."
|
2016-07-19 15:54:17 +02:00
|
|
|
fi
|
2020-02-26 16:29:40 +01:00
|
|
|
echo
|
2016-07-19 15:54:17 +02:00
|
|
|
|
2020-02-26 16:29:40 +01:00
|
|
|
echo " * Installed asan versions:"
|
|
|
|
if `hash dpkg > /dev/null 2>&1` && `dpkg --get-selections|grep libasan > /dev/null` ; then
|
|
|
|
dpkg -s libasan5 2> /dev/null | grep -i version
|
|
|
|
dpkg -s libasan4 2> /dev/null | grep -i version
|
|
|
|
dpkg -s libasan3 2> /dev/null | grep -i version
|
2016-07-19 15:54:17 +02: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
|
2020-02-26 16:29:40 +01:00
|
|
|
echo " Either dpkg not present or no asan versions installed."
|
2016-07-19 15:54:17 +02:00
|
|
|
fi
|
|
|
|
echo
|