summaryrefslogtreecommitdiff
path: root/applets/busybox.mkll
diff options
context:
space:
mode:
authorEric Andersen2000-12-02 00:44:48 +0000
committerEric Andersen2000-12-02 00:44:48 +0000
commit868c057d253c9f96b9646ef49f2f06e9c20181df (patch)
tree77ebde3b4f2581a272e235090349f380bd07d357 /applets/busybox.mkll
parente73fda83111ce7f043be3028b440e8ba96cbf639 (diff)
downloadbusybox-868c057d253c9f96b9646ef49f2f06e9c20181df.zip
busybox-868c057d253c9f96b9646ef49f2f06e9c20181df.tar.gz
Patch from Larry Doolittle so it will build the newdocs right.
Diffstat (limited to 'applets/busybox.mkll')
-rwxr-xr-xapplets/busybox.mkll33
1 files changed, 13 insertions, 20 deletions
diff --git a/applets/busybox.mkll b/applets/busybox.mkll
index 922dcdd..12fa06f 100755
--- a/applets/busybox.mkll
+++ b/applets/busybox.mkll
@@ -1,23 +1,16 @@
#!/bin/sh
# Make busybox links list file.
-DF="Config.h"
-
-MF=$1
-if [ "$MF" = "" ]; then
- MF="applets.h"
-fi
-
-LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)"
-
-for def in ${LIST}; do
- i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
- for j in $i; do
- if [ -z $j ] ; then
- continue;
- fi;
- echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
- -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
- -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
- done;
-done
+CONFIG_H=${1:-Config.h}
+APPLETS_H=${2:-applets.h}
+gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
+ awk '/^[ \t]*LINK/{
+ match($2,"_BB_DIR[A-Z_]*")
+ dir=substr($2,RSTART+7,RLENGTH-7)
+ gsub("_","/",dir)
+ if(dir=="/ROOT") dir=""
+ file=$3
+ gsub("\"","",file)
+ if (file=="busybox") next
+ print tolower(dir) "/" file
+ }'