summaryrefslogtreecommitdiff
path: root/mk/wrapper/cmd-sink-hpux-cc
blob: 913d4be683fabde8906c952967882a943519fac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# $NetBSD $

# 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-cc) pop:  $arg"
	case $arg in
	##############################################################
	# HP-UX ld doesn't support multiple rpath parameters, accumulate
	# them into a single -Wl,+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-cc) 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-cc) drop: $dir [adding to hprunpath]"
		;;
	*)
		. $buildcmd
		;;
	esac
done

if $test -n "$hprunpath"; then
	arg="-Wl,+b,$hprunpath"
	$debug_log $wrapperlog "    (cmd-sink-hpux-cc) pop: $arg [aggregate]"
	. $buildcmd
fi