plan9port/bin/9l

35 lines
670 B
Text
Raw Normal View History

#!/bin/sh
2004-03-26 02:09:17 +00:00
extralibs="-lm"
2004-03-02 17:34:15 +00:00
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
case "$tag" in
2004-03-25 23:03:22 +00:00
*OpenBSD*) ld=gcc
2004-03-26 02:09:17 +00:00
extralibs="$extralibs -lutil -lpthread"
;;
*BSD*) ld=gcc
extralibs="$extralibs -lutil"
;;
*Linux*) ld=gcc
extralibs="$extralibs -lutil"
2004-03-25 23:03:22 +00:00
;;
*Darwin*) ld=gcc ;;
2003-11-25 02:11:11 +00:00
*SunOS*) ld="${CC9:-cc} -g"
2003-11-23 19:49:17 +00:00
extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
2004-03-25 23:03:22 +00:00
# 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
2003-11-23 19:49:17 +00:00
;;
*)
echo do not know how to link on "$tag" 1>&2
exit 1
esac
2003-11-23 19:49:17 +00:00
exec $ld -L$PLAN9/lib "$@" $extralibs