X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=applets%2Fbusybox.mkll;h=68dbf216262a6cd6a6f64d24a4cbe1c94b62108b;hb=16714245f9a16ce3725aab079aea7b0d28c6b32f;hp=c4420f50d52636bf1295cc6ebbf868ef785a7dc0;hpb=fac10d7c59f7db0facd5fb94de273310b9ec86e6;p=oweals%2Fbusybox.git diff --git a/applets/busybox.mkll b/applets/busybox.mkll index c4420f50d..68dbf2162 100755 --- a/applets/busybox.mkll +++ b/applets/busybox.mkll @@ -1,15 +1,24 @@ #!/bin/sh # Make busybox links list file. -DF="busybox.def.h" -MF="busybox.c" - -LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" - -for def in ${LIST}; do - i=`sed -n 's/^#ifdef \<'$def'\>.*\/\/\(.*$\)/\/\1\//gp' $MF` - j=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF` - for k in $j; do - echo $i$k - done -done +# input $1: full path to Config.h +# input $2: full path to applets.h +# output (stdout): list of pathnames that should be linked to busybox + +# Maintainer: Larry Doolittle + +export LC_ALL=POSIX +export LC_CTYPE=POSIX + +CONFIG_H=${1:-include/autoconf.h} +APPLETS_H=${2:-include/applets.h} +$HOSTCC -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H | + awk '/^[ \t]*LINK/{ + dir=substr($2,7) + gsub("_","/",dir) + if(dir=="/ROOT") dir="" + file=$3 + gsub("\"","",file) + if (file=="busybox") next + print tolower(dir) "/" file + }'