diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-28 21:12:48 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-28 21:12:48 +0000 |
commit | 85e05bb783bf18b84a71354dd688864fcd4e031c (patch) | |
tree | 5c37a9adc3617aafb184deac4bfe2e6819fd91c9 /scripts | |
parent | 36b233719dc13f995b4d8794cd85b21ea032b1c0 (diff) | |
parent | 6511f674cf96a62172cf24639febb6a11b14939c (diff) | |
download | toybox-simpleperf-release.tar.gz |
Snap for 11510257 from 6511f674cf96a62172cf24639febb6a11b14939c to simpleperf-releasesimpleperf-release
Change-Id: I74d7e50aaa3935a44bec09880de65791cc3ff774
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/make.sh | 36 | ||||
-rwxr-xr-x | scripts/single.sh | 3 |
2 files changed, 14 insertions, 25 deletions
diff --git a/scripts/make.sh b/scripts/make.sh index d659e739..3a5d0826 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -154,7 +154,7 @@ fi # Rebuild config.h from .config $SED -En $KCONFIG_CONFIG > "$GENDIR"/config.h \ -e 's/^# CONFIG_(.*) is not set.*/#define CFG_\1 0\n#define USE_\1(...)/p' \ - -e 's/^CONFIG_(.*)=y.*/#define CFG_\1 1\n#define USE_\1(...) __VA_ARGS__\n/p'\ + -e 's/^CONFIG_(.*)=y.*/#define CFG_\1 1\n#define USE_\1(...) __VA_ARGS__/p'\ || exit 1 # Process config.h and newtoys.h to generate FLAG_x macros. Note we must @@ -204,30 +204,18 @@ fi # Extract global structure definitions and flag definitions from toys/*/*.c -function getglobals() { - for i in toys/*/*.c - do - NAME=${i##*/} NAME=${NAME%\.c} - DATA="$($SED -n -e '/^GLOBALS(/,/^)/b got;b;:got' \ - -e 's/^GLOBALS(/_data {/' \ - -e 's/^)/};/' -e 'p' $i)" - [ -n "$DATA" ] && echo -e "// $i\n\nstruct $NAME$DATA\n" - done -} - -if isnewer globals.h toys -then - GLOBSTRUCT="$(getglobals)" - ( - echo "$GLOBSTRUCT" - echo - echo "extern union global_union {" - echo "$GLOBSTRUCT" | \ - $SED -n 's/struct \(.*\)_data {/ struct \1_data \1;/p' - echo "} this;" - ) > "$GENDIR"/globals.h -fi + STRUX="$($SED -ne 's/^#define[ \t]*FOR_\([^ \t]*\).*/\1/;T s1;h;:s1' \ + -e '/^GLOBALS(/,/^)/{s/^GLOBALS(//;T s2;g;s/.*/struct &_data {/;:s2;s/^)/};\n/;p}' \ + $TOYFILES)" + echo "$STRUX" && + echo "extern union global_union {" && + $SED -n 's/^struct \(.*\)_data .*/\1/;T;s/.*/\tstruct &_data &;/p' \ + <<<"$STRUX" && + echo "} this;" +} > "$GENDIR"/globals.h || exit 1 +# -e 'h;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;H;g;s/\n/ /'\ +# -e 's/\([^ ]*\) \(.*\)/\tUSE_\2(struct \1_data \1;)/p')" hostcomp mktags if isnewer tags.h toys diff --git a/scripts/single.sh b/scripts/single.sh index f4f28be9..e2ed9880 100755 --- a/scripts/single.sh +++ b/scripts/single.sh @@ -35,10 +35,11 @@ do make allnoconfig > /dev/null || exit 1 + # For the shell pull in MAYFORK commands from other source files as builtins. unset DEPENDS MPDEL if [ "$i" == sh ] then - DEPENDS="$($SED -n 's/USE_\([^(]*\)(NEWTOY([^,]*,.*TOYFLAG_MAYFORK.*/\1/p' toys/*/*.c)" + DEPENDS="$($SED -n 's/USE_\([^(]*\)(...TOY([^,]*,.*TOYFLAG_MAYFORK.*/\1/p' toys/*/*.c)" else MPDEL='s/CONFIG_TOYBOX=y/# CONFIG_TOYBOX is not set/;t' fi |