blob: fba0c8c818826aca61e291a4044e5f0b9c4e13a6 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001#!/bin/sh
Erik Andersenfac10d72000-02-07 05:29:42 +00002# Make busybox links list file.
Eric Andersencc8ed391999-10-05 16:24:54 +00003
4DF="busybox.def.h"
Eric Andersen17d49ef1999-10-06 20:25:32 +00005MF="busybox.c"
Eric Andersencc8ed391999-10-05 16:24:54 +00006
Erik Andersen6273f652000-03-17 01:12:41 +00007#LIST="$(sed -n '/^#define/{s/^#define BB_FEATURE_.*//g;s/^#define //p;}' $DF)"
Erik Andersene9fee652000-04-06 00:10:39 +00008LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1/gp;' | sort)"
Eric Andersencc8ed391999-10-05 16:24:54 +00009
Eric Andersen17d49ef1999-10-06 20:25:32 +000010for def in ${LIST}; do
Erik Andersend75af992000-03-16 08:09:09 +000011 i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
12 for j in $i; do
13 if [ -z $j ] ; then
14 continue;
15 fi;
16 echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
17 -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
18 -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
19 done;
Eric Andersen17d49ef1999-10-06 20:25:32 +000020done