9l: search for autolibs in all -L paths as well as $PLAN9/lib
This commit is contained in:
parent
41305b2355
commit
d210f09d22
1 changed files with 22 additions and 8 deletions
20
bin/9l
20
bin/9l
|
|
@ -27,16 +27,25 @@ fi
|
||||||
if $doautolib
|
if $doautolib
|
||||||
then
|
then
|
||||||
ofiles=""
|
ofiles=""
|
||||||
|
lpaths="$PLAN9/lib"
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
*.[ao])
|
*.[ao])
|
||||||
ofiles="$ofiles $i"
|
ofiles="$ofiles $i"
|
||||||
;;
|
;;
|
||||||
|
-L*)
|
||||||
|
l=`echo $i | sed 's/-L//'`
|
||||||
|
lpaths="$lpaths $l"
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# echo "ofiles $ofiles"
|
if $verbose
|
||||||
|
then
|
||||||
|
echo "ofiles $ofiles"
|
||||||
|
echo "lpaths $lpaths"
|
||||||
|
fi
|
||||||
|
|
||||||
autolibs=""
|
autolibs=""
|
||||||
if [ "x$ofiles" != "x" ]
|
if [ "x$ofiles" != "x" ]
|
||||||
then
|
then
|
||||||
|
|
@ -68,13 +77,18 @@ then
|
||||||
# can't trust the libraries about using
|
# can't trust the libraries about using
|
||||||
# libthread or libdraw - we might not be linking with
|
# libthread or libdraw - we might not be linking with
|
||||||
# those object files.
|
# those object files.
|
||||||
a=`
|
a=""
|
||||||
nm $PLAN9/lib/lib$i.a 2>/dev/null |
|
for lpath in $lpaths
|
||||||
|
do
|
||||||
|
b=`
|
||||||
|
nm $lpath/lib$i.a 2>/dev/null |
|
||||||
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
grep '__p9l_autolib_[a-zA-Z0-9+-]*$' |
|
||||||
sed 's/.*__p9l_autolib_//' |
|
sed 's/.*__p9l_autolib_//' |
|
||||||
sort -u |
|
sort -u |
|
||||||
egrep -v '^(thread|draw)$'
|
egrep -v '^(thread|draw)$'
|
||||||
`
|
`
|
||||||
|
a="$a $b"
|
||||||
|
done
|
||||||
# fix up libraries that really need draw
|
# fix up libraries that really need draw
|
||||||
if [ "x$i" = "xmemdraw" -o "x$i" = "xmemlayer" -o "x$i" = "xframe" ]
|
if [ "x$i" = "xmemdraw" -o "x$i" = "xmemlayer" -o "x$i" = "xframe" ]
|
||||||
then
|
then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue