view scripts/single.sh @ 1405:43c98def61cc draft

Patch from Isaac Dunham to work around the deficiencies in musl's regex engine (which break building under alpine linux). Musl's regex engine doesn't support \| which changes the behavior of busybox sed, breaks toybox grep... I need to come up with a musl patch, in the meantime here's a workaround.
author Rob Landley <rob@landley.net>
date Sun, 27 Jul 2014 15:19:49 -0500
parents 8a67f42e4f76
children 80da35b898eb
line wrap: on
line source

#!/bin/bash

# Build a standalone toybox command

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

NAME=$(echo $1 | 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_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$1