From 615f38464062a5f1dab16446a16f71710116dbd5 Mon Sep 17 00:00:00 2001 From: rillig Date: Thu, 30 Nov 2006 12:49:57 +0000 Subject: Adjusted the indentation and the order of checks to match the other files. --- mk/wrapper/transform-sunpro-cc | 202 +++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 120 deletions(-) (limited to 'mk/wrapper') diff --git a/mk/wrapper/transform-sunpro-cc b/mk/wrapper/transform-sunpro-cc index e113d9629aa..0fa706c16b4 100644 --- a/mk/wrapper/transform-sunpro-cc +++ b/mk/wrapper/transform-sunpro-cc @@ -1,4 +1,4 @@ -# $NetBSD: transform-sunpro-cc,v 1.17 2006/11/29 17:36:15 rillig Exp $ +# $NetBSD: transform-sunpro-cc,v 1.18 2006/11/30 12:49:57 rillig Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -35,125 +35,87 @@ # POSSIBILITY OF SUCH DAMAGE. transform_setname "transform-sunpro-cc" + case $arg in --E) - transform_pass ;; - --MM) - # Create dependency lines for Makefiles - transform_to "-xM1" - ;; - --O[12345]) - # SunPro can handle -xO (n={1|2|3|4|5}), so optimistically - # convert those GCC -O values to -xO. - transform_to "-xO${arg#-O}" - ;; - --O?*) - # Silently ignore all other -O* options, except for "-O", which - # SunPro interprets as asking for the default optimization level. - transform_discard - ;; - --Wl,-R*) - # Directories for the runtime library search path are passed via - # simply "-R", not "-Wl,-R". - transform_to "${arg#-Wl,}" - ;; --R*) - transform_pass - ;; - --Wl,-soname=*) - # SunPro uses -h to set the shared object name. - transform_to "-h${arg#-Wl,-soname=}" - ;; - --Wl,--export-dynamic|\ --Wl,-E) - # Solaris' linker exports all dynamic symbols by default when - # building a shared object. - transform_discard - ;; - --Wl,*) - # SunPro compiler accepts -Wl,* so just pass it on through. - addtocache=yes - ;; - --W*) - # SunPro compilers don't understand any other -W* arguments, - # so just silently ignore the rest. - transform_discard - ;; - --static) - # Solaris' linker uses -Bstatic to create static objects. - transform_to "-Bstatic" - ;; - ---export-dynamic|\ --shared) - # Solaris' linker uses -G to create shared objects. - transform_to "-G" - ;; - --f[Pp][Ii][Cc]) - # SunPro uses -Kpic to create position independent code. - transform_to "-Kpic" - ;; - --pthread) - # SunPro needs -mt -lpthread for POSIX threads. - transform_to "-mt -lpthread" - split_arg=yes - ;; - --fast) - # -fast implies -xlibmopt, which uses the optimized math - # routines in libsunmath. libsunmath is only available as part of - # SunPro, so disable the use of the optimized math library - # (at least until it can be statically linked). - transform_to "-fast -xnolibmopt" - split_arg=yes - ;; - --fd|\ --features*|\ --flags|\ --flteval*|\ --fnonstd*|\ --fns*|\ --fprecision*|\ --fround*|\ --fsimple*|\ --fsingle|\ --fstore|\ --ftrap*) - # Pass through -f flags that SunPro understands. - addtocache=yes - ;; - --f*) - # Ignore all other -f flags. - transform_discard - ;; - --ansi|\ --pedantic|\ --pipe|\ --traditional) - # Ignore some flags that are unnecessary for SunPro. - transform_discard - ;; - --[DILlU]*|\ --[cgOo]) - transform_pass - ;; --*) - transform_pass_with_warning - ;; +# Standard options. +-[cEgOos] |\ +-[DILlU]?* |\ +-O[01] ) transform_pass ;; + +# Create dependency lines for Makefiles +-MM ) transform_to "-xM1" ;; + +# SunPro can handle -xO (n={1|2|3|4|5}), so optimistically +# convert those GCC -O values to -xO. +-O[2345] ) transform_to "-xO${arg#-O}" ;; + +# Ignore all other -O* options. +-O* ) transform_discard_with_warning ;; + +# Directories for the runtime library search path are passed via +# simply "-R", not "-Wl,-R". +# XXX: Why? For me, -Wl,-R works equally well. +-Wl,-R* ) transform_to "${arg#-Wl,}" ;; +-R* ) transform_pass ;; + +# SunPro uses -h to set the shared object name. +-Wl,-soname=* ) transform_to "-h${arg#-Wl,-soname=}" ;; + +# Solaris' linker exports all dynamic symbols by default when +# building a shared object. +-Wl,--export-dynamic |\ +-Wl,-E ) transform_discard ;; + +# Let the options to the linker pass unmodified. +-Wl,* ) transform_pass ;; + +# Ignore options that are probably meant for GCC. +-W* ) transform_discard_with_warning ;; + +# Solaris' linker uses -Bstatic to create static objects. +-static ) transform_to "-Bstatic" ;; + +# Solaris' linker uses -G to create shared objects. +--export-dynamic |\ +-shared ) transform_to "-G" ;; + +-fPIC |\ +-fpic ) transform_to "-Kpic" ;; + +# SunPro needs -mt -lpthread for POSIX threads. +-pthread ) transform_to_and_split "-mt -lpthread" ;; + +# -fast implies -xlibmopt, which uses the optimized math +# routines in libsunmath. libsunmath is only available as part of +# SunPro, so disable the use of the optimized math library +# (at least until it can be statically linked). +-fast ) transform_to_and_split "-fast -xnolibmopt" ;; + +# Pass through those -f flags that SunPro understands. +-fd |\ +-features* |\ +-flags |\ +-flteval* |\ +-fnonstd* |\ +-fns* |\ +-fprecision* |\ +-fround* |\ +-fsimple* |\ +-fsingle |\ +-fstore |\ +-ftrap* ) transform_pass ;; + +# Ignore all other -f flags. +-f* ) transform_discard_with_warning ;; + +# Ignore some flags that are unnecessary for SunPro. +-ansi |\ +-pedantic |\ +-pipe |\ +-traditional ) transform_discard ;; + +# Unknown options. +-* ) transform_pass_with_warning ;; + esac -- cgit v1.2.3