2016-10-04 16:14:38 +00:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
2016-07-19 13:54:17 +00:00
|
|
|
# output_env.sh
|
|
|
|
#
|
2020-08-07 11:07:28 +00:00
|
|
|
# Copyright The Mbed TLS Contributors
|
2023-11-02 19:47:20 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
2020-05-25 23:54:15 +00:00
|
|
|
#
|
2016-07-19 13:54:17 +00:00
|
|
|
# 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
|
2020-05-25 11:11:32 +00:00
|
|
|
# - version of make and cmake
|
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
|
2020-03-05 15:18:53 +00:00
|
|
|
VARIANT="$1"
|
2016-10-04 16:14:38 +00:00
|
|
|
shift
|
|
|
|
|
2020-02-27 12:58:27 +00:00
|
|
|
if [ -n "$VARIANT" ]; then
|
2020-02-26 15:29:40 +00:00
|
|
|
VARIANT=" ($VARIANT)"
|
|
|
|
fi
|
|
|
|
|
2020-02-27 12:58:27 +00:00
|
|
|
if ! type "$BIN" > /dev/null 2>&1; then
|
2020-02-26 15:29:40 +00:00
|
|
|
echo " * ${BIN##*/}$VARIANT: Not found."
|
2016-10-04 16:14:38 +00: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-03-05 15:18:53 +00:00
|
|
|
if [ -z "$VERSION_STR" ]; then
|
|
|
|
VERSION_STR="Version could not be determined."
|
|
|
|
fi
|
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
echo " * ${BIN##*/}$VARIANT: ${BIN} : ${VERSION_STR} "
|
2016-10-04 16:14:38 +00:00
|
|
|
}
|
2016-07-19 13:54:17 +00:00
|
|
|
|
2020-02-27 12:58:27 +00:00
|
|
|
echo "** Platform:"
|
|
|
|
echo
|
|
|
|
|
|
|
|
if [ `uname -s` = "Linux" ]; then
|
2020-02-26 15:29:40 +00:00
|
|
|
echo "Linux variant"
|
|
|
|
lsb_release -d -c
|
|
|
|
else
|
|
|
|
echo "Unknown Unix variant"
|
|
|
|
fi
|
|
|
|
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-27 14:05:15 +00:00
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "uname" "-a" ""
|
2020-03-05 15:18:53 +00:00
|
|
|
|
2020-02-27 12:58:27 +00:00
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "** Tool Versions:"
|
|
|
|
echo
|
2020-02-26 15:29:40 +00:00
|
|
|
|
2020-05-25 11:11:32 +00:00
|
|
|
print_version "make" "--version" "" "head -n 1"
|
|
|
|
echo
|
|
|
|
|
|
|
|
print_version "cmake" "--version" "" "head -n 1"
|
|
|
|
echo
|
|
|
|
|
2018-03-21 07:35:07 +00:00
|
|
|
if [ "${RUN_ARMCC:-1}" -ne 0 ]; then
|
|
|
|
: "${ARMC6_CC:=armclang}"
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "$ARMC6_CC" "--vsn" "" "head -n 2"
|
2018-03-21 07:35:07 +00:00
|
|
|
echo
|
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "arm-none-eabi-gcc" "--version" "" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "gcc" "--version" "" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2023-07-28 16:04:47 +00:00
|
|
|
if [ -n "${GCC_EARLIEST+set}" ]; then
|
|
|
|
print_version "${GCC_EARLIEST}" "--version" "" "head -n 1"
|
|
|
|
else
|
|
|
|
echo " GCC_EARLIEST : Not configured."
|
|
|
|
fi
|
2023-07-19 07:39:20 +00:00
|
|
|
echo
|
|
|
|
|
2023-07-28 16:04:47 +00:00
|
|
|
if [ -n "${GCC_LATEST+set}" ]; then
|
|
|
|
print_version "${GCC_LATEST}" "--version" "" "head -n 1"
|
|
|
|
else
|
|
|
|
echo " GCC_LATEST : Not configured."
|
|
|
|
fi
|
2023-07-19 07:39:20 +00:00
|
|
|
echo
|
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "clang" "--version" "" "head -n 2"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2023-07-28 16:04:47 +00:00
|
|
|
if [ -n "${CLANG_EARLIEST+set}" ]; then
|
|
|
|
print_version "${CLANG_EARLIEST}" "--version" "" "head -n 2"
|
|
|
|
else
|
|
|
|
echo " CLANG_EARLIEST : Not configured."
|
|
|
|
fi
|
2023-07-19 07:39:20 +00:00
|
|
|
echo
|
|
|
|
|
2023-07-28 16:04:47 +00:00
|
|
|
if [ -n "${CLANG_LATEST+set}" ]; then
|
|
|
|
print_version "${CLANG_LATEST}" "--version" "" "head -n 2"
|
|
|
|
else
|
|
|
|
echo " CLANG_LATEST : Not configured."
|
|
|
|
fi
|
2023-07-19 07:39:20 +00:00
|
|
|
echo
|
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "ldd" "--version" "" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "valgrind" "--version" ""
|
|
|
|
echo
|
|
|
|
|
|
|
|
print_version "gdb" "--version" "" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
2020-03-05 15:18:53 +00:00
|
|
|
print_version "perl" "--version" "" "head -n 2" "grep ."
|
|
|
|
echo
|
|
|
|
|
|
|
|
print_version "python" "--version" "" "head -n 1"
|
|
|
|
echo
|
|
|
|
|
2020-05-25 11:55:21 +00:00
|
|
|
print_version "python3" "--version" "" "head -n 1"
|
|
|
|
echo
|
|
|
|
|
2020-03-16 11:30:46 +00:00
|
|
|
# Find the installed version of Pylint. Installed as a distro package this can
|
|
|
|
# be pylint3 and as a PEP egg, pylint. In test scripts We prefer pylint over
|
|
|
|
# pylint3
|
|
|
|
if type pylint >/dev/null 2>/dev/null; then
|
|
|
|
print_version "pylint" "--version" "" "sed /^.*config/d" "grep pylint"
|
|
|
|
elif type pylint3 >/dev/null 2>/dev/null; then
|
|
|
|
print_version "pylint3" "--version" "" "sed /^.*config/d" "grep pylint"
|
|
|
|
else
|
|
|
|
echo " * pylint or pylint3: Not found."
|
|
|
|
fi
|
2020-03-05 15:18:53 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${OPENSSL:=openssl}
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "$OPENSSL" "version" "default"
|
2016-10-04 16:14:38 +00:00
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
2018-02-20 11:02:07 +00:00
|
|
|
if [ -n "${OPENSSL_NEXT+set}" ]; then
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "$OPENSSL_NEXT" "version" "next"
|
|
|
|
else
|
|
|
|
echo " * openssl (next): Not configured."
|
2018-02-20 11:02:07 +00:00
|
|
|
fi
|
2020-02-26 15:29:40 +00:00
|
|
|
echo
|
2018-02-20 11:02:07 +00:00
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${GNUTLS_CLI:=gnutls-cli}
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "$GNUTLS_CLI" "--version" "default" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
|
|
|
|
2016-10-04 16:14:38 +00:00
|
|
|
: ${GNUTLS_SERV:=gnutls-serv}
|
2020-02-26 15:29:40 +00:00
|
|
|
print_version "$GNUTLS_SERV" "--version" "default" "head -n 1"
|
2016-07-19 13:54:17 +00:00
|
|
|
echo
|
2016-09-05 11:24:47 +00:00
|
|
|
|
2020-02-26 15:29:40 +00:00
|
|
|
echo " * Installed asan versions:"
|
2020-02-27 12:58:27 +00:00
|
|
|
if type dpkg-query >/dev/null 2>/dev/null; then
|
|
|
|
if ! dpkg-query -f '${Status} ${Package}: ${Version}\n' -W 'libasan*' |
|
|
|
|
awk '$3 == "installed" && $4 !~ /-/ {print $4, $5}' |
|
|
|
|
grep .
|
|
|
|
then
|
|
|
|
echo " No asan versions installed."
|
|
|
|
fi
|
2016-07-19 13:54:17 +00:00
|
|
|
else
|
2020-02-27 12:58:27 +00:00
|
|
|
echo " Unable to determine the asan version without dpkg."
|
2016-07-19 13:54:17 +00:00
|
|
|
fi
|
|
|
|
echo
|