aboutsummaryrefslogtreecommitdiff
path: root/scripts/single.sh
blob: c6416a35963c5346937d6ff73a78baa4e1b9fa5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# Build a standalone toybox command

if [ -z "$1" ]
then
  echo "usage: single.sh command..." >&2
  exit 1
fi

for i in "$@"
do
  NAME=$(echo $i | tr a-z- A-Z_)
  export KCONFIG_CONFIG=.singleconfig
  USET="is not set"

  make allnoconfig > /dev/null &&
  sed -i -e "s/\(CONFIG_TOYBOX\)=y/# \1 $USET/" \
         -e "s/# \(CONFIG_$NAME\) $USET/\1=y/"  \
         -e "s/# \(CONFIG_${NAME}_.*\) $USET/\1=y/" \
         -e "s/# \(CONFIG_TOYBOX_HELP.*\) $USET/\1=y/" \
         -e "s/# \(CONFIG_TOYBOX_I18N\) $USET/\1=y/" \
         -e "s/# \(CONFIG_TOYBOX_FLOAT\) $USET/\1=y/" \
         "$KCONFIG_CONFIG" &&
  make &&
  mv toybox $PREFIX$i || exit 1
done