head 1.10; access; symbols pkgsrc-2023Q4:1.10.0.142 pkgsrc-2023Q4-base:1.10 pkgsrc-2023Q3:1.10.0.140 pkgsrc-2023Q3-base:1.10 pkgsrc-2023Q2:1.10.0.138 pkgsrc-2023Q2-base:1.10 pkgsrc-2023Q1:1.10.0.136 pkgsrc-2023Q1-base:1.10 pkgsrc-2022Q4:1.10.0.134 pkgsrc-2022Q4-base:1.10 pkgsrc-2022Q3:1.10.0.132 pkgsrc-2022Q3-base:1.10 pkgsrc-2022Q2:1.10.0.130 pkgsrc-2022Q2-base:1.10 pkgsrc-2022Q1:1.10.0.128 pkgsrc-2022Q1-base:1.10 pkgsrc-2021Q4:1.10.0.126 pkgsrc-2021Q4-base:1.10 pkgsrc-2021Q3:1.10.0.124 pkgsrc-2021Q3-base:1.10 pkgsrc-2021Q2:1.10.0.122 pkgsrc-2021Q2-base:1.10 pkgsrc-2021Q1:1.10.0.120 pkgsrc-2021Q1-base:1.10 pkgsrc-2020Q4:1.10.0.118 pkgsrc-2020Q4-base:1.10 pkgsrc-2020Q3:1.10.0.116 pkgsrc-2020Q3-base:1.10 pkgsrc-2020Q2:1.10.0.112 pkgsrc-2020Q2-base:1.10 pkgsrc-2020Q1:1.10.0.92 pkgsrc-2020Q1-base:1.10 pkgsrc-2019Q4:1.10.0.114 pkgsrc-2019Q4-base:1.10 pkgsrc-2019Q3:1.10.0.110 pkgsrc-2019Q3-base:1.10 pkgsrc-2019Q2:1.10.0.108 pkgsrc-2019Q2-base:1.10 pkgsrc-2019Q1:1.10.0.106 pkgsrc-2019Q1-base:1.10 pkgsrc-2018Q4:1.10.0.104 pkgsrc-2018Q4-base:1.10 pkgsrc-2018Q3:1.10.0.102 pkgsrc-2018Q3-base:1.10 pkgsrc-2018Q2:1.10.0.100 pkgsrc-2018Q2-base:1.10 pkgsrc-2018Q1:1.10.0.98 pkgsrc-2018Q1-base:1.10 pkgsrc-2017Q4:1.10.0.96 pkgsrc-2017Q4-base:1.10 pkgsrc-2017Q3:1.10.0.94 pkgsrc-2017Q3-base:1.10 pkgsrc-2017Q2:1.10.0.90 pkgsrc-2017Q2-base:1.10 pkgsrc-2017Q1:1.10.0.88 pkgsrc-2017Q1-base:1.10 pkgsrc-2016Q4:1.10.0.86 pkgsrc-2016Q4-base:1.10 pkgsrc-2016Q3:1.10.0.84 pkgsrc-2016Q3-base:1.10 pkgsrc-2016Q2:1.10.0.82 pkgsrc-2016Q2-base:1.10 pkgsrc-2016Q1:1.10.0.80 pkgsrc-2016Q1-base:1.10 pkgsrc-2015Q4:1.10.0.78 pkgsrc-2015Q4-base:1.10 pkgsrc-2015Q3:1.10.0.76 pkgsrc-2015Q3-base:1.10 pkgsrc-2015Q2:1.10.0.74 pkgsrc-2015Q2-base:1.10 pkgsrc-2015Q1:1.10.0.72 pkgsrc-2015Q1-base:1.10 pkgsrc-2014Q4:1.10.0.70 pkgsrc-2014Q4-base:1.10 pkgsrc-2014Q3:1.10.0.68 pkgsrc-2014Q3-base:1.10 pkgsrc-2014Q2:1.10.0.66 pkgsrc-2014Q2-base:1.10 pkgsrc-2014Q1:1.10.0.64 pkgsrc-2014Q1-base:1.10 pkgsrc-2013Q4:1.10.0.62 pkgsrc-2013Q4-base:1.10 pkgsrc-2013Q3:1.10.0.60 pkgsrc-2013Q3-base:1.10 pkgsrc-2013Q2:1.10.0.58 pkgsrc-2013Q2-base:1.10 pkgsrc-2013Q1:1.10.0.56 pkgsrc-2013Q1-base:1.10 pkgsrc-2012Q4:1.10.0.54 pkgsrc-2012Q4-base:1.10 pkgsrc-2012Q3:1.10.0.52 pkgsrc-2012Q3-base:1.10 pkgsrc-2012Q2:1.10.0.50 pkgsrc-2012Q2-base:1.10 pkgsrc-2012Q1:1.10.0.48 pkgsrc-2012Q1-base:1.10 pkgsrc-2011Q4:1.10.0.46 pkgsrc-2011Q4-base:1.10 pkgsrc-2011Q3:1.10.0.44 pkgsrc-2011Q3-base:1.10 pkgsrc-2011Q2:1.10.0.42 pkgsrc-2011Q2-base:1.10 pkgsrc-2011Q1:1.10.0.40 pkgsrc-2011Q1-base:1.10 pkgsrc-2010Q4:1.10.0.38 pkgsrc-2010Q4-base:1.10 pkgsrc-2010Q3:1.10.0.36 pkgsrc-2010Q3-base:1.10 pkgsrc-2010Q2:1.10.0.34 pkgsrc-2010Q2-base:1.10 pkgsrc-2010Q1:1.10.0.32 pkgsrc-2010Q1-base:1.10 pkgsrc-2009Q4:1.10.0.30 pkgsrc-2009Q4-base:1.10 pkgsrc-2009Q3:1.10.0.28 pkgsrc-2009Q3-base:1.10 pkgsrc-2009Q2:1.10.0.26 pkgsrc-2009Q2-base:1.10 pkgsrc-2009Q1:1.10.0.24 pkgsrc-2009Q1-base:1.10 pkgsrc-2008Q4:1.10.0.22 pkgsrc-2008Q4-base:1.10 pkgsrc-2008Q3:1.10.0.20 pkgsrc-2008Q3-base:1.10 cube-native-xorg:1.10.0.18 cube-native-xorg-base:1.10 pkgsrc-2008Q2:1.10.0.16 pkgsrc-2008Q2-base:1.10 cwrapper:1.10.0.14 pkgsrc-2008Q1:1.10.0.12 pkgsrc-2008Q1-base:1.10 pkgsrc-2007Q4:1.10.0.10 pkgsrc-2007Q4-base:1.10 pkgsrc-2007Q3:1.10.0.8 pkgsrc-2007Q3-base:1.10 pkgsrc-2007Q2:1.10.0.6 pkgsrc-2007Q2-base:1.10 pkgsrc-2007Q1:1.10.0.4 pkgsrc-2007Q1-base:1.10 jlam-pkgviews:1.10.0.2 jlam-pkgviews-base:1.10 pkgsrc-2006Q4:1.7.0.2 pkgsrc-2006Q4-base:1.7; locks; strict; comment @# @; 1.10 date 2007.02.22.14.54.32; author rillig; state Exp; branches; next 1.9; 1.9 date 2007.02.21.09.43.26; author rillig; state Exp; branches; next 1.8; 1.8 date 2007.02.19.14.50.33; author rillig; state Exp; branches; next 1.7; 1.7 date 2006.11.30.12.59.56; author rillig; state Exp; branches; next 1.6; 1.6 date 2006.11.30.12.11.48; author rillig; state Exp; branches; next 1.5; 1.5 date 2006.11.30.11.40.24; author rillig; state Exp; branches; next 1.4; 1.4 date 2006.11.26.09.55.52; author rillig; state Exp; branches; next 1.3; 1.3 date 2006.11.26.09.13.44; author rillig; state Exp; branches; next 1.2; 1.2 date 2006.11.14.13.40.20; author rillig; state Exp; branches; next 1.1; 1.1 date 2006.11.11.07.44.46; author rillig; state Exp; branches; next ; desc @@ 1.10 log @Changed the default warning message to include the word "unknown", since otherwise it doesn't sound like a warning. @ text @# $NetBSD: wrapper-subr.sh,v 1.9 2007/02/21 09:43:26 rillig Exp $ # # This file contains shell functions that are useful to the wrapper # scripts. # # usage: transform_setname "current-file" transform_setname() { wrapsubr_name="$1" } # usage: transform_to "newarg" transform_to() { arg="$1" $debug_log $wrapperlog " ($wrapsubr_name) to: $1" addtocache=yes } # usage: transform_to_and_split "newarg" transform_to_and_split() { arg="$1" $debug_log $wrapperlog " ($wrapsubr_name) to: $1 [split]" addtocache=yes split_arg=yes } # usage: transform_discard transform_discard() { $debug_log $wrapperlog " ($wrapsubr_name) discarded: $arg" arg="" addtocache=yes split_arg=yes } # usage: transform_discard_with_warning [warning] transform_discard_with_warning() { _warning=${1-"discarding option $arg"} msg_log "$wrapperlog" "WARNING: [$wrapsubr_name] $_warning" transform_discard addtocache=no } # usage: transform_pass transform_pass() { $debug_log $wrapperlog " ($wrapsubr_name) to: $arg [unchanged]" addtocache=yes } # usage: transform_pass_with_warning [warning] transform_pass_with_warning() { _warning=${1-"passing unknown option $arg"} msg_log "$wrapperlog" "WARNING: [$wrapsubr_name] $_warning" $debug_log $wrapperlog " ($wrapsubr_name) to: $arg [unchanged]" addtocache=no } # usage: transform_fail "error message" transform_fail() { msg_log "$wrapperlog" "ERROR: [$wrapsubr_name] $1" msg_log stderr "ERROR: [$wrapsubr_name] $1" exit 1 } # usage: fail "source-file" "error message" fail() { msg_log "$wrapperlog" "ERROR: [$1] $2" msg_log stderr "ERROR: [$1] $2" exit 1 } @ 1.9 log @The options -I, -L and -R must not be followed directly by another option. Instead of just merging them, the wrapper fails. Let's see which packages get broken by that and then fix them. I've also heard rumours that a plain -L is used as an alias to -nostdlib in some compilers. This would have been handled wrong up to now, since it definitely wasn't intended to be merged with the following argument. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.8 2007/02/19 14:50:33 rillig Exp $ d51 1 a51 1 _warning=${1-"passing option $arg"} @ 1.8 log @The ABI for which the code should be generated can be queried from the wrapper_abi variable. This is used in the MIPSpro wrapper to reject any package that tries to compile a file for the wrong ABI. This is not just a warning because such a package most likely has more severe problems. The gcc -Wall option seems to be similar to the MIPSpro -fullwarn option, so map them. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.7 2006/11/30 12:59:56 rillig Exp $ d63 7 @ 1.7 log @The function transform_pass_with_warning() also gets its debugging output. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.6 2006/11/30 12:11:48 rillig Exp $ d56 7 @ 1.6 log @Removed the transform_to_nocache() function, since it is unused. When discarding arguments, split_arg is set to yes, so that no empty arguments are added to the resulting command line. A more informative debugging message is also printed in that case. Added a debugging message to transform_to(), for consistency with the other functions. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.5 2006/11/30 11:40:24 rillig Exp $ d53 1 @ 1.5 log @Added transform_to_and_split(), which removes the need for the compiler-specific transformations to access the split_arg variable directly. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.4 2006/11/26 09:55:52 rillig Exp $ a26 7 # usage: transform_to_nocache "newarg" transform_to_nocache() { arg="$1" $debug_log $wrapperlog " ($wrapsubr_name) to: $1" addtocache=no } d29 4 a32 1 transform_to "" d39 1 a39 1 transform_to "" d45 1 @ 1.4 log @Renamed transform_pass_unknown to transform_pass_with_warning and added transform_discard_with_warning. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.3 2006/11/26 09:13:44 rillig Exp $ d19 8 @ 1.3 log @transform_pass_unknown writes its warning into the wrapper log file, instead of doing nothing at all. (Before, I had not known where to write these warnings, so it had been commented out.) @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.2 2006/11/14 13:40:20 rillig Exp $ d31 8 d44 4 a47 3 # usage: transform_pass_unknown transform_pass_unknown() { msg_log "$wrapperlog" "[$wrapsubr_name] warning: unknown option $arg" @ 1.2 log @Fixed indentation of the debugging messages and the missing newline at the end of the file. @ text @d1 1 a1 1 # $NetBSD: wrapper-subr.sh,v 1.1 2006/11/11 07:44:46 rillig Exp $ d38 1 a38 1 #echo "warning: $wrapsubr_name: unknown option $arg" 1>/dev/tty @ 1.1 log @Added wrapper-subr.sh, which provides shell functions that are useful to make the wrapper code less frightening. For example, instead of arg="${arg#-Wl,}" $debug_log $wrapperlog " (transform-sunpro-cc) to: $arg" addtocache=yes one can simply write transform_to "${arg-Wl,}" The functions that are currently implemented are: transform_to, transform_discard, transform_to_nocache, transform_discard, transform_pass and transform_pass_unknown. @ text @d1 1 a1 1 # $NetBSD$ d15 1 a15 1 $debug_log $wrapperlog " ($wrapsubr_name) to: $1" d22 1 a22 1 $debug_log $wrapperlog " ($wrapsubr_name) to: $1" a40 1 @