#!/bin/sh
# $Id$
rlist=
rest=
while test $# -gt 0; do
case $1 in
-R|-rpath)
  if test "$rlist"; then
    rlist="${rlist}:$2"
  else
    rlist="$2"
  fi
  shift 2
  ;;
-R*) 
  d=`echo $1 | sed 's,^-R,,'`
  if test "$rlist"; then
    rlist="${rlist}:${d}"
  else
    rlist="${d}"
  fi
  shift
  ;;
*)
  rest="${rest} $1"
  shift
  ;;
esac
done
rpath=
if test "$rlist"; then
  rpath="-rpath $rlist "
fi
echo "${rpath}${rest}"
