aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rwxr-xr-xapplets/busybox.mkll33
1 files changed, 13 insertions, 20 deletions
diff --git a/applets/busybox.mkll b/applets/busybox.mkll
index 922dcdd81..12fa06f40 100755
--- a/applets/busybox.mkll
+++ b/applets/busybox.mkll
@@ -1,23 +1,16 @@
1#!/bin/sh 1#!/bin/sh
2# Make busybox links list file. 2# Make busybox links list file.
3 3
4DF="Config.h" 4CONFIG_H=${1:-Config.h}
5 5APPLETS_H=${2:-applets.h}
6MF=$1 6gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
7if [ "$MF" = "" ]; then 7 awk '/^[ \t]*LINK/{
8 MF="applets.h" 8 match($2,"_BB_DIR[A-Z_]*")
9fi 9 dir=substr($2,RSTART+7,RLENGTH-7)
10 10 gsub("_","/",dir)
11LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)" 11 if(dir=="/ROOT") dir=""
12 12 file=$3
13for def in ${LIST}; do 13 gsub("\"","",file)
14 i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF` 14 if (file=="busybox") next
15 for j in $i; do 15 print tolower(dir) "/" file
16 if [ -z $j ] ; then 16 }'
17 continue;
18 fi;
19 echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
20 -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
21 -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
22 done;
23done