Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / wrapper / cmd-sink-osf1-ld
blob02ff3e95d430ebd59f766fdbdc637112218ed19e
1 # $NetBSD: cmd-sink-osf1-ld,v 1.1 2004/11/20 04:37:08 grant Exp $
3 # Empty out the command buffer and build up the command line in $cmd.
4 osf1runpath=
5 while ! queue_is_empty cmdbuf; do
6         pop_queue cmdbuf arg
7         $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop:  $arg"
8         case $arg in
9         ##############################################################
10         # OSF1 ld doesn't support multiple rpath parameters, accumulate
11         # them into a single -rpath /path1:/path2:...:pathn
12         ##############################################################
13         -rpath)
14                 pop_queue cmdbuf dir
15                 case $osf1runpath in
16                 "")     osf1runpath="$dir" ;;
17                 *)      osf1runpath="$osf1runpath:$dir" ;;
18                 esac
19                 $debug_log $wrapperlog "    (cmd-sink-osf1-ld) drop: $dir [adding to osf1runpath]"
20                 ;;
21         -R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*)
22                 case $arg in
23                 -R*)                    R="-R" ;;
24                 -Wl,-R*)                R="-Wl,-R" ;;
25                 -Wl,-rpath,*)           R="-Wl,-rpath," ;;
26                 -Wl,-rpath-link,*)      R="-Wl,-rpath-link," ;;
27                 -Wl,--rpath,*)          R="-Wl,--rpath," ;;
28                 esac
29                 dir="${arg#$R}"
30                 case $osf1runpath in
31                 "")     osf1runpath="$dir" ;;
32                 *)      osf1runpath="$osf1runpath:$dir" ;;
33                 esac
34                 $debug_log $wrapperlog "    (cmd-sink-osf1-ld) drop: $dir [adding to osf1runpath]"
35                 ;;
36         -Wl,-h,*)
37                 arg="-Wl,-soname"${arg#"-Wl,-h"}
38                 $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg"
39                 . $buildcmd
40                 ;;
41         -pthread)
42                 arg="-lpthread"
43                 $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg"
44                 . $buildcmd
45                 ;;
46         *)
47                 . $buildcmd
48                 ;;
49         esac
50 done
52 if $test -n "$osf1runpath"; then
53         arg=-rpath
54         $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg"
55         . $buildcmd
56         arg=$osf1runpath
57         $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg [aggregate]"
58         . $buildcmd