summaryrefslogtreecommitdiff
path: root/mk/buildlink3/sunpro-cc-post-logic
blob: 64907d909f939e410d9a69e9381415f55d239242 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# $NetBSD: sunpro-cc-post-logic,v 1.8.2.2 2004/07/30 16:06:57 agc Exp $
#
# Silently accept some GCC compiler arguments by silently converting
# them to the SunPro compiler equivalents.  This makes the SunPro
# compiler wrappers work with more software that seems to assume GCC
# nowadays.

case $arg in
-O[12345])
	# SunPro can handle -xO<n> (n={1|2|3|4|5}), so optimistically
	# convert those GCC -O<n> values to -xO<n>.
	#
	arg=`$echo "X$arg" | $Xsed -e "s|^-O|-xO|g"`
	addtoprivatecache=yes
	;;
-O?*)
	# Siliently ignore all other -O* options, except for "-O",
	# which SunPro interprets as asking for the default
	# optimization level.
	#
	arg=
	addtoprivatecache=yes
	;;
-Wl,-R*)
	# Directories for the runtime library search path are passed
	# via simply "-R<dir>", not "-Wl,-R<dir>".
	#
	arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,||g" -e "s|,| |g"`
	addtoprivatecache=yes
	;;
-Wl,*)
	# Explicitly do nothing to preserve arguments to be passed to
	# the linker.
	;;
-W*)
	# In fact, SunPro compilers don't even understand any -W*
	# arguments, so just silently ignore them all.
	#
	arg=
	addtoprivatecache=yes
	;;
-ansi)
	# No flag is required to specify ANSI C.
	arg=
	addtoprivatecache=yes
	;;
--export-dynamic)
	# Solaris' linker uses -G to create shared objects.
	arg=-G
	addtoprivatecache=yes
	;;
-f[Pp][Ii][Cc])
	# SunPro uses -Kpic to create position independent code.
	#
	arg=-Kpic
	addtoprivatecache=yes
	;;
-fno-gnu-keywords)
	arg=
	addtoprivatecache=yes
	;;
	# No flag is required to enforce strict prototypes.
-fstrict-prototypes)
	arg=
	addtoprivatecache=yes
	;;
-pedantic)
	# No flag is required for SunPro to be pedantic.
	arg=
	addtoprivatecache=yes
	;;
-pthread)
	# SunPro doesn't understand -pthread, and only -lpthread is
	# needed on Solaris.
	arg=-lpthread
	addtoprivatecache=yes
	;;
-shared)
	# Solaris' linker uses -G to create shared objects.
	#
	arg=-G
	addtoprivatecache=yes
	;;
-static)
	# Solaris' linker uses -Bstatic to create static objects.
	#
	arg=-Bstatic
	addtoprivatecache=yes
esac