#!/bin/sh -f

#set -x

lib=$1

if test `uname` = "HP-UX" ; then
  /bin/rm -f lib${lib}.sl
  
  objs=`ls *.o`
  if test ! "$objs" = "" ; then
    /bin/rm -f *.o
  fi
  ar x ../lib${lib}.a
  ld -b -o lib${lib}.sl *.o $2 -lc
  /bin/rm -f *.o
fi

if test `uname` = "OSF1" ; then
  /bin/rm -f lib${lib}.so
  ld -shared -o lib${lib}.so -all ../lib${lib}.a $2 -lc -rpath `dirs`
  cxx -Wl,shared,all -o lib${lib}.so ../lib${lib}.a $2 -lc -rpath `dirs`
fi

if test `uname` = "SunOS" ; then
#  objs=`ls *.o`
#  if test ! "$objs" = "" ; then
#    /bin/rm -f *.o
#  endif
#  ar x ../lib${lib}.a
#  $CILINK -o lib${lib}.so *.o $2 -lc
#  /bin/rm -f *.o
fi


