blob: fc3f66645d1032100f90ffaa2cc32649f93f7677 [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
Andres AG87bb5772016-09-27 15:05:15 +010025if [ -n "${ARMC5_CC+set}" ]; then
26 if `hash "$ARMC5_CC" > /dev/null 2>&1`; then
27 echo "* $ARMC5_CC at environment variable 'ARMC5_CC':"
28 $ARMC5_CC --vsn | head -n 2
29 else
30 echo "* $ARMC5_CC at environment variable 'ARMC5_CC' not found!"
31 fi
Janos Follathb72c6782016-07-19 14:54:17 +010032else
Andres AG87bb5772016-09-27 15:05:15 +010033 if `hash armcc > /dev/null 2>&1`; then
34 echo "* armcc:"
35 armcc --vsn | head -n 2
36 else
37 echo "* armcc not found!"
38 fi
39fi
40
41if [ -n "${ARMC6_CC+set}" ]; then
42 echo
43 if `hash "$ARMC6_CC" > /dev/null 2>&1`; then
44 echo "* $ARMC6_CC at environment variable 'ARMC6_CC':"
45 $ARMC6_CC --vsn | head -n 2
46 else
47 echo "* $ARMC6_CC at environment variable 'ARMC6_CC' not found!"
48 fi
Janos Follathb72c6782016-07-19 14:54:17 +010049fi
50
51echo
Andres AG7a63eaf2016-09-05 12:24:47 +010052if `hash arm-none-eabi-gcc > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010053 echo "* gcc-arm:"
Janos Follathb72c6782016-07-19 14:54:17 +010054 arm-none-eabi-gcc --version | head -n 1
55else
Simon Butcher40122e02016-09-09 15:30:29 +010056 echo "* gcc-arm not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010057fi
58
59echo
Andres AG7a63eaf2016-09-05 12:24:47 +010060if `hash gcc > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010061 echo "* gcc:"
Janos Follathb72c6782016-07-19 14:54:17 +010062 gcc --version | head -n 1
63else
Simon Butcher40122e02016-09-09 15:30:29 +010064 echo "* gcc not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010065fi
66
67echo
Andres AG7a63eaf2016-09-05 12:24:47 +010068if `hash clang > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010069 echo "* clang:"
Janos Follathb72c6782016-07-19 14:54:17 +010070 clang --version | head -n 2
71 clang -v 2>&1 | grep Selected
72else
Simon Butcher40122e02016-09-09 15:30:29 +010073 echo "* clang not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010074fi
75
76echo
Andres AG7a63eaf2016-09-05 12:24:47 +010077if `hash ldd > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010078 echo "* libc:"
Janos Follathb72c6782016-07-19 14:54:17 +010079 ldd --version | head -n 1
80else
Simon Butcher40122e02016-09-09 15:30:29 +010081 echo "* No ldd present: can't determine libc version!"
Janos Follathb72c6782016-07-19 14:54:17 +010082fi
83
84echo
Andres AG7a63eaf2016-09-05 12:24:47 +010085if `hash valgrind > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010086 echo "* valgrind:"
Janos Follathb72c6782016-07-19 14:54:17 +010087 valgrind --version
88else
Simon Butcher40122e02016-09-09 15:30:29 +010089 echo "* valgrind not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010090fi
91
92echo
Andres AG7a63eaf2016-09-05 12:24:47 +010093if `hash openssl > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +010094 echo "* openssl:"
Janos Follathb72c6782016-07-19 14:54:17 +010095 openssl version
96else
Simon Butcher40122e02016-09-09 15:30:29 +010097 echo "* openssl not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +010098fi
Andres AG7a63eaf2016-09-05 12:24:47 +010099
100if [ -n "${OPENSSL+set}" ]; then
101 echo
102 if `hash "$OPENSSL" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100103 echo "* $OPENSSL at environment variable 'OPENSSL':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100104 $OPENSSL version
105 else
Simon Butcher40122e02016-09-09 15:30:29 +0100106 echo "* $OPENSSL at environment variable 'OPENSSL' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100107 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100108fi
109
110if [ -n "${OPENSSL_LEGACY+set}" ]; then
111 echo
112 if `hash "$OPENSSL_LEGACY" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100113 echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100114 $OPENSSL_LEGACY version
115 else
Simon Butcher40122e02016-09-09 15:30:29 +0100116 echo "* $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100117 fi
Janos Follathb72c6782016-07-19 14:54:17 +0100118fi
119
120echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100121if `hash gnutls-cli > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100122 echo "* gnuTLS client:"
Janos Follathb72c6782016-07-19 14:54:17 +0100123 gnutls-cli --version | head -n 1
124else
Simon Butcher40122e02016-09-09 15:30:29 +0100125 echo "* gnuTLS client not found!"
Janos Follathb72c6782016-07-19 14:54:17 +0100126fi
127
128echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100129if `hash gnutls-serv > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100130 echo "* gnuTLS server:"
Janos Follathb72c6782016-07-19 14:54:17 +0100131 gnutls-serv --version | head -n 1
132else
Simon Butcher40122e02016-09-09 15:30:29 +0100133 echo "* gnuTLS server not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100134fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100135
136if [ -n "${GNUTLS_CLI+set}" ]; then
137 echo
138 if `hash "$GNUTLS_CLI" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100139 echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100140 $GNUTLS_CLI --version | head -n 1
141 else
Simon Butcher40122e02016-09-09 15:30:29 +0100142 echo "* $GNUTLS_CLI at environment variable 'GNUTLS_CLI' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100143 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100144fi
145
146if [ -n "${GNUTLS_SERV+set}" ]; then
147 echo
148 if `hash "$GNUTLS_SERV" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100149 echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100150 $GNUTLS_SERV --version | head -n 1
151 else
Simon Butcher40122e02016-09-09 15:30:29 +0100152 echo "* $GNUTLS_SERV at environment variable 'GNUTLS_SERV' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100153 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100154fi
155
156if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
157 echo
158 if `hash "$GNUTLS_LEGACY_CLI" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100159 echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100160 $GNUTLS_LEGACY_CLI --version | head -n 1
161 else
Simon Butcher40122e02016-09-09 15:30:29 +0100162 echo "* $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100163 fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100164fi
165
166if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
167 echo
168 if `hash "$GNUTLS_LEGACY_SERV" > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100169 echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV':"
Andres AG7a63eaf2016-09-05 12:24:47 +0100170 $GNUTLS_LEGACY_SERV --version | head -n 1
171 else
Simon Butcher40122e02016-09-09 15:30:29 +0100172 echo "* $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV' not found!"
Andres AG7a63eaf2016-09-05 12:24:47 +0100173 fi
Janos Follathb72c6782016-07-19 14:54:17 +0100174fi
175
176echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100177if `hash dpkg > /dev/null 2>&1`; then
Simon Butcher40122e02016-09-09 15:30:29 +0100178 echo "* asan:"
Janos Follathb72c6782016-07-19 14:54:17 +0100179 dpkg -s libasan2 2> /dev/null | grep -i version
180 dpkg -s libasan1 2> /dev/null | grep -i version
181 dpkg -s libasan0 2> /dev/null | grep -i version
182else
Simon Butcher40122e02016-09-09 15:30:29 +0100183 echo "* No dpkg present: can't determine asan version!"
Janos Follathb72c6782016-07-19 14:54:17 +0100184fi
185
186echo
Simon Butcher3ac07672016-09-04 14:28:44 +0300187