diff options
author | rsc <devnull@localhost> | 2005-01-04 21:13:58 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-04 21:13:58 +0000 |
commit | ead3e31153b4258073dd16f990e0bc1842646562 (patch) | |
tree | 1ccebd6d8b4e60166304135573c4f69ab36123b8 /bin/9l | |
parent | e9a569a96aa4b4b4f18a6d8ade511ee7812c30a6 (diff) | |
download | plan9port-ead3e31153b4258073dd16f990e0bc1842646562.tar.gz plan9port-ead3e31153b4258073dd16f990e0bc1842646562.tar.bz2 plan9port-ead3e31153b4258073dd16f990e0bc1842646562.zip |
9c: ignore autolib symbols
9l: use autolib symbols
Diffstat (limited to 'bin/9l')
-rwxr-xr-x | bin/9l | 116 |
1 files changed, 115 insertions, 1 deletions
@@ -1,5 +1,115 @@ #!/bin/sh +libsl="" + +doautolib=1 +verbose=0 + +if [ "x$1" = "x-l" ] +then + shift + doautolib=0 +elif [ "x$1" = "x-v" ] +then + shift + verbose=1 +fi + +if [ $doautolib = 1 ] +then + ofiles="" + for i + do + case "$i" in + [^-]*.o) + ofiles="$ofiles $i" + ;; + esac + done + + # echo "ofiles $ofiles" + autolibs="" + if [ "x$ofiles" != "x" ] + then + autolibs=` + nm $ofiles | + grep '__p9l_autolib_[a-zA-Z0-9+-]*$' | + sed 's/.* __p9l_autolib_//' | + sort -u + ` + fi + # echo "autolibs $autolibs" + + libsl="" + special="mp draw 9pclient mux thread bio" # order matters + for i in $special + do + eval "need$i=0" + done + + for i in $autolibs + do + case "$i" in + 9pclient) + need9pclient=1 + needmux=1 + needthread=1 + ;; + bio) + needbio=1 + ;; + draw) + needdraw=1 + ;; + mp) + needmp=1 + ;; + mux) + needmux=1 + needthread=1 + ;; + plumb) + need9pclient=1 + needmux=1 + needthread=1 + libsl="$libsl -lplumb" + ;; + sec) + needmp=1 + libsl="$libsl -lsec" + ;; + thread) + needthread=1 + ;; + venti) + libsl="$libsl -lventi" + needthread=1 + ;; + *) + libsl="$libsl -l$i" + ;; + esac + done + + for i in $special + do + if eval "[ \$need$i = 1 ]" + then + libsl="$libsl -l$i" + fi + done + libsl="$libsl -l9" + + if [ $needdraw = 1 ] + then + if [ "x$X11" = "x" ] + then + X11=/usr/X11R6 + fi + libsl="$libsl -L$X11/lib -lX11" + fi +fi + extralibs="-lm" tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}" case "$tag" in @@ -36,4 +146,8 @@ case "$tag" in exit 1 esac -exec $ld -L$PLAN9/lib "$@" $extralibs +if [ $verbose = 1 ] +then + echo $ld -L$PLAN9/lib "$@" $libsl $extralibs +fi +exec $ld -L$PLAN9/lib "$@" $libsl $extralibs |