pkgsrc/mk/buildlink3/sunpro-cc-post-logic
2004-01-06 08:48:29 +00:00

45 lines
1.2 KiB
Text

# $NetBSD: sunpro-cc-post-logic,v 1.3 2004/01/06 08:48:29 jlam 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
;;
-Werror)
# "-errwarn" is the right way to convince the SunPro compiler
# to stop on compilation warnings.
#
arg="-errwarn"
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
;;
-W*)
# In fact, SunPro compilers don't even understand any -W*
# arguments, so just silently ignore them all.
#
arg=
addtoprivatecache=yes
;;
esac