X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=applets%2Fbusybox.mkll;h=68dbf216262a6cd6a6f64d24a4cbe1c94b62108b;hb=16714245f9a16ce3725aab079aea7b0d28c6b32f;hp=922dcdd81fcf649f216d30e50ab43b51826fc15b;hpb=e2f6e1221330f2944d467cad2fb630deb5ef6f0a;p=oweals%2Fbusybox.git diff --git a/applets/busybox.mkll b/applets/busybox.mkll index 922dcdd81..68dbf2162 100755 --- a/applets/busybox.mkll +++ b/applets/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:-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 + }'