blob: 441fe18fbeb88e663e38e3f40271a59816578975 [file] [log] [blame]
Janos Follathb72c6782016-07-19 14:54:17 +01001#!/bin/sh
2#
3# output_env.sh
4#
5# This file is part of mbed TLS (https://tls.mbed.org)
6#
7# Copyright (c) 2016, ARM Limited, All Rights Reserved
8#
9# Purpose
10#
11# To print out all the relevant information about the development environment.
12#
13# This includes:
14# - architecture of the system
15# - type and version of the operating system
Simon Butcher3ac07672016-09-04 14:28:44 +030016# - version of armcc, clang, gcc-arm and gcc compilers
17# - version of libc, clang, asan and valgrind if installed
Janos Follathb72c6782016-07-19 14:54:17 +010018# - version of gnuTLS and OpenSSL
19
Janos Follathb72c6782016-07-19 14:54:17 +010020echo
Simon Butcher40122e02016-09-09 15:30:29 +010021echo "* Operating system and architecture:"
Andres AG7a63eaf2016-09-05 12:24:47 +010022uname -a
Andres AG7a63eaf2016-09-05 12:24:47 +010023
24echo
25if `hash armcc > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010026 echo "* armcc:"
Janos Follathb72c6782016-07-19 14:54:17 +010027 armcc --vsn | head -n 2
28else
Simon Butcher40122e02016-09-09 15:30:29 +010029 echo "* armcc not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010030fi
31
32echo
Andres AG7a63eaf2016-09-05 12:24:47 +010033if `hash arm-none-eabi-gcc > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010034 echo "* gcc-arm:"
Janos Follathb72c6782016-07-19 14:54:17 +010035 arm-none-eabi-gcc --version | head -n 1
36else
Simon Butcher40122e02016-09-09 15:30:29 +010037 echo "* gcc-arm not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010038fi
39
40echo
Andres AG7a63eaf2016-09-05 12:24:47 +010041if `hash gcc > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010042 echo "* gcc:"
Janos Follathb72c6782016-07-19 14:54:17 +010043 gcc --version | head -n 1
44else
Simon Butcher40122e02016-09-09 15:30:29 +010045 echo "* gcc not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010046fi
47
48echo
Andres AG7a63eaf2016-09-05 12:24:47 +010049if `hash clang > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010050 echo "* clang:"
Janos Follathb72c6782016-07-19 14:54:17 +010051 clang --version | head -n 2
52 clang -v 2>&1 | grep Selected
53else
Simon Butcher40122e02016-09-09 15:30:29 +010054 echo "* clang not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010055fi
56
57echo
Andres AG7a63eaf2016-09-05 12:24:47 +010058if `hash ldd > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010059 echo "* libc:"
Janos Follathb72c6782016-07-19 14:54:17 +010060 ldd --version | head -n 1
61else
Simon Butcher40122e02016-09-09 15:30:29 +010062 echo "* No ldd present: can't determine libc version!"
Janos Follathb72c6782016-07-19 14:54:17 +010063fi
64
65echo
Andres AG7a63eaf2016-09-05 12:24:47 +010066if `hash valgrind > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010067 echo "* valgrind:"
Janos Follathb72c6782016-07-19 14:54:17 +010068 valgrind --version
69else
Simon Butcher40122e02016-09-09 15:30:29 +010070 echo "* valgrind not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010071fi
72
73echo
Andres AG7a63eaf2016-09-05 12:24:47 +010074if `hash openssl > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010075 echo "* openssl:"
Janos Follathb72c6782016-07-19 14:54:17 +010076 openssl version
77else
Simon Butcher40122e02016-09-09 15:30:29 +010078 echo "* openssl not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +010079fi
Andres AG7a63eaf2016-09-05 12:24:47 +010080
81if [ -n "${OPENSSL+set}" ]; then
82 echo
83 if `hash "$OPENSSL" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010084 echo "* $OPENSSL at environment variable 'OPENSSL':"
Andres AG7a63eaf2016-09-05 12:24:47 +010085 $OPENSSL version
86 else
Simon Butcher40122e02016-09-09 15:30:29 +010087 echo "* $OPENSSL at environment variable 'OPENSSL' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +010088 fi
Andres AG7a63eaf2016-09-05 12:24:47 +010089fi
90
91if [ -n "${OPENSSL_LEGACY+set}" ]; then
92 echo
93 if `hash "$OPENSSL_LEGACY" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010094 echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY':"
Andres AG7a63eaf2016-09-05 12:24:47 +010095 $OPENSSL_LEGACY version
96 else
Simon Butcher40122e02016-09-09 15:30:29 +010097 echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +010098 fi
Janos Follathb72c6782016-07-19 14:54:17 +010099fi
100
101echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100102if `hash gnutls-cli > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100103 echo "* gnuTLS client:"
Janos Follathb72c6782016-07-19 14:54:17 +0100104 gnutls-cli --version | head -n 1
105else
Simon Butcher40122e02016-09-09 15:30:29 +0100106 echo "* gnuTLS client not found!"
Janos Follathb72c6782016-07-19 14:54:17 +0100107fi
108
109echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100110if `hash gnutls-serv > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100111 echo "* gnuTLS server:"
Janos Follathb72c6782016-07-19 14:54:17 +0100112 gnutls-serv --version | head -n 1
113else
Simon Butcher40122e02016-09-09 15:30:29 +0100114 echo "* gnuTLS server not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100115fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100116
117if [ -n "${GNUTLS_CLI+set}" ]; then
118 echo
119 if `hash "$GNUTLS_CLI" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100120 echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100121 $GNUTLS_CLI --version | head -n 1
122 else
Simon Butcher40122e02016-09-09 15:30:29 +0100123 echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100124 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100125fi
126
127if [ -n "${GNUTLS_SERV+set}" ]; then
128 echo
129 if `hash "$GNUTLS_SERV" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100130 echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100131 $GNUTLS_SERV --version | head -n 1
132 else
Simon Butcher40122e02016-09-09 15:30:29 +0100133 echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100134 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100135fi
136
137if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
138 echo
139 if `hash "$GNUTLS_LEGACY_CLI" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100140 echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100141 $GNUTLS_LEGACY_CLI --version | head -n 1
142 else
Simon Butcher40122e02016-09-09 15:30:29 +0100143 echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100144 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100145fi
146
147if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
148 echo
149 if `hash "$GNUTLS_LEGACY_SERV" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100150 echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100151 $GNUTLS_LEGACY_SERV --version | head -n 1
152 else
Simon Butcher40122e02016-09-09 15:30:29 +0100153 echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100154 fi
Janos Follathb72c6782016-07-19 14:54:17 +0100155fi
156
157echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100158if `hash dpkg > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100159 echo "* asan:"
Janos Follathb72c6782016-07-19 14:54:17 +0100160 dpkg -s libasan2 2> /dev/null | grep -i version
161 dpkg -s libasan1 2> /dev/null | grep -i version
162 dpkg -s libasan0 2> /dev/null | grep -i version
163else
Simon Butcher40122e02016-09-09 15:30:29 +0100164 echo "* No dpkg present: can't determine asan version!"
Janos Follathb72c6782016-07-19 14:54:17 +0100165fi
166
167echo
Simon Butcher3ac07672016-09-04 14:28:44 +0300168