aboutsummaryrefslogtreecommitdiff
path: root/scripts/showSamples.sh
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2015-11-17 11:41:08 -0800
committerBryan Hundven <bryanhundven@gmail.com>2015-11-17 11:41:08 -0800
commit5739495c35fed59ea08ecfdf1262ec476c4686b9 (patch)
treeb5bacdebe517bfa9863fd35f0cb60a17e750f051 /scripts/showSamples.sh
parent3c1d8625e60e31ed073beb247eaf934364a36957 (diff)
downloadcrosstool-ng-5739495c35fed59ea08ecfdf1262ec476c4686b9.tar.gz
crosstool-ng-5739495c35fed59ea08ecfdf1262ec476c4686b9.tar.bz2
crosstool-ng-5739495c35fed59ea08ecfdf1262ec476c4686b9.zip
showSamples.sh: Fix how we get gcc and version for showSamples.sh
I'm not even sure how the previous loop was supposed to work. The config variables are not exported to the environment. Now we properly get which cc we are using and grab the version to display it correctly with the output of wiki-samples. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Diffstat (limited to 'scripts/showSamples.sh')
-rwxr-xr-xscripts/showSamples.sh20
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index f6241193..20c5a70e 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -88,12 +88,10 @@ dump_single_sample() {
[ -z "${complibs}" ] || printf "\n"
printf " %-*s : %s\n" ${width} "binutils" "binutils-${CT_BINUTILS_VERSION}"
printf " %-*s :" ${width} "C compilers"
- for cc in $(env | ${sed} -n 's/^CT_CC_\(.*\)_VERSION.*/\1/p'); do
- cc_variable=CT_CC_${cc}_VERSION
- version=${!cc_variable}
- compiler=$(echo $cc | ${awk} '{print tolower($0)}')
- printf " $compiler-$version"
- done
+ cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}')
+ version=$(eval echo \${CT_CC_${cc}_VERSION})
+ compiler=$(echo $cc | ${awk} '{print tolower($0)}')
+ printf " $compiler | $version"
printf "\n"
printf " %-*s : %s" ${width} "Languages" "C"
[ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++"
@@ -140,12 +138,10 @@ dump_single_sample() {
fi
printf "| ${CT_BINUTILS_VERSION} "
printf "| "
- for cc in $(env | ${sed} -n 's/^CT_CC_\(.*\)_VERSION.*/\1/p'); do
- cc_variable=CT_CC_${cc}_VERSION
- version=${!cc_variable}
- compiler=$(echo $cc | ${awk} '{print tolower($0)}')
- printf " $compiler-$version"
- done
+ cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}')
+ version=$(eval echo \${CT_CC_${cc}_VERSION})
+ compiler=$(echo $cc | ${awk} '{print tolower($0)}')
+ printf " $compiler | $version"
printf " "
printf "| ''${CT_LIBC}'' |"
if [ "${CT_LIBC}" != "none" ]; then