plan9port/bin/9l
rsc 06bb4ed20d Rewrite to remove dependence on rendezvous and its bizarre
data structures.  Makes it easier to use pthreads too.
Still need to add code for non-pthreads systems.

Just a checkpoint to switch work to another machine.
2004-09-17 00:38:29 +00:00

34 lines
680 B
Bash
Executable file

#!/bin/sh
extralibs="-lm"
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
case "$tag" in
*OpenBSD*) ld=gcc
extralibs="$extralibs -lutil -lpthread"
;;
*BSD*) ld=gcc
extralibs="$extralibs -lutil"
;;
*Linux*) ld=gcc
extralibs="$extralibs -lutil -lpthread"
;;
*Darwin*) ld=gcc ;;
*SunOS*) ld="${CC9:-cc} -g"
extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
# Record paths to shared libraries to avoid needing LD_LIBRARY_PATH
for i in "$@"
do
case "$i" in
-L*)
s=`echo $i | sed 's/-L/-R/'`
extralibs="$extralibs $s"
;;
esac
done
;;
*)
echo do not know how to link on "$tag" 1>&2
exit 1
esac
exec $ld -L$PLAN9/lib "$@" $extralibs