X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=applets%2Fbusybox.mkll;h=5b6677d03bdc921cdd038026dea28bc9cd503db0;hb=edc388cf4ef381282d13e2873694e3c9032214e4;hp=fba0c8c818826aca61e291a4044e5f0b9c4e13a6;hpb=e9fee653dcceacb65b965f77dc20437cd862d976;p=oweals%2Fbusybox.git diff --git a/applets/busybox.mkll b/applets/busybox.mkll index fba0c8c81..5b6677d03 100755 --- a/applets/busybox.mkll +++ b/applets/busybox.mkll @@ -1,20 +1,24 @@ #!/bin/sh # Make busybox links list file. -DF="busybox.def.h" -MF="busybox.c" +# 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 -#LIST="$(sed -n '/^#define/{s/^#define BB_FEATURE_.*//g;s/^#define //p;}' $DF)" -LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\/\1/gp;' | sort)" +# Maintainer: Larry Doolittle -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 +export LC_ALL=POSIX +export LC_CTYPE=POSIX + +CONFIG_H=${1:-include/config.h} +APPLETS_H=${2:-include/applets.h} +gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H | + awk '/^[ \t]*LINK/{ + dir=substr($2,8) + gsub("_","/",dir) + if(dir=="/ROOT") dir="" + file=$3 + gsub("\"","",file) + if (file=="busybox") next + print tolower(dir) "/" file + }'