2006-08-05 02:35:33 +05:30
|
|
|
#!/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 ..
|
|
|
|
|
2006-08-05 06:11:39 +05:30
|
|
|
cd archival/libunarchive
|
|
|
|
make
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# 146 applets build without any extra stuff. The applet is one C file with
|
|
|
|
# the same name as the corresponding applet, and all it needs to link against
|
|
|
|
# is libbb.a. However, 104 of them need more than that.
|
|
|
|
|
|
|
|
# dpkg_deb gzip
|
|
|
|
function extra_libraries()
|
|
|
|
{
|
|
|
|
archival="ar bunzip2 unlzma cpio dpkg gunzip rpm2cpio rpm tar uncompress unzip dpkg_deb gzip "
|
|
|
|
if [ "${archival/$1 //}" != "${archival}" ]
|
|
|
|
then
|
|
|
|
echo "archival/libunarchive/libunarchive.a"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-08-05 02:35:33 +05:30
|
|
|
# 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
|
2006-08-05 06:11:39 +05:30
|
|
|
|
2006-08-05 02:35:33 +05:30
|
|
|
for APPLET in `sed 's .*/ ' busybox.links`
|
|
|
|
do
|
2006-08-05 06:11:39 +05:30
|
|
|
APPFILT=${APPLET/-/_}
|
|
|
|
j=`find . -name "${APPLET/-/?}.c"` # Because ether-wake.c is broken.
|
2006-08-05 02:35:33 +05:30
|
|
|
if [ -z "$j" ]
|
|
|
|
then
|
|
|
|
echo no file for $APPLET
|
|
|
|
else
|
|
|
|
echo "Building $APPLET..."
|
2006-08-05 06:11:39 +05:30
|
|
|
gcc -Os -o build/$APPLET applets/individual.c $j \
|
|
|
|
`extra_libraries $APPFILT` libbb/libbb.a -Iinclude \
|
|
|
|
-DBUILD_INDIVIDUAL \
|
|
|
|
"-Drun_applet_by_name(...)" "-Dfind_applet_by_name(...) 0" \
|
|
|
|
-DAPPLET_main=${APPFILT}_main -DAPPLET_full_usage=${APPFILT}_full_usage
|
2006-08-05 02:35:33 +05:30
|
|
|
if [ $? -ne 0 ];
|
|
|
|
then
|
|
|
|
echo "Failed."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
strip build/*
|