X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=busybox.mkll;h=4e15e1611a5aa6889047f74c8e18f2ced81320ef;hb=6fc92a506ab3c490a4dc028334c908f19c0d0806;hp=fa1bff209b11c9a27adb494fca3937c5d0e9569b;hpb=d75af99529879e6cd38164fd110732052a9cdda4;p=oweals%2Fbusybox.git diff --git a/busybox.mkll b/busybox.mkll index fa1bff209..4e15e1611 100755 --- a/busybox.mkll +++ b/busybox.mkll @@ -1,19 +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)" +# 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:-Config.h} +APPLETS_H=${2:-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 + }'