X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=busybox.mkll;h=4e15e1611a5aa6889047f74c8e18f2ced81320ef;hb=8a9b2c6448e32f16e4b65dbd4927d9108c007acc;hp=922dcdd81fcf649f216d30e50ab43b51826fc15b;hpb=e2f6e1221330f2944d467cad2fb630deb5ef6f0a;p=oweals%2Fbusybox.git diff --git a/busybox.mkll b/busybox.mkll index 922dcdd81..4e15e1611 100755 --- a/busybox.mkll +++ b/busybox.mkll @@ -1,23 +1,24 @@ #!/bin/sh # Make busybox links list file. -DF="Config.h" +# 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 -MF=$1 -if [ "$MF" = "" ]; then - MF="applets.h" -fi +# Maintainer: Larry Doolittle -LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\/BB_\1/gp;' | sort)" +export LC_ALL=POSIX +export LC_CTYPE=POSIX -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 +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 + }'