# $NetBSD: cmd-sink-irix-ld,v 1.1 2008/02/19 17:36:51 tnn Exp $

# Empty out the command buffer and build up the command line in $cmd.
while ! queue_is_empty cmdbuf; do
	pop_queue cmdbuf arg
	$debug_log $wrapperlog "    (cmd-sink-irix-ld) pop:  $arg"
	case $arg in
	-R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*)
		case $arg in
		-R*)			R="-R" ;;
		-Wl,-R*)		R="-Wl,-R" ;;
		-Wl,-rpath,*)		R="-Wl,-rpath," ;;
		-Wl,-rpath-link,*)	R="-Wl,-rpath-link," ;;
		-Wl,--rpath,*)		R="-Wl,--rpath," ;;
		esac
		dir="${arg#$R}"
		arg="-rpath"
		. $buildcmd
		arg="$dir"
		. $buildcmd
		;;
	*)
		. $buildcmd
		;;
	esac
done