summaryrefslogtreecommitdiff
path: root/mk/buildlink3/mipspro-ucode-cc-post-logic
blob: 1f2a28e2322704998b4129c47ce8ddd74dc9e9d5 (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
# $NetBSD: mipspro-ucode-cc-post-logic,v 1.2 2004/03/13 03:41:13 uebayasi Exp $
#
# Silently accept some GCC compiler arguments by silently converting
# them to the MIPSpro compiler equivalents.  This makes the MIPSpro
# compiler wrappers work with more software that seems to assume GCC
# nowadays.

case $arg in
-O[0123])
	# MIPSpro can handle -O[0123] so just pass them on through.
	;;
-O*)
	# Ignore all other -O* options.
	arg=
	addtoprivatecache=yes
	;;
-Wl,-R*)
	# Directories for the runtime library search path are passed
	# via "-Wl,-rpath,<dir>", not "-Wl,-R<dir>".
	#
	arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,-R|-Wl,-rpath,|g"`
	addtoprivatecache=yes
	;;
-Wl,*)
	# The MIPSpro compiler accepts these -W* directives, so just
	# accept them and pass them on through.
	;;
-W*)
	# Ignore all of the other -W* directives, which are likely to
	# be GCCisms.
	#
	arg=
	addtoprivatecache=yes
	;;
-f[Pp][Ii][Cc])
	# The MIPSpro compiler uses -KPIC to create position independent code.
	#
	arg=-KPIC
	addtoprivatecache=yes
	;;
esac