aboutsummaryrefslogtreecommitdiff
path: root/scripts/single.sh
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-12-14 21:04:01 -0600
committerRob Landley <rob@landley.net>2019-12-14 21:04:01 -0600
commit348df2b817c13ebb240d7a30d875d0224eb57ff9 (patch)
tree31c6d54d421eae86cb49ea664e3fde6d71915646 /scripts/single.sh
parent8bf47fcdf2da7f7a9b896676c119429bc7d0b4ff (diff)
downloadtoybox-348df2b817c13ebb240d7a30d875d0224eb57ff9.tar.gz
Teach "make sh" to make the multiplexer and builtins, even though it's "single".
Diffstat (limited to 'scripts/single.sh')
-rwxr-xr-xscripts/single.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/single.sh b/scripts/single.sh
index 98a7af30..41d1e33e 100755
--- a/scripts/single.sh
+++ b/scripts/single.sh
@@ -33,16 +33,25 @@ do
exit 1
fi
+ make allnoconfig > /dev/null || exit 1
+
+ DEPENDS=
+ MPDEL=
+ if [ "$i" == sh ]
+ then
+ DEPENDS="$(sed -n 's/USE_\([^(]*\)(NEWTOY([^,]*,.*TOYFLAG_MAYFORK.*/\1/p' toys/*/*.c)"
+ else
+ MPDEL="-e 's/CONFIG_TOYBOX=y/# CONFIG_TOYBOX is not set/;t'"
+ fi
+
# Enable stuff this command depends on
- DEPENDS="$(sed -n "/^config *$i"'$/,/^$/{s/^[ \t]*depends on //;T;s/[!][A-Z0-9_]*//g;s/ *&& */|/g;p}' $TOYFILE | xargs | tr ' ' '|')"
+ DEPENDS="$({ echo $DEPENDS; sed -n "/^config *$i"'$/,/^$/{s/^[ \t]*depends on //;T;s/[!][A-Z0-9_]*//g;s/ *&& */|/g;p}' $TOYFILE ;}| xargs | tr ' ' '|')"
NAME=$(echo $i | tr a-z- A-Z_)
- make allnoconfig > /dev/null &&
- sed -ri -e '/CONFIG_TOYBOX/d' \
+ sed -ri $MPDEL \
-e "s/# (CONFIG_($NAME|${NAME}_.*${DEPENDS:+|$DEPENDS})) is not set/\1=y/" \
"$KCONFIG_CONFIG" &&
- echo "# CONFIG_TOYBOX is not set" >> "$KCONFIG_CONFIG" &&
- grep "CONFIG_TOYBOX_" .config >> "$KCONFIG_CONFIG" &&
+ grep "CONFIG_TOYBOX_" .config >> "$KCONFIG_CONFIG" || exit 1
export OUTNAME="$PREFIX$i"
rm -f "$OUTNAME" &&