Browse Source

s3.TUP Add compiler capability check (v0.23.0)

- new compiler capability check to better preselect the correct library
- colorize incompatible libraries in Library Update Menu
- new config option _checkcc (e.g. LIB_USB_checkcc) to check compiler capabilities
- updated language files
pull/61/head
WXbet 4 years ago
parent
commit
dac94f79fa
  1. 3
      support/configs/plugin_update_toolchain.config.template
  2. 29
      support/functions/_plugin_update_toolchain
  3. 1
      support/translation/bg
  4. 1
      support/translation/de
  5. 1
      support/translation/en
  6. 1
      support/translation/es
  7. 1
      support/translation/fr
  8. 1
      support/translation/it
  9. 1
      support/translation/nl
  10. 1
      support/translation/pl
  11. 1
      support/translation/pt
  12. 5
      support/translation/tr

3
support/configs/plugin_update_toolchain.config.template

@ -1,6 +1,6 @@
# List of setup, build and config commands below. All commands are executed in the context of the current user.
# Pay attention to the SEMICOLON at the end of EACH command and the correct quoting (' or ") for or to avoid expansion of variables.
S3TUP_CONFIG_VERSION="31";
S3TUP_CONFIG_VERSION="32";
# Tokens that are replaced automatically:
# @CTNGSOURCE@ crosstool-NG source folder; support/crosstool/crosstool-ng
@ -214,6 +214,7 @@ LIB_USB_beta="0";
LIB_USB_name="libusb";
LIB_USB_version="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases/latest" | jq -r '.tag_name' | cut -c 2-)";
LIB_USB_check="libusb-1.0.pc $(printf "$LIB_USB_version")";
LIB_USB_checkcc="c11";
LIB_USB_url="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases/latest" | jq -r '.assets[2].browser_download_url')";
LIB_USB_tasks=('export TOOLCHAIN=@TOOLCHAIN@;');
LIB_USB_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";');

29
support/functions/_plugin_update_toolchain

@ -3,7 +3,7 @@
#simplebuild_plugin tcupdate
tcupdate(){
pversion="0.22.6";
pversion="0.23.0";
pname="s3.TUP";
pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config";
@ -210,6 +210,7 @@ _integrate_libs(){
libcheck="$libkey"_check;libcheck="${!libcheck}";
libversioncheck=$(echo "$libcheck" | awk '{printf $2}')
libcheck=$(echo "$libcheck" | awk '{printf $1}')
libcheckcc="$libkey"_checkcc;libcheckcc="${!libcheckcc}";
liburl="$libkey"_url;liburl="${!liburl}";
libtasks="$libkey"_tasks[@];libtasks=("${!libtasks}");
@ -229,13 +230,15 @@ _integrate_libs(){
done;
#Preselection and formatting
[ -n "$libcheckcc" ] && ! _check_compiler_capability "$libcheckcc" && libdescfmt="\Zr\Z1" || libdescfmt=""; #check compiler capabilities
[ ${#libdescfmt} -gt 0 ] && txthint="\n\Zr\Z1${txt_s3tup_menu_library_notsupported}\Zn";
[ "$libversioncompare" == "=" ] && libtxtfmt="\Z2" || libtxtfmt="";
[ "$libversioncompare" == "<" ] && libtxtfmt="\Z1";
[ "$libversioncompare" == ">" ] && [ "${#libversioncurrent}" -gt 0 ] && libselected="on" && libtxtfmt="\Z5" || libselected="off";
[ "$libcheckfile" == "$libselectedflag" ] && libselected="off";
libselectedflag="$libcheckfile";
MENU_OPTIONS+=("$libkey" "${libdesc}$(printf '%*s' $((24-${#libdesc})))${libtxtfmt}$([ $libversioncurrent ] && echo $libversioncompare) $(echo $libversioncurrent | sed -e 's/^$/ ---/g')\Zn" "$(echo $libselected)" "$([ $libname ] && echo "${libdesc}: ${liburl}")");counter;
MENU_OPTIONS+=("$libkey" "${libdescfmt}${libdesc}\Zn$(printf '%*s' $((24-${#libdesc})))${libtxtfmt}$([ $libversioncurrent ] && echo $libversioncompare) $(echo $libversioncurrent | sed -e 's/^$/ ---/g')\Zn" "$(echo $libselected)" "$([ $libname ] && echo "${libdesc}: ${liburl}")");counter;
# 0 key 1 desc 2 version 3 checkversion 4 checkfile 5 current version 6 url 7 tasks array
lib=("$libkey" "$libname" "$libversion" "$libversioncheck" "$libcheck" "$libversioncurrent" "$liburl" "($(printf " %q" "${libtasks[@]}"))");
@ -249,7 +252,7 @@ _integrate_libs(){
else
clear;clear;
opts=$("$gui" "--item-help" "--help-tags" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--default-item" "$lkey" "--ok-label" "${txt_s3tup_menu_command_label_start}" "--help-button" "--help-label" "${txt_s3tup_menu_command_label_info}" "--cancel-label" "$([ ! "$3" -gt 0 ] && echo "${txt_s3tup_menu_command_label_exit}" || echo "${txt_s3tup_menu_command_label_back}")" "--title" "-[ ${txt_s3tup_menu_library_title} - \Z2$tc\Zn ]-" "$cl_"\
"\n${txt_s3tup_menu_library_text1}\n$prefixdir\n\n${txt_s3tup_menu_library_text2}" \
"\n${txt_s3tup_menu_library_text1}\n\Z2$prefixdir\Zn${txthint}\n\n${txt_s3tup_menu_library_text2}" \
0 0 "$COUNT" "${MENU_OPTIONS[@]}");
ret="$?"
fi;
@ -972,11 +975,15 @@ _get_toolchain_libs(){
[ "${!key}" == "0" ] && continue;
libcheck="$key"_check;libcheck="${!libcheck}";
libchecklib="$key"_checklib;libchecklib="${!libchecklib}";
libcheckcc="$key"_checkcc;libcheckcc="${!libcheckcc}";
libversion="$key"_version;libversion="${!libversion}";
libversioncompare=$(_compare_version $libversion $version);
if [[ "$pkg $version" =~ ^${libcheck}.* ]];then #regex match, don't quote the right side
if [ -n "$libchecklib" -a -f "$pkgconfigdir/../$libchecklib" -o -z "$libchecklib" ];then
libs+="$pkg\|$version\|$key\|$libversion\|$libversioncompare\|$name;";
if [ -n "$libchecklib" -a -f "$pkgconfigdir/../$libchecklib" -o -z "$libchecklib" ];then #check existance of special libs
if [ -n "$libcheckcc" ] && _check_compiler_capability "$libcheckcc" || [ -z "$libcheckcc" ];then #check compiler capabilities
libs+="$pkg\|$version\|$key\|$libversion\|$libversioncompare\|$name;";
break;
fi;
fi;
fi;
done;
@ -1288,6 +1295,18 @@ _check_config(){
return 1;
fi;
};
_check_compiler_capability(){
case "$1" in
"c11") #checking if $CC supports -std=c11
CFLAGS="-std=c11";
echo "_Thread_local int x; int main(){x = 42; ; return 0;}" | "$compilername" -x c -o "/tmp/cc_cap_c11.chk" - >/dev/null 2>&1;
ret=$?;
[ -f "/tmp/cc_cap_c11.chk" ] && rm "/tmp/cc_cap_c11.chk";
unset CFLAGS;;
*) ret=1;
esac;
return $ret;
};
_change_config(){
nok=1;
[[ ! $2 =~ "(" ]] && [[ ! $2 =~ ")" ]] && qte="\"" || qte=""; #no quotes if value contains parentheses

1
support/translation/bg

@ -211,6 +211,7 @@ txt_s3tup_menu_toolchain_config="конфиг файл:"
txt_s3tup_menu_library_title="${txt_lib} Меню опресняване"
txt_s3tup_menu_library_text1="Изберете всички библиотеки да опресните в SYSROOT папката на ${txt_tc}:"
txt_s3tup_menu_library_text2=" ${txt_lib} версия NEW CURRENT" #56 знака
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="няма открити библиотеки"
txt_s3tup_menu_library_wrong_selection="Не интегрирайте същите библиотеки с различна версия!"

1
support/translation/de

@ -219,6 +219,7 @@ txt_s3tup_menu_toolchain_config="Konfigurationsdatei:"
txt_s3tup_menu_library_title="${txt_lib} Aktualisierung Menü"
txt_s3tup_menu_library_text1="Wählen Sie alle zu aktualisierenden ${txt_lib}en im SYSROOT-Verzeichnis der ${txt_tc} aus:"
txt_s3tup_menu_library_text2=" ${txt_lib} Version NEU AKTUELL" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} wird aufgrund fehlender Compiler-Funktionen nicht unterstützt!"
txt_s3tup_menu_library_notfound="Keine ${txt_lib}en gefunden"
txt_s3tup_menu_library_wrong_selection="Integrieren Sie nicht dieselbe Bibliothek mit verschiedenen Versionen!"

1
support/translation/en

@ -210,6 +210,7 @@ txt_s3tup_menu_toolchain_config="config file:"
txt_s3tup_menu_library_title="${txt_lib} Update Menu"
txt_s3tup_menu_library_text1="Select all libraries to update in ${txt_tc,,}'s SYSROOT folder:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} version NEW CURRENT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no libraries found"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

1
support/translation/es

@ -198,6 +198,7 @@ txt_s3tup_menu_toolchain_config="archivo config:"
txt_s3tup_menu_library_title="${txt_lib} Menu Actualización"
txt_s3tup_menu_library_text1="Escoge todas las librerías a actualizar en la carpeta SYSROOT de ${txt_tc,,}:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} versión NUEVA ACTUAL" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no se han encontrado librerías"
txt_s3tup_menu_library_wrong_selection="No integres la misma librería en diferentes versiones!"

1
support/translation/fr

@ -250,6 +250,7 @@ txt_s3tup_menu_toolchain_config="config file:"
txt_s3tup_menu_library_title="${txt_lib} Update Menu"
txt_s3tup_menu_library_text1="Select all libraries to update in ${txt_tc,,}'s SYSROOT folder:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} version NEW CURRENT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no libraries found"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

1
support/translation/it

@ -277,6 +277,7 @@ txt_s3tup_menu_toolchain_config="file di configurazione:"
txt_s3tup_menu_library_title="${txt_lib} Menu di aggiornamento"
txt_s3tup_menu_library_text1="Seleziona tutte le librerie in cui aggiornare la cartella SYSROOT ${txt_tc}:"
txt_s3tup_menu_library_text2=" ${txt_lib} versione nuova ATTUALE" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="nessuna libreria trovata"
txt_s3tup_menu_library_wrong_selection="Non integrare la stessa libreria con versioni differenti!"

1
support/translation/nl

@ -213,6 +213,7 @@ txt_s3tup_menu_toolchain_config="config file:"
txt_s3tup_menu_library_title="${txt_lib} Update Menu"
txt_s3tup_menu_library_text1="Select all libraries to update in ${txt_tc,,}'s SYSROOT folder:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} version NEW CURRENT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no libraries found"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

1
support/translation/pl

@ -213,6 +213,7 @@ txt_s3tup_menu_toolchain_config="config file:"
txt_s3tup_menu_library_title="${txt_lib} Update Menu"
txt_s3tup_menu_library_text1="Select all libraries to update in ${txt_tc,,}'s SYSROOT folder:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} version NEW CURRENT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no libraries found"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

1
support/translation/pt

@ -250,6 +250,7 @@ txt_s3tup_menu_toolchain_config="config file:"
txt_s3tup_menu_library_title="${txt_lib} Update Menu"
txt_s3tup_menu_library_text1="Select all libraries to update in ${txt_tc,,}'s SYSROOT folder:"
txt_s3tup_menu_library_text2=" ${txt_lib,,} version NEW CURRENT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="no libraries found"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

5
support/translation/tr

@ -88,8 +88,8 @@ txt_module_configure="oscam modüllerini seç";
txt_bmenu_use="USE_değişkenler ";
txt_bmenu_build="şimdi oscam oluştur";
txt_bmenu_config="oscam/build yapılandırma";
txt_bmenu_update="update ${txt_lib}";
txt_bmenu_backup="backup ${txt_tc}";
txt_bmenu_update="update ${txt_lib}"
txt_bmenu_backup="backup ${txt_tc"
txt_bmenu_profile="mevcut $txt_profile ile yükle";
txt_bmenus_profile="$txt_profile $txt_save et";
txt_bmenu_log="göster lastbuild.log";
@ -216,6 +216,7 @@ txt_s3tup_menu_toolchain_config="Yapılandırma dosyası:"
txt_s3tup_menu_library_title="${txt_lib} Güncelleme menüsü"
txt_s3tup_menu_library_text1="Güncellenecek icin hepsini seçiniz ${txt_lib}en SYSROOT kayıt defteri içinde ${txt_tc} bul:"
txt_s3tup_menu_library_text2=" ${txt_lib} Version yeni MEVCUT" #56 chars
txt_s3tup_menu_library_notsupported="${txt_lib} is not supported due to missing compiler capabilities!"
txt_s3tup_menu_library_notfound="yok ${txt_lib}en bulundu"
txt_s3tup_menu_library_wrong_selection="Don't integrate the same library with different versions!"

Loading…
Cancel
Save