Browse Source

s3.TUP EXTRA_LDFLAGS autodetection freetz-ng (v0.22.2)

- autodetect use of LDFLAGS when building freetz-ng toolchains
- better commandline output formatting with -l (--libs) or -lv (--libs-version) parameters (use extened ansi background color variables from s3)
- add freetz-ng FNG_SEPARATE_DYNAMIC_LINKER variable to config template
- remove fix ldflags setting from cross toolchain template fos_m72x_mips
- fix some whitespaces
pull/57/head
WXbet 4 years ago
parent
commit
cdd094a2cd
  1. 3
      support/configs/plugin_update_toolchain.config.template
  2. 7
      support/crosstool/templates/fos_m72x_mips
  3. 26
      support/functions/_plugin_update_toolchain

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="27";
S3TUP_CONFIG_VERSION="28";
# Tokens that are replaced automatically:
# @CTNGSOURCE@ crosstool-NG source folder; support/crosstool/crosstool-ng
@ -41,6 +41,7 @@ CTNG_SETUP_tasks+=('make;'); # setup command9
# freetz-NG toolchain build settings
FNG_REPO_URL="https://github.com/Freetz-NG/freetz-ng.git"; # Repository to load freetz-ng from
FNG_SEPARATE_DYNAMIC_LINKER="/usr/lib/freetz/ld-uClibc.so.0";
FNG_CONFIG_tasks=('make menuconfig;'); # config command1
FNG_CONFIG_tasks+=('TPL_SAVE=$($gui --defaultno --output-fd 1 --ok-label "${txt_s3tup_menu_command_label_yes}" --cancel-label "${txt_s3tup_menu_command_label_no}" --colors $bt_ "$title_ - \Z0$pdesc\Zn" --title "-[ ${txt_s3tup_menu_edit_title} ]-" --inputbox "\n${txt_s3tup_menu_edit_text}" 10 55 "@TEMPLATE@") && cp ".config" "$TPL_SAVE";'); # config command2
FNG_BUILD_tasks=('make olddefconfig | tee -a "@LOGFILE@";'); # build command1

7
support/crosstool/templates/fos_m72x_mips

@ -1,7 +1,6 @@
#toolchain template: FRITZ!Box 7590 and other GRX models 7.2x
#toolchain template version: 4
#toolchain template updated: 2020-10-18 21:25:17
#toolchain template ldflags: -Wl,-dynamic-linker,/usr/lib/freetz/ld-uClibc.so.0
#toolchain template: FRITZ!Box 7590|7490 7.2x
#toolchain template version: 5
#toolchain template updated: 2020-10-30 22:25:17
FREETZ_USER_LEVEL_EXPERT=y
FREETZ_SHOW_ADVANCED=y
FREETZ_SHOW_EXPERT=y

26
support/functions/_plugin_update_toolchain

@ -3,7 +3,7 @@
#simplebuild_plugin tcupdate
tcupdate(){
pversion="0.22.1";
pversion="0.22.2";
pname="s3.TUP";
pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config";
@ -15,7 +15,7 @@ tcupdate(){
andksrcdir="$ctdir/android-ndk";
cpus="$(getconf _NPROCESSORS_ONLN)";
[ -f "$workdir/DEVELOPMENT" ] && disable_syscheck="1" && disable_template_versioning="1";
s3_update_required=0;
s3_update_required=1;
CMDTC="$1";
OPTION1="$2";
@ -320,7 +320,7 @@ _integrate_libs(){
_create_tc(){
_sz; # Prepare DIALOG settings
unset TPL_LIST;
local menu_close libkeys use;
local menu_close libkeys use ldf;
while [ ! $menu_close ]
do
if [ "${#2}" -gt 0 ];then #Force setup call
@ -489,7 +489,6 @@ _create_tc(){
case "$tpl_type" in
"CTNG") #get target from build.log
target=$(sed -n -e '/target = / s/.*\= *//p' "$ctsrcdir/build.log");
use="";
#get CT_BUILD_TOP_DIR aka temporary toolchain build directory from build.log and delete it to save disk space
buildtopdir=$(sed -n -e '/CT_BUILD_TOP_DIR=\// s/.*\= *//p' "$ctsrcdir/build.log");
@ -498,7 +497,8 @@ _create_tc(){
btcbindir=$(grep -i '{ PATH=.*kernel.*' "$logfile" | head -n 1 | awk -F':|"' '{print $2}');
btcdir=$(realpath "$btcbindir/../");
target=$(basename "$btcdir");
use="";
#autodetect LDFLAGS depending on the freetz-ng configuration options
[ $(grep -i '^FREETZ_AVM_PROP_UCLIBC_SEPARATE=y' "$ctsrcdir/.config") ] && ldf="-Wl,-dynamic-linker,${FNG_SEPARATE_DYNAMIC_LINKER}";
#copy toolchain folder
rm -rf "$tcdir/$tpl";
@ -533,8 +533,9 @@ _create_tc(){
props=$(_get_template_properties "$cttpldir/$tpl");
desc=$(echo "$props" | awk -F'^' '{print $1}' | xargs);
cflags=$(echo "$props" | awk -F'^' '{print $3}' | xargs);
ldflags=$(echo "$props" | awk -F'^' '{print $4}' | xargs);
_create_toolchaincfg "$tcdir/$tpl" "$tpl" "$target" "$sysroot" "" "$desc" "" "$dldir/$(decode "$_t1e")$tpl.tar.xz" "yes" "$tpl_type_name" "$use" "$cflags" "$ldflags" "$tpl_type";
[ -z "$ldf" ] && ldf=$(echo "$props" | awk -F'^' '{print $4}' | xargs);
_create_toolchaincfg "$tcdir/$tpl" "$tpl" "$target" "$sysroot" "" "$desc" "" "$dldir/$(decode "$_t1e")$tpl.tar.xz" "yes" "$tpl_type_name" "$use" "$cflags" "$ldf" "$tpl_type";
else
_paktc_timer 10;
fi;
@ -995,8 +996,8 @@ _list_toolchain_libkeys(){
do
if [ -d "$tcdir/$tc" ];then
#print out table header
[ -z "$props" -a -z "$2" ] && printf "\n%-30s %-45s %-30s %s\n" "${txt_tc}" "${txt_s3tup_msg_table_header_libs_col_key}" "${txt_s3tup_msg_table_header_libs_col_update}" "${txt_s3tup_msg_table_header_libs_col_downgrade}"
[ -z "$props" -a -n "$2" ] && printf "\n%-30s %-11s %21s %3s %-12s %-10s %s\n" "${txt_tc}" "${txt_s3tup_msg_table_header_libsversion_col_key}" "${txt_s3tup_msg_table_header_libsversion_col_curversion}" "" "${txt_s3tup_msg_table_header_libsversion_col_newversion}" "${txt_s3tup_msg_table_header_libsversion_col_update}" "${txt_s3tup_msg_table_header_libsversion_col_downgrade}"
[ -z "$props" -a -z "$2" ] && printf "${bk_n}${lg_lb}\n%-30s %-45s %-30s %s${re_}" "${txt_tc}" "${txt_s3tup_msg_table_header_libs_col_key}" "${txt_s3tup_msg_table_header_libs_col_update}" "${txt_s3tup_msg_table_header_libs_col_downgrade}"
[ -z "$props" -a -n "$2" ] && printf "${bk_n}${lg_lb}\n%-30s %-11s %21s %3s %-12s %-10s %s${re_}" "${txt_tc}" "${txt_s3tup_msg_table_header_libsversion_col_key}" "${txt_s3tup_msg_table_header_libsversion_col_curversion}" "" "${txt_s3tup_msg_table_header_libsversion_col_newversion}" "${txt_s3tup_msg_table_header_libsversion_col_update}" "${txt_s3tup_msg_table_header_libsversion_col_downgrade}"
#get toolchain properties
props=$(_get_toolchain_properties "$tc");
@ -1034,8 +1035,9 @@ _list_toolchain_libkeys(){
newversion="${fmt}${newversion::16}${re_}";
[ -z "$update" ] && update="-" || P2=1;
[ -z "$downgrade" ] && downgrade="-";
fmt="%-30s %-$((11+$ADD))b %$((21+$ADD))b %-$((1+$ADD))b %-$((16+$ADD))b %-$((11+$ADD*$P2))b %b\n";
printf "$fmt" "${tc::30}" "$libkey" "$curversion" "$compare" "$newversion" "$update" "$downgrade";
[ -n "$tc" ] && fmt="\n"
fmt="${fmt}%-30s %-$((11+$ADD))b %$((21+$ADD))b %-$((1+$ADD))b %-$((16+$ADD))b %-$((11+$ADD*$P2))b %b\n";
printf "$fmt" "$NL${tc::30}" "$libkey" "$curversion" "$compare" "$newversion" "$update" "$downgrade";
fi;
done;
@ -1047,7 +1049,7 @@ _list_toolchain_libkeys(){
[ "$R" -gt 0 ] && downgradable="${downgradable%?}";
[ -z "$downgradable" ] && downgradable="-";
fmt="%-30s %-$((45+$ADD*$CUR))b %-$((30+$ADD*$P))b %b\n";
fmt="\n%-30s %-$((45+$ADD*$CUR))b %-$((30+$ADD*$P))b %b";
printf "$fmt" "${tc::30}" "${libkeys%?}" "$updatable" "$downgradable";
fi;
fi;

Loading…
Cancel
Save