blob: ed1791476d453b38f2d0b52d6b97ebc2b382e165 [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
Andres AG7a63eaf2016-09-05 12:24:47 +010020COUNT=1
Janos Follathb72c6782016-07-19 14:54:17 +010021
22echo
Andres AG7a63eaf2016-09-05 12:24:47 +010023echo "$COUNT) Operating system and architecture:"
24uname -a
25COUNT=$((COUNT+1))
26
27echo
28if `hash armcc > /dev/null 2>&1`; then
29 echo "$COUNT) armcc:"
Janos Follathb72c6782016-07-19 14:54:17 +010030 armcc --vsn | head -n 2
31else
Andres AG7a63eaf2016-09-05 12:24:47 +010032 echo "$COUNT) armcc not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010033fi
Andres AG7a63eaf2016-09-05 12:24:47 +010034COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010035
36echo
Andres AG7a63eaf2016-09-05 12:24:47 +010037if `hash arm-none-eabi-gcc > /dev/null 2>&1`; then
38 echo "$COUNT) gcc-arm:"
Janos Follathb72c6782016-07-19 14:54:17 +010039 arm-none-eabi-gcc --version | head -n 1
40else
Andres AG7a63eaf2016-09-05 12:24:47 +010041 echo "$COUNT) gcc-arm not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010042fi
Andres AG7a63eaf2016-09-05 12:24:47 +010043COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010044
45echo
Andres AG7a63eaf2016-09-05 12:24:47 +010046if `hash gcc > /dev/null 2>&1`; then
47 echo "$COUNT) gcc:"
Janos Follathb72c6782016-07-19 14:54:17 +010048 gcc --version | head -n 1
49else
Andres AG7a63eaf2016-09-05 12:24:47 +010050 echo "$COUNT) gcc not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010051fi
Andres AG7a63eaf2016-09-05 12:24:47 +010052COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010053
54echo
Andres AG7a63eaf2016-09-05 12:24:47 +010055if `hash clang > /dev/null 2>&1`; then
56 echo "$COUNT) clang:"
Janos Follathb72c6782016-07-19 14:54:17 +010057 clang --version | head -n 2
58 clang -v 2>&1 | grep Selected
59else
Andres AG7a63eaf2016-09-05 12:24:47 +010060 echo "$COUNT) clang not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010061fi
Andres AG7a63eaf2016-09-05 12:24:47 +010062COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010063
64echo
Andres AG7a63eaf2016-09-05 12:24:47 +010065if `hash ldd > /dev/null 2>&1`; then
66 echo "$COUNT) libc:"
Janos Follathb72c6782016-07-19 14:54:17 +010067 ldd --version | head -n 1
68else
Andres AG7a63eaf2016-09-05 12:24:47 +010069 echo "$COUNT) No ldd present: can't determine libc version!"
Janos Follathb72c6782016-07-19 14:54:17 +010070fi
Andres AG7a63eaf2016-09-05 12:24:47 +010071COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010072
73echo
Andres AG7a63eaf2016-09-05 12:24:47 +010074if `hash valgrind > /dev/null 2>&1`; then
75 echo "$COUNT) valgrind:"
Janos Follathb72c6782016-07-19 14:54:17 +010076 valgrind --version
77else
Andres AG7a63eaf2016-09-05 12:24:47 +010078 echo "$COUNT) valgrind not found!"
Janos Follathb72c6782016-07-19 14:54:17 +010079fi
Andres AG7a63eaf2016-09-05 12:24:47 +010080COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +010081
82echo
Andres AG7a63eaf2016-09-05 12:24:47 +010083if `hash openssl > /dev/null 2>&1`; then
84 echo "$COUNT) openssl:"
Janos Follathb72c6782016-07-19 14:54:17 +010085 openssl version
86else
Andres AG7a63eaf2016-09-05 12:24:47 +010087 echo "$COUNT) openssl not found!"
88fi
89COUNT=$((COUNT+1))
90
91if [ -n "${OPENSSL+set}" ]; then
92 echo
93 if `hash "$OPENSSL" > /dev/null 2>&1`; then
94 echo "$COUNT) $OPENSSL at environment variable 'OPENSSL':"
95 $OPENSSL version
96 else
97 echo "$COUNT) $OPENSSL at environment variable 'OPENSSL' not found!"
98 fi
99 COUNT=$((COUNT+1))
100fi
101
102if [ -n "${OPENSSL_LEGACY+set}" ]; then
103 echo
104 if `hash "$OPENSSL_LEGACY" > /dev/null 2>&1`; then
105 echo "$COUNT) $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY':"
106 $OPENSSL_LEGACY version
107 else
108 echo "$COUNT) $OPENSSL_LEGACY at environment variable 'OPENSSL_LEGACY' not found!"
109 fi
110 COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +0100111fi
112
113echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100114if `hash gnutls-cli > /dev/null 2>&1`; then
115 echo "$COUNT) gnuTLS client:"
Janos Follathb72c6782016-07-19 14:54:17 +0100116 gnutls-cli --version | head -n 1
117else
Andres AG7a63eaf2016-09-05 12:24:47 +0100118 echo "$COUNT) gnuTLS client not found!"
Janos Follathb72c6782016-07-19 14:54:17 +0100119fi
Andres AG7a63eaf2016-09-05 12:24:47 +0100120COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +0100121
122echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100123if `hash gnutls-serv > /dev/null 2>&1`; then
124 echo "$COUNT) gnuTLS server:"
Janos Follathb72c6782016-07-19 14:54:17 +0100125 gnutls-serv --version | head -n 1
126else
Andres AG7a63eaf2016-09-05 12:24:47 +0100127 echo "$COUNT) gnuTLS server not found!"
128fi
129COUNT=$((COUNT+1))
130
131if [ -n "${GNUTLS_CLI+set}" ]; then
132 echo
133 if `hash "$GNUTLS_CLI" > /dev/null 2>&1`; then
134 echo "$COUNT) $GNUTLS_CLI at environment variable 'GNUTLS_CLI':"
135 $GNUTLS_CLI --version | head -n 1
136 else
137 echo "$COUNT) $GNUTLS_CLI at environment variable 'GNUTLS_CLI' not found!"
138 fi
139 COUNT=$((COUNT+1))
140fi
141
142if [ -n "${GNUTLS_SERV+set}" ]; then
143 echo
144 if `hash "$GNUTLS_SERV" > /dev/null 2>&1`; then
145 echo "$COUNT) $GNUTLS_SERV at environment variable 'GNUTLS_SERV':"
146 $GNUTLS_SERV --version | head -n 1
147 else
148 echo "$COUNT) $GNUTLS_SERV at environment variable 'GNUTLS_SERV' not found!"
149 fi
150 COUNT=$((COUNT+1))
151fi
152
153if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
154 echo
155 if `hash "$GNUTLS_LEGACY_CLI" > /dev/null 2>&1`; then
156 echo "$COUNT) $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI':"
157 $GNUTLS_LEGACY_CLI --version | head -n 1
158 else
159 echo "$COUNT) $GNUTLS_LEGACY_CLI at environment variable 'GNUTLS_LEGACY_CLI' not found!"
160 fi
161 COUNT=$((COUNT+1))
162fi
163
164if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
165 echo
166 if `hash "$GNUTLS_LEGACY_SERV" > /dev/null 2>&1`; then
167 echo "$COUNT) $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV':"
168 $GNUTLS_LEGACY_SERV --version | head -n 1
169 else
170 echo "$COUNT) $GNUTLS_LEGACY_SERV at environment variable 'GNUTLS_LEGACY_SERV' not found!"
171 fi
172 COUNT=$((COUNT+1))
Janos Follathb72c6782016-07-19 14:54:17 +0100173fi
174
175echo
Andres AG7a63eaf2016-09-05 12:24:47 +0100176if `hash dpkg > /dev/null 2>&1`; then
177 echo "$COUNT) asan:"
Janos Follathb72c6782016-07-19 14:54:17 +0100178 dpkg -s libasan2 2> /dev/null | grep -i version
179 dpkg -s libasan1 2> /dev/null | grep -i version
180 dpkg -s libasan0 2> /dev/null | grep -i version
181else
Andres AG7a63eaf2016-09-05 12:24:47 +0100182 echo "$COUNT) No dpkg present: can't determine asan version!"
Janos Follathb72c6782016-07-19 14:54:17 +0100183fi
184
185echo
Simon Butcher3ac07672016-09-04 14:28:44 +0300186