X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=applets%2Fbusybox.mkll;h=5b6677d03bdc921cdd038026dea28bc9cd503db0;hb=edc388cf4ef381282d13e2873694e3c9032214e4;hp=90f28e8b73352041d31643fa463d27855fccbc63;hpb=6273f655c8e5a1b7233f94fd606ceaed95b9c7a7;p=oweals%2Fbusybox.git diff --git a/applets/busybox.mkll b/applets/busybox.mkll index 90f28e8b7..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="$(cpp $DF -dM | 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 + }'