From 0726294bcb15fc46f0448b58e0b75c9135529166 Mon Sep 17 00:00:00 2001 From: WXbet <57314510+WXbet@users.noreply.github.com> Date: Mon, 6 Jan 2020 00:07:20 +0100 Subject: [PATCH 1/3] Extend tccheck to show library versions show name and version of libraries in pkgconfig of toolchain sample output: Library config ----> armv7-rpi2-linux-gnueabihf/sysroot/usr/lib/pkgconfig ==================== Library Config : libcrypto.pc found OpenSSL-libcrypto 1.1.0l Library Config : libpcsclite.pc found PCSC Lite 1.8.26 Library Config : libssl.pc found OpenSSL-libssl 1.1.0l Library Config : libusb-1.0.pc found libusb-1.0 1.0.23 Library Config : openssl.pc found OpenSSL 1.1.0l Library Config : zlib.pc found zlib 1.2.11 --- support/functions/_toolchain | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/support/functions/_toolchain b/support/functions/_toolchain index 1540392..0bae838 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -186,6 +186,15 @@ _toolchain_check(){ temp=$(find * |grep -m1 "$e"); [ ${#temp} -gt 8 ] && echo -e "$w_l Header File :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header File :$y_l $e$r_l\t($txt_not_found)"; done; + libconfigvars=( libcrypto.pc libpcsclite.pc libusb-1.0.pc zlib.pc ); + pkg=$(find * |grep -m1 "pkgconfig"); + [ "$1" == "native" ] && cd "$_sysroot/$pkg" || cd "$tcdir/$1/$_sysroot/$pkg"; + echo -e "\n$w_l Library config ----> $C$_sysroot/$pkg$w_l\n ====================\n"; + for f in *.pc;do + content=$(cat "$f") && na=$(echo "$content" | grep 'Name:' | sed -e "s/Name: //g") && ver=$(echo "$content" | grep 'Version:' | sed -e "s/Version: //g"); + sp1=$(printf '%*s' $((20-${#f})) | tr ' ' ' ') && sp2=$(printf '%*s' $((20-${#na})) | tr ' ' ' '); + [ ${#content} -gt 0 ] && echo -e "$w_l Library Config :$y_l "$f"$sp1$g_l$txt_found\t$p_l$na$sp2$ver" || echo -e "$w_l Library Config :$y_l "$f"$sp1$r_l($txt_not_found)"; + done; echo -e $re_; exit; }; From 35db90015f8a551fb9a66e80386cdffbf219358a Mon Sep 17 00:00:00 2001 From: WXbet <57314510+WXbet@users.noreply.github.com> Date: Mon, 6 Jan 2020 00:13:13 +0100 Subject: [PATCH 2/3] Remove redundant code --- support/functions/_toolchain | 1 - 1 file changed, 1 deletion(-) diff --git a/support/functions/_toolchain b/support/functions/_toolchain index 0bae838..e66212b 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -186,7 +186,6 @@ _toolchain_check(){ temp=$(find * |grep -m1 "$e"); [ ${#temp} -gt 8 ] && echo -e "$w_l Header File :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header File :$y_l $e$r_l\t($txt_not_found)"; done; - libconfigvars=( libcrypto.pc libpcsclite.pc libusb-1.0.pc zlib.pc ); pkg=$(find * |grep -m1 "pkgconfig"); [ "$1" == "native" ] && cd "$_sysroot/$pkg" || cd "$tcdir/$1/$_sysroot/$pkg"; echo -e "\n$w_l Library config ----> $C$_sysroot/$pkg$w_l\n ====================\n"; From 3e2ac46571cea2eddbcd0153eab980f79af1a505 Mon Sep 17 00:00:00 2001 From: WXbet <57314510+WXbet@users.noreply.github.com> Date: Tue, 7 Jan 2020 21:20:29 +0100 Subject: [PATCH 3/3] update show library versions better output if no libraries built in --- support/functions/_toolchain | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/support/functions/_toolchain b/support/functions/_toolchain index e66212b..7111c18 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -187,13 +187,17 @@ _toolchain_check(){ [ ${#temp} -gt 8 ] && echo -e "$w_l Header File :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header File :$y_l $e$r_l\t($txt_not_found)"; done; pkg=$(find * |grep -m1 "pkgconfig"); - [ "$1" == "native" ] && cd "$_sysroot/$pkg" || cd "$tcdir/$1/$_sysroot/$pkg"; - echo -e "\n$w_l Library config ----> $C$_sysroot/$pkg$w_l\n ====================\n"; - for f in *.pc;do - content=$(cat "$f") && na=$(echo "$content" | grep 'Name:' | sed -e "s/Name: //g") && ver=$(echo "$content" | grep 'Version:' | sed -e "s/Version: //g"); - sp1=$(printf '%*s' $((20-${#f})) | tr ' ' ' ') && sp2=$(printf '%*s' $((20-${#na})) | tr ' ' ' '); - [ ${#content} -gt 0 ] && echo -e "$w_l Library Config :$y_l "$f"$sp1$g_l$txt_found\t$p_l$na$sp2$ver" || echo -e "$w_l Library Config :$y_l "$f"$sp1$r_l($txt_not_found)"; - done; + if [ ${#pkg} -gt 0 ];then + [ "$1" == "native" ] && cd "$_sysroot/$pkg" || cd "$tcdir/$1/$_sysroot/$pkg"; + echo -e "\n$w_l Library config ----> $C$_sysroot/$pkg$w_l\n ====================\n"; + for f in *.pc;do + content=$(cat "$f") && na=$(echo "$content" | grep 'Name:' | sed -e "s/Name: //g") && ver=$(echo "$content" | grep 'Version:' | sed -e "s/Version: //g"); + sp1=$(printf '%*s' $((20-${#f})) | tr ' ' ' ') && sp2=$(printf '%*s' $((20-${#na})) | tr ' ' ' '); + [ ${#content} -gt 0 ] && echo -e "$w_l Library Config :$y_l "$f"$sp1$g_l$txt_found\t$p_l$na$sp2$ver" || echo -e "$w_l Library Config :$y_l "$f"$sp1$r_l($txt_not_found)"; + done; + else + echo -e "\n$w_l Library config ----> $C no libraries found in pkgconfig$w_l\n ====================\n"; + fi echo -e $re_; exit; };