#!/usr/bin/sh # # Input: # ------ # Process a line of input with the following form : # -llib1 -llib2 -llib3 PackageName PackageName2 # # Each package is assumed to contain a GNUmakefile at the top level # and contain a variable 'PackageLibs' which is set to a line as indicated # above # # e.g. # PackageLibs:= -lmysubpakcage1 -lmysubpackage2 Tracker # # Output: # ------ # A list of -l libraries picked up recursively from all the specified packages # # Assumptions: # ------------- # Do to a lack of mechanism for specifying the top level of a package # we hardcode it to be one directory down from the top of the tree. # We have to get these from the SRT environment reltop="$BFDIST/releases/$BFCURRENT" localtop=$PWD #echo localtop = $localtop #echo reltop = $reltop thisscript="linklistSRT" for i in "$@" do if [ `echo $i | grep -c '^-l'` = 0 ] ; then # OK weve got a dependent package to process filenames="$localtop/$i/GNUmakefile $reltop/$i/GNUmakefile" for file in $filenames do if [ -r $file ] ; then line=`grep 'PackageLibs *:=' $file | sed 's/PackageLibs *:= *//' ` out="$out `$thisscript $line`" break fi done else # Just send it on if its a library out="$out $i" fi done echo $out