# $NetBSD: cmd-sink-hpux-ld,v 1.1 2007/04/14 14:17:50 tnn Exp $ # Empty out the command buffer and build up the command line in $cmd. hprunpath= while ! queue_is_empty cmdbuf; do pop_queue cmdbuf arg $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg" case $arg in ############################################################## # HP-UX ld doesn't support multiple rpath parameters, accumulate # them into a single +b /path1:/path2:...:pathn ############################################################## +b|-Wl,+b|-rpath) pop_queue cmdbuf dir dir="${dir#-Wl,}" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; esac $debug_log $wrapperlog " (cmd-sink-hpux-ld) drop: $dir [adding to hprunpath]" ;; -Wl,+b,*|-R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*) case $arg in -Wl,+b,*) R="-Wl,+b," ;; -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}" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; esac $debug_log $wrapperlog " (cmd-sink-hpux-ld) drop: $dir [adding to hprunpath]" ;; *) . $buildcmd ;; esac done if $test -n "$hprunpath"; then arg=+b $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg" . $buildcmd arg=$hprunpath $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg [aggregate]" . $buildcmd fi