mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
cb376eebf0
http://busybox.net/lists/busybox/2005-September/015766.html I renamed it "individual" to not confuse it with the standalone shell. (Which it isn't compatible with for obvious reasons.) Configure busybox (I did make defconfig), then run scripts/individual and it'll build an individual version of each applet in the "build" subdirectory. Currently it builds 146 and fails to build 104 applets out of "make defconfig". I haven't taught it about multi-file applets yet (like tar), or the ones where two applets get built from the same source (for example, zcat is a trivial variant of gunzip so there is no zcat.c). But here's a start.
38 lines
881 B
Bash
Executable File
38 lines
881 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Make our prerequisites.
|
|
|
|
make busybox.links include/bb_config.h
|
|
|
|
# Adding "libbb/libbb.a" to the previous line doesn't work, nor does going
|
|
# "make libbb.a" in the libb directory. The busybox makefile has layers and
|
|
# layers of overcomplicated brokenness...
|
|
|
|
cd libbb
|
|
make
|
|
cd ..
|
|
|
|
# Here are a few that build in a standard way. Others are easy to get to
|
|
# build, for example miscutils/dc needs -lm and most of loginutils/* needs
|
|
# -lcrypt...
|
|
|
|
rm -rf build
|
|
mkdir build
|
|
for APPLET in `sed 's .*/ ' busybox.links`
|
|
do
|
|
j=`find . -name "$APPLET.c"`
|
|
if [ -z "$j" ]
|
|
then
|
|
echo no file for $APPLET
|
|
else
|
|
echo "Building $APPLET..."
|
|
gcc -Os -o build/$APPLET applets/individual.c $j libbb/libbb.a -Iinclude -DAPPLET_main=${APPLET}_main -DAPPLET_full_usage=${APPLET}_full_usage
|
|
if [ $? -ne 0 ];
|
|
then
|
|
echo "Failed."
|
|
fi
|
|
fi
|
|
done
|
|
|
|
strip build/*
|