2016-10-04 16:14:38 +00:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
2016-07-19 13:54:17 +00: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 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
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version()
|
|
|
|
{
|
|
|
|
BIN="$1"
|
|
|
|
shift
|
|
|
|
ARGS="$1"
|
|
|
|
shift
|
|
|
|
FAIL_MSG="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
if ! `type "$BIN" > /dev/null 2>&1`; then
|
|
|
|
echo "* $FAIL_MSG"
|
|
|
|
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
|
|
|
|
|
|
|
|
echo "* ${BIN##*/}: $BIN: $VERSION_STR"
|
|
|
|
}
|
2016-07-19 13:54:17 +00:00
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "uname" "-a" ""
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-27 14:05:15 +00:00
|
|
|
|
2018-03-21 07:35:07 +00:00
|
|
|
if [ "${RUN_ARMCC:-1}" -ne 0 ]; then
|
|
|
|
: "${ARMC5_CC:=armcc}"
|
|
|
|
print_version "$ARMC5_CC" "--vsn" "armcc not found!" "head -n 2"
|
|
|
|
echo
|
2016-07-19 13:54:17 +00:00
|
|
|
|
2018-03-21 07:35:07 +00:00
|
|
|
: "${ARMC6_CC:=armclang}"
|
|
|
|
print_version "$ARMC6_CC" "--vsn" "armclang not found!" "head -n 2"
|
|
|
|
echo
|
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "arm-none-eabi-gcc" "--version" "gcc-arm not found!" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "gcc" "--version" "gcc not found!" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "clang" "--version" "clang not found" "head -n 2"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "ldd" "--version" \
|
|
|
|
"No ldd present: can't determine libc version!" \
|
|
|
|
"head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "valgrind" "--version" "valgrind not found!"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${OPENSSL:=openssl}
|
|
|
|
print_version "$OPENSSL" "version" "openssl not found!"
|
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
|
|
|
if [ -n "${OPENSSL_LEGACY+set}" ]; then
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "$OPENSSL_LEGACY" "version" "openssl legacy version not found!"
|
2016-09-05 11:24:47 +00:00
|
|
|
echo
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-20 11:02:07 +00:00
|
|
|
if [ -n "${OPENSSL_NEXT+set}" ]; then
|
|
|
|
print_version "$OPENSSL_NEXT" "version" "openssl next version not found!"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${GNUTLS_CLI:=gnutls-cli}
|
|
|
|
print_version "$GNUTLS_CLI" "--version" "gnuTLS client not found!" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${GNUTLS_SERV:=gnutls-serv}
|
|
|
|
print_version "$GNUTLS_SERV" "--version" "gnuTLS server not found!" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "$GNUTLS_LEGACY_CLI" "--version" \
|
|
|
|
"gnuTLS client legacy version not found!" \
|
|
|
|
"head -n 1"
|
2016-09-05 11:24:47 +00:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
|
2016-10-04 16:14:38 +00:00
|
|
|
print_version "$GNUTLS_LEGACY_SERV" "--version" \
|
|
|
|
"gnuTLS server legacy version not found!" \
|
|
|
|
"head -n 1"
|
2016-09-05 11:24:47 +00:00
|
|
|
echo
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
|
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
|