view scripts/single.sh @ 1433:00c20f410c46 draft

Patches to commands for issues reported from static analysis tool. portability.h.patch - it is for O_CLOEXEC, as compiler complained of it. Makefile.patch - for cleaning generated/*.o files and libopts.dat file [Fixup to uniq.c from Rob.]
author Ashwini Sharma <ak.ashwini1981@gmail.com>
date Tue, 12 Aug 2014 07:09:01 -0500
parents 80da35b898eb
children 6bc78fa4c31f
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