Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / mbedtls / repo / scripts / output_env.sh
1 #! /usr/bin/env 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
16 #   - version of armcc, clang, gcc-arm and gcc compilers
17 #   - version of libc, clang, asan and valgrind if installed
18 #   - version of gnuTLS and OpenSSL
19
20 print_version()
21 {
22     BIN="$1"
23     shift
24     ARGS="$1"
25     shift
26     FAIL_MSG="$1"
27     shift
28
29     if ! `type "$BIN" > /dev/null 2>&1`; then
30         echo "* $FAIL_MSG"
31         return 0
32     fi
33
34     BIN=`which "$BIN"`
35     VERSION_STR=`$BIN $ARGS 2>&1`
36
37     # Apply all filters
38     while [ $# -gt 0 ]; do
39         FILTER="$1"
40         shift
41         VERSION_STR=`echo "$VERSION_STR" | $FILTER`
42     done
43
44     echo "* ${BIN##*/}: $BIN: $VERSION_STR"
45 }
46
47 print_version "uname" "-a" ""
48 echo
49
50 if [ "${RUN_ARMCC:-1}" -ne 0 ]; then
51     : "${ARMC5_CC:=armcc}"
52     print_version "$ARMC5_CC" "--vsn" "armcc not found!" "head -n 2"
53     echo
54
55     : "${ARMC6_CC:=armclang}"
56     print_version "$ARMC6_CC" "--vsn" "armclang not found!" "head -n 2"
57     echo
58 fi
59
60 print_version "arm-none-eabi-gcc" "--version" "gcc-arm not found!" "head -n 1"
61 echo
62
63 print_version "gcc" "--version" "gcc not found!" "head -n 1"
64 echo
65
66 print_version "clang" "--version" "clang not found" "head -n 2"
67 echo
68
69 print_version "ldd" "--version"                     \
70     "No ldd present: can't determine libc version!" \
71     "head -n 1"
72 echo
73
74 print_version "valgrind" "--version" "valgrind not found!"
75 echo
76
77 : ${OPENSSL:=openssl}
78 print_version "$OPENSSL" "version" "openssl not found!"
79 echo
80
81 if [ -n "${OPENSSL_LEGACY+set}" ]; then
82     print_version "$OPENSSL_LEGACY" "version" "openssl legacy version not found!"
83     echo
84 fi
85
86 if [ -n "${OPENSSL_NEXT+set}" ]; then
87     print_version "$OPENSSL_NEXT" "version" "openssl next version not found!"
88     echo
89 fi
90
91 : ${GNUTLS_CLI:=gnutls-cli}
92 print_version "$GNUTLS_CLI" "--version" "gnuTLS client not found!" "head -n 1"
93 echo
94
95 : ${GNUTLS_SERV:=gnutls-serv}
96 print_version "$GNUTLS_SERV" "--version" "gnuTLS server not found!" "head -n 1"
97 echo
98
99 if [ -n "${GNUTLS_LEGACY_CLI+set}" ]; then
100     print_version "$GNUTLS_LEGACY_CLI" "--version" \
101         "gnuTLS client legacy version not found!"  \
102         "head -n 1"
103     echo
104 fi
105
106 if [ -n "${GNUTLS_LEGACY_SERV+set}" ]; then
107     print_version "$GNUTLS_LEGACY_SERV" "--version" \
108         "gnuTLS server legacy version not found!"   \
109         "head -n 1"
110     echo
111 fi
112
113 if `hash dpkg > /dev/null 2>&1`; then
114     echo "* asan:"
115     dpkg -s libasan2 2> /dev/null | grep -i version
116     dpkg -s libasan1 2> /dev/null | grep -i version
117     dpkg -s libasan0 2> /dev/null | grep -i version
118 else
119     echo "* No dpkg present: can't determine asan version!"
120 fi
121 echo