# HG changeset patch # User Paul Boddie # Date 1530643120 -7200 # Node ID 9d145c1486e3ad8feedd6203ac2fe7073397a672 # Parent 277edce320f6aec075ddd0fc370e0b7c245b3411 Introduced some parameterisation for the build directory and architecture. diff -r 277edce320f6 -r 9d145c1486e3 tools/listlibs.sh --- a/tools/listlibs.sh Tue Jul 03 20:37:23 2018 +0200 +++ b/tools/listlibs.sh Tue Jul 03 20:38:40 2018 +0200 @@ -4,16 +4,82 @@ if [ ! "$CONF" ] || [ ! -e "$CONF" ] ; then cat 1>&2 < +Usage: $0 [ ] [ ] List modules required by the given system/payload configuration. These modules should be added to the configuration file so that the dynamic linker can find them in the running system. + +The optional build directory indicates where executable programs may be found, +having been built. An initial build must have been performed before running this +program. EOF exit 1 fi -BIN=mybuild/bin/mips_32/l4f +ARCH= +ARCHDIR= +BUILDDIR= + +# Look for an architecture or build directory. + +if [ "$2" ] ; then + if [ -e "$2" ] ; then + BUILDDIR="$2" + else + ARCH="$2" + fi +fi + +# Look for any additional build directory. + +if [ ! "$BUILDDIR" ] && [ "$3" ] && [ -e "$3" ] ; then + BUILDDIR="$3" +fi + +# Use a default build directory if none specified or found. + +if [ ! "$BUILDDIR" ] ; then + BUILDDIR=mybuild +fi + +if [ ! -e "$BUILDDIR" ] ; then + cat 1>&2 <&2 <&2 < "$TMPLIBS" @@ -31,10 +97,17 @@ if [ "$PROG" != "$MODULE" ] ; then continue fi + PROG=`basename "$MODULE" .txt` + if [ "$PROG" != "$MODULE" ] ; then + continue + fi if [ ! -e "$BIN/$PROG" ] ; then echo "Not found: $PROG" 1>&2 exit 1 fi + + # NOTE: Architecture needs fixing. + mipsel-linux-gnu-readelf -d "$BIN/$PROG" | grep NEEDED | sed 's/.*\[//;s/\]$//' >> "$TMPLIBS" done