head 1.13; access; symbols pkgsrc-2023Q4:1.13.0.20 pkgsrc-2023Q4-base:1.13 pkgsrc-2023Q3:1.13.0.18 pkgsrc-2023Q3-base:1.13 pkgsrc-2023Q2:1.13.0.16 pkgsrc-2023Q2-base:1.13 pkgsrc-2023Q1:1.13.0.14 pkgsrc-2023Q1-base:1.13 pkgsrc-2022Q4:1.13.0.12 pkgsrc-2022Q4-base:1.13 pkgsrc-2022Q3:1.13.0.10 pkgsrc-2022Q3-base:1.13 pkgsrc-2022Q2:1.13.0.8 pkgsrc-2022Q2-base:1.13 pkgsrc-2022Q1:1.13.0.6 pkgsrc-2022Q1-base:1.13 pkgsrc-2021Q4:1.13.0.4 pkgsrc-2021Q4-base:1.13 pkgsrc-2021Q3:1.13.0.2 pkgsrc-2021Q3-base:1.13 pkgsrc-2021Q2:1.12.0.24 pkgsrc-2021Q2-base:1.12 pkgsrc-2021Q1:1.12.0.22 pkgsrc-2021Q1-base:1.12 pkgsrc-2020Q4:1.12.0.20 pkgsrc-2020Q4-base:1.12 pkgsrc-2020Q3:1.12.0.18 pkgsrc-2020Q3-base:1.12 pkgsrc-2020Q2:1.12.0.16 pkgsrc-2020Q2-base:1.12 pkgsrc-2020Q1:1.12.0.12 pkgsrc-2020Q1-base:1.12 pkgsrc-2019Q4:1.12.0.14 pkgsrc-2019Q4-base:1.12 pkgsrc-2019Q3:1.12.0.10 pkgsrc-2019Q3-base:1.12 pkgsrc-2019Q2:1.12.0.8 pkgsrc-2019Q2-base:1.12 pkgsrc-2019Q1:1.12.0.6 pkgsrc-2019Q1-base:1.12 pkgsrc-2018Q4:1.12.0.4 pkgsrc-2018Q4-base:1.12 pkgsrc-2018Q3:1.12.0.2 pkgsrc-2018Q3-base:1.12 pkgsrc-2018Q2:1.11.0.22 pkgsrc-2018Q2-base:1.11 pkgsrc-2018Q1:1.11.0.20 pkgsrc-2018Q1-base:1.11 pkgsrc-2017Q4:1.11.0.18 pkgsrc-2017Q4-base:1.11 pkgsrc-2017Q3:1.11.0.16 pkgsrc-2017Q3-base:1.11 pkgsrc-2017Q2:1.11.0.12 pkgsrc-2017Q2-base:1.11 pkgsrc-2017Q1:1.11.0.10 pkgsrc-2017Q1-base:1.11 pkgsrc-2016Q4:1.11.0.8 pkgsrc-2016Q4-base:1.11 pkgsrc-2016Q3:1.11.0.6 pkgsrc-2016Q3-base:1.11 pkgsrc-2016Q2:1.11.0.4 pkgsrc-2016Q2-base:1.11 pkgsrc-2016Q1:1.11.0.2 pkgsrc-2016Q1-base:1.11 pkgsrc-2015Q4:1.10.0.8 pkgsrc-2015Q4-base:1.10 pkgsrc-2015Q3:1.10.0.6 pkgsrc-2015Q3-base:1.10 pkgsrc-2015Q2:1.10.0.4 pkgsrc-2015Q2-base:1.10 pkgsrc-2015Q1:1.10.0.2 pkgsrc-2015Q1-base:1.10 pkgsrc-2014Q4:1.9.0.4 pkgsrc-2014Q4-base:1.9 pkgsrc-2014Q3:1.9.0.2 pkgsrc-2014Q3-base:1.9 pkgsrc-2014Q2:1.8.0.66 pkgsrc-2014Q2-base:1.8 pkgsrc-2014Q1:1.8.0.64 pkgsrc-2014Q1-base:1.8 pkgsrc-2013Q4:1.8.0.62 pkgsrc-2013Q4-base:1.8 pkgsrc-2013Q3:1.8.0.60 pkgsrc-2013Q3-base:1.8 pkgsrc-2013Q2:1.8.0.58 pkgsrc-2013Q2-base:1.8 pkgsrc-2013Q1:1.8.0.56 pkgsrc-2013Q1-base:1.8 pkgsrc-2012Q4:1.8.0.54 pkgsrc-2012Q4-base:1.8 pkgsrc-2012Q3:1.8.0.52 pkgsrc-2012Q3-base:1.8 pkgsrc-2012Q2:1.8.0.50 pkgsrc-2012Q2-base:1.8 pkgsrc-2012Q1:1.8.0.48 pkgsrc-2012Q1-base:1.8 pkgsrc-2011Q4:1.8.0.46 pkgsrc-2011Q4-base:1.8 pkgsrc-2011Q3:1.8.0.44 pkgsrc-2011Q3-base:1.8 pkgsrc-2011Q2:1.8.0.42 pkgsrc-2011Q2-base:1.8 pkgsrc-2011Q1:1.8.0.40 pkgsrc-2011Q1-base:1.8 pkgsrc-2010Q4:1.8.0.38 pkgsrc-2010Q4-base:1.8 pkgsrc-2010Q3:1.8.0.36 pkgsrc-2010Q3-base:1.8 pkgsrc-2010Q2:1.8.0.34 pkgsrc-2010Q2-base:1.8 pkgsrc-2010Q1:1.8.0.32 pkgsrc-2010Q1-base:1.8 pkgsrc-2009Q4:1.8.0.30 pkgsrc-2009Q4-base:1.8 pkgsrc-2009Q3:1.8.0.28 pkgsrc-2009Q3-base:1.8 pkgsrc-2009Q2:1.8.0.26 pkgsrc-2009Q2-base:1.8 pkgsrc-2009Q1:1.8.0.24 pkgsrc-2009Q1-base:1.8 pkgsrc-2008Q4:1.8.0.22 pkgsrc-2008Q4-base:1.8 pkgsrc-2008Q3:1.8.0.20 pkgsrc-2008Q3-base:1.8 cube-native-xorg:1.8.0.18 cube-native-xorg-base:1.8 pkgsrc-2008Q2:1.8.0.16 pkgsrc-2008Q2-base:1.8 cwrapper:1.8.0.14 pkgsrc-2008Q1:1.8.0.12 pkgsrc-2008Q1-base:1.8 pkgsrc-2007Q4:1.8.0.10 pkgsrc-2007Q4-base:1.8 pkgsrc-2007Q3:1.8.0.8 pkgsrc-2007Q3-base:1.8 pkgsrc-2007Q2:1.8.0.6 pkgsrc-2007Q2-base:1.8 pkgsrc-2007Q1:1.8.0.4 pkgsrc-2007Q1-base:1.8 jlam-pkgviews:1.8.0.2 jlam-pkgviews-base:1.8 pkgsrc-2006Q4:1.7.0.20 pkgsrc-2006Q4-base:1.7 pkgsrc-2006Q3:1.7.0.18 pkgsrc-2006Q3-base:1.7 pkgsrc-2006Q2:1.7.0.16 pkgsrc-2006Q2-base:1.7 tv-derecurse-eol:1.7 pkgsrc-2006Q1:1.7.0.14 pkgsrc-2006Q1-base:1.7 pkgsrc-2005Q4:1.7.0.12 pkgsrc-2005Q4-base:1.7 pkgsrc-2005Q3:1.7.0.10 pkgsrc-2005Q3-base:1.7 pkgsrc-2005Q2:1.7.0.8 pkgsrc-2005Q2-base:1.7 tv-derecurse-merge:1.7 pkgsrc-2005Q1:1.7.0.6 pkgsrc-2005Q1-base:1.7 pkgsrc-2004Q4:1.7.0.4 pkgsrc-2004Q4-base:1.7 tv-derecurse:1.7.0.2 tv-derecurse-base:1.7; locks; strict; comment @# @; 1.13 date 2021.06.25.22.02.06; author maya; state Exp; branches; next 1.12; commitid mfhELnyRTLkNTyYC; 1.12 date 2018.08.22.20.48.37; author maya; state Exp; branches 1.12.24.1; next 1.11; commitid FMEpDDTKwDQBR9PA; 1.11 date 2016.03.14.20.11.56; author markd; state Exp; branches; next 1.10; commitid mEK37vBNxP4hjEYy; 1.10 date 2014.12.30.15.13.20; author wiz; state Exp; branches; next 1.9; commitid RRdsYBWaMIUIN44y; 1.9 date 2014.09.02.14.23.00; author jperkin; state Exp; branches; next 1.8; commitid bFtl7JhQHZWykMOx; 1.8 date 2007.03.07.12.40.54; author rillig; state Exp; branches; next 1.7; 1.7 date 2004.11.09.17.16.16; author jlam; state Exp; branches 1.7.2.1; next 1.6; 1.6 date 2004.11.08.22.29.19; author jlam; state Exp; branches; next 1.5; 1.5 date 2004.11.08.22.26.31; author jlam; state Exp; branches; next 1.4; 1.4 date 2004.11.08.22.24.22; author jlam; state Exp; branches; next 1.3; 1.3 date 2004.09.26.05.50.39; author jlam; state Exp; branches; next 1.2; 1.2 date 2004.09.22.23.00.26; author jlam; state Exp; branches; next 1.1; 1.1 date 2004.09.21.15.01.41; author jlam; state Exp; branches; next ; 1.12.24.1 date 2021.07.08.08.04.56; author bsiegert; state Exp; branches; next ; commitid KhT97O1k2UrXR90D; 1.7.2.1 date 2006.06.07.15.25.40; author tv; state dead; branches; next ; desc @@ 1.13 log @switch $echo statements to printf "%s\n". dash considers \1 to be octal escape. for PR pkg/56248, from Michael Forney's suggestion. $echo seems to be used for performance here (was previously cat) and not for compatibility with some esoteric system. I misunderstood things, and failed to test the last bootstrap diff, breaking bootstrap on Ubuntu for a while. @ text @#! @@WRAPPER_SHELL@@ # # $NetBSD: gen-transform.sh,v 1.12 2018/08/22 20:48:37 maya Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. # # This code is derived from software contributed to The NetBSD Foundation # by Johnny C. Lam. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. shell_lib="@@_WRAP_SHELL_LIB@@" wrapperlog="${WRAPPER_LOG-@@_WRAP_LOG@@}" debug="${WRAPPER_DEBUG-no}" test="@@TEST@@" . $shell_lib case $debug in yes) debug_log="msg_log" ;; *) debug_log=":" ;; esac rpath_options="-Wl,--rpath, -Wl,-rpath-link, -Wl,-rpath, -Wl,-R -R" ###################################################################### # gen action arg # Outputs sed commands that correspond to $action for $arg. The # "transform" action pertains to transforming command-line options, # while the "untransform" action pertains to unwrapping *-config # files, *.pc files, and *.lai (to-be-installed libtool archive) # files. ###################################################################### gen() { _sep=" \`\"':;," _action=$1; shift save_IFS="${IFS}"; IFS=":" set -- $1 IFS="${save_IFS}" _cmd="$1"; shift case $_cmd in ############################################################### # I:src:dst # Change "src" into "dst" and "src/*" into "dst/*" in -I # options for transform, and back for untransform. ############################################################### I) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-I$1:-I$2" gen $_action "opt:-isystem,$1:-isystem,$2" gen $_action "opt-sub:-I$1:-I$2" gen $_action "opt-sub:-isystem,$1:-isystem,$2" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-I$2:-I$1" gen $_action "opt:-isystem,$2:-isystem,$1" gen $_action "opt-sub:-I$2:-I$1" gen $_action "opt-sub:-isystem,$2:-isystem,$1" ;; esac ;; ############################################################### # L:src:dst # Change "src" into "dst" and "src/*" into "dst/*" in -L # options for transform, and back for untransform. ############################################################### L) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-L$1:-L$2" gen $_action "opt-sub:-L$1:-L$2" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-L$2:-L$1" gen $_action "opt-sub:-L$2:-L$1" ;; esac ;; ############################################################### # l:foo:bar[:baz1...] # Change "-lfoo" into "-lbar [-lbaz...]" ############################################################### l) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" tolibs= fromlib="-l$1"; shift while $test $# -gt 0; do case $1 in "") ;; *) case $tolibs in "") tolibs="-l$1" ;; *) tolibs="$tolibs -l$1" ;; esac ;; esac shift done gen $_action "opt:$fromlib:$tolibs" ;; ############################################################## # libpath:src:dst # Change "src/*/libfoo.{a,la}" into "dst/*/libfoo.{a,la}". ############################################################## libpath) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la\)$|\1$2\2|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" ;; esac ;; ############################################################## # mangle:src:dst # Change "src" into "dst" and "src/*" into "dst/*" in -I, # -L, and rpath options, and also in full paths to # libraries. ############################################################## mangle) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" #gen $_action "opt:$1:$2" gen $_action "opt:-I$1:-I$2" gen $_action "opt:-isystem,$1:-isystem,$2" gen $_action "opt:-L$1:-L$2" gen $_action "rpath-exact:$1:$2" gen $_action "sub-mangle:$1:$2" ;; ############################################################## # no-abspath # Remove all "dash" options that contain an absolute path. ############################################################## no-abspath) $debug_log $wrapperlog " (gen-transform) $_cmd" gen $_action "rm-optarg:-I/" gen $_action "rm-optarg:-isystem,/" gen $_action "rm-optarg:-L/" for _R in $rpath_options; do gen $_action "rm-optarg:$_R/" done ;; ############################################################## # no-rpath # Removes rpath options. ############################################################## no-rpath) $debug_log $wrapperlog " (gen-transform) $_cmd" gen $_action rm-optarg:-Wl,--rpath, gen $_action rm-optarg:-Wl,-rpath-link, gen $_action rm-optarg:-Wl,-rpath, gen $_action rm-optarg:-Wl,-R gen $_action rm-optarg:-R ;; ############################################################## # opt:src:dst # Change "src" into "dst", where "src" matches the whole # option or a leading part up to a separator character. ############################################################## opt) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|^$1\([$_sep]\)|$2\1|g" printf "%s\n" "s|^$1$|$2|g" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1$|\1$2|g" printf "%s\n" "s|^$1\([$_sep]\)|$2\1|g" printf "%s\n" "s|^$1$|$2|g" ;; esac ;; ############################################################## # opt-sub:src:dst # Change "src/*" into "dst/*". ############################################################## opt-sub) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt-sub-trailer:$1::$2:" ;; ############################################################## # opt-sub-trailer:src:src_trailer:dst:dst_trailer # Change "src/*src_trailer" into "dst/*dst_trailer", # where "src/*" matches "src" plus subdirectories. ############################################################## opt-sub-trailer) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2$|\1$3\2$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" ;; esac ;; ############################################################## # P:src:dst # Change "src/*/libfoo.{a,la}" into "dst/*/libfoo.{a,la}" # for transform, and back for untransform. ############################################################## P) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "libpath:$1:$2" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "libpath:$2:$1" ;; esac ;; ############################################################## # rename:src:dst # Synonym for "opt:src:dst". ############################################################## rename) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:$1:$2" ;; ############################################################## # rm:opt # Remove "opt", where "opt" matches the entire option. ############################################################## rm) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:$1:" ;; ############################################################## # rm-optarg:opt # Remove "opt" and any argument of that option where the # two are combined in one word. ############################################################## rm-optarg) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|^$1[^$_sep]*\([$_sep]\)|\1|g" printf "%s\n" "s|^$1[^$_sep]*$||g" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*$|\1|g" printf "%s\n" "s|^$1[^$_sep]*\([$_sep]\)|\1|g" printf "%s\n" "s|^$1[^$_sep]*$||g" ;; esac ;; ############################################################## # rmdir:dir # Remove all "dash" options that contain "dir" or "dir/*". ############################################################## rmdir) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-I$1:" gen $_action "opt:-isystem,$1:" gen $_action "rm-optarg:-I$1/" gen $_action "rm-optarg:-isystem,$1/" gen $_action "opt:-L$1:" gen $_action "rm-optarg:-L$1/" for _R in $rpath_options; do gen $_action "opt:$_R$1:" gen $_action "rm-optarg:$_R$1/" done ;; ############################################################## # rpath:src:dst # Change "src" into "dst" and "src/*" into "dst/*" in rpath # options. ############################################################## rpath) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "rpath-exact:$1:$2" gen $_action "sub-rpath:$1:$2" ;; ############################################################## # rpath-exact:src:dst # Change "src" into "dst" in rpath options. ############################################################## rpath-exact) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" for _R in $rpath_options; do gen $_action "opt:$_R$1:$_R$2" done ;; ############################################################## # strip-slashdot:dir # Change "dir/." into "dir" and the same in -I, -L, and # rpath options. ############################################################## strip-slashdot) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt-sub-trailer:$1:/\.:$1:" gen $_action "opt-sub-trailer:-I$1:/\.:-I$1:" gen $_action "opt-sub-trailer:-isystem,$1:/\.:-isystem,$1:" gen $_action "opt-sub-trailer:-L$1:/\.:-L$1:" for _R in $rpath_options; do gen $_action "opt-sub-trailer:$_R$1:/\.:$_R$1:" done ;; ############################################################## # sub-mangle:src:dst # Change "src/*" into "dst/*" in -I, -L, and rpath # options, and also in full paths to libraries. ############################################################## sub-mangle) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" #gen $_action "opt-sub:$1:$2" gen $_action "libpath:$1:$2" gen $_action "opt-sub:-I$1:-I$2" gen $_action "opt-sub:-isystem,$1:-isystem,$2" gen $_action "opt-sub:-L$1:-L$2" gen $_action "sub-rpath:$1:$2" ;; ############################################################## # sub-rpath:src:dst # Change "src/*" into "dst/*" in rpath options. ############################################################## sub-rpath) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" for _R in $rpath_options; do gen $_action "opt-sub:$_R$1:$_R$2" done ;; ############################################################## # Everything else is ignored. ############################################################## *) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@ [unknown]" ;; esac } ###################################################################### # Generate sed script. ###################################################################### action="$1"; shift for arg do case $arg in transform:*) case $action in transform) gen $action "${arg#transform:}" ;; esac ;; untransform:*) case $action in untransform) gen $action "${arg#untransform:}" ;; esac ;; *) gen $action "$arg" ;; esac done @ 1.12 log @Remove clauses 3,4 from TNF-only copyright blocks. This is based on the decision The NetBSD Foundation made in 2008 to do so, which was already applied to src. This change has been applied to code which is likely not in other repositories. ok board@@, reviewed by riastradh@@ @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.11 2016/03/14 20:11:56 markd Exp $ a35 1 echo="@@ECHO@@" d137 2 a138 2 $echo "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" $echo "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" d142 5 a146 5 $echo "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1\(/[^$_sep]*\.la\)$|\1$2\2|g" $echo "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" $echo "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" d199 2 a200 2 $echo "s|^$1\([$_sep]\)|$2\1|g" $echo "s|^$1$|$2|g" d204 5 a208 5 $echo "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1$|\1$2|g" $echo "s|^$1\([$_sep]\)|$2\1|g" $echo "s|^$1$|$2|g" d229 2 a230 2 $echo "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" $echo "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" d234 5 a238 5 $echo "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" $echo "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" $echo "s|\([$_sep]\)$1\(/[^$_sep]*\)$2$|\1$3\2$4|g" $echo "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" $echo "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" d284 2 a285 2 $echo "s|^$1[^$_sep]*\([$_sep]\)|\1|g" $echo "s|^$1[^$_sep]*$||g" d289 5 a293 5 $echo "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" $echo "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" $echo "s|\([$_sep]\)$1[^$_sep]*$|\1|g" $echo "s|^$1[^$_sep]*\([$_sep]\)|\1|g" $echo "s|^$1[^$_sep]*$||g" @ 1.12.24.1 log @Pullup ticket #6482 - requested by maya mk: Linux bootstrap fix Revisions pulled up: - mk/wrapper/gen-transform.sh 1.13 --- Module Name: pkgsrc Committed By: maya Date: Fri Jun 25 22:02:06 UTC 2021 Modified Files: pkgsrc/mk/wrapper: gen-transform.sh Log Message: switch $echo statements to printf "%s\n". dash considers \1 to be octal escape. for PR pkg/56248, from Michael Forney's suggestion. $echo seems to be used for performance here (was previously cat) and not for compatibility with some esoteric system. I misunderstood things, and failed to test the last bootstrap diff, breaking bootstrap on Ubuntu for a while. @ text @d3 1 a3 1 # $NetBSD$ d36 1 d138 2 a139 2 printf "%s\n" "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" d143 5 a147 5 printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\.la\)$|\1$2\2|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g" printf "%s\n" "s|^$1\(/[^$_sep]*\.la\)$|$2\1|g" d200 2 a201 2 printf "%s\n" "s|^$1\([$_sep]\)|$2\1|g" printf "%s\n" "s|^$1$|$2|g" d205 5 a209 5 printf "%s\n" "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g" printf "%s\n" "s|\([$_sep]\)$1$|\1$2|g" printf "%s\n" "s|^$1\([$_sep]\)|$2\1|g" printf "%s\n" "s|^$1$|$2|g" d230 2 a231 2 printf "%s\n" "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" d235 5 a239 5 printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g" printf "%s\n" "s|\([$_sep]\)$1\(/[^$_sep]*\)$2$|\1$3\2$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g" printf "%s\n" "s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g" d285 2 a286 2 printf "%s\n" "s|^$1[^$_sep]*\([$_sep]\)|\1|g" printf "%s\n" "s|^$1[^$_sep]*$||g" d290 5 a294 5 printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g" printf "%s\n" "s|\([$_sep]\)$1[^$_sep]*$|\1|g" printf "%s\n" "s|^$1[^$_sep]*\([$_sep]\)|\1|g" printf "%s\n" "s|^$1[^$_sep]*$||g" @ 1.11 log @Add support for -isystem to legacy wrappers. rewrite "-isystem dir" as "-isystem,dir" transform "-isystem,dir" in same ways as "-Idir" rewrite "-isystem,dir" back to "-isystem dir" in cmd-sink @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.10 2014/12/30 15:13:20 wiz Exp $ a18 7 # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the NetBSD # Foundation, Inc. and its contributors. # 4. Neither the name of The NetBSD Foundation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. @ 1.10 log @Remove pkg_views support, second part: infrastructure. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.9 2014/09/02 14:23:00 jperkin Exp $ d84 1 d86 1 d91 1 d93 1 d168 1 d180 1 d312 1 d314 1 d351 1 d367 1 @ 1.9 log @Replace calls to cat(1) with echo(1) which is highly likely to be a shell builtin. This significantly reduces the number of exec's required during the 'wrapper' phase and brings the execution time down accordingly. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.8 2007/03/07 12:40:54 rillig Exp $ a74 10 # depot:src:dst # Change "src//*" into "dst/*", and the same in -I and # -L options. ############################################################### depot) gen $_action "opt-depot:$1:$2" gen $_action "opt-depot:-I$1:-I$2" gen $_action "opt-depot:-L$1:-L$2" ;; ############################################################### a213 21 ############################################################### # opt-depot:src:dst # Change "src//*" into "dst/*". ############################################################### opt-depot) case $_action in transform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" $echo "s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g" $echo "s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g" ;; untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" $echo "s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g" $echo "s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*\)$|\1$2\2|g" $echo "s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g" $echo "s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g" ;; esac ;; @ 1.8 log @Fixed the documentation of the opt:*:* transformation. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.7 2004/11/09 17:16:16 jlam Exp $ d43 1 a43 1 cat="@@CAT@@" d151 2 a152 4 $cat << EOF s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g s|^$1\(/[^$_sep]*\.la\)$|$2\1|g EOF d156 5 a160 7 $cat << EOF s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g s|\([$_sep]\)$1\(/[^$_sep]*\.la\)$|\1$2\2|g s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g s|^$1\(/[^$_sep]*\.la\)$|$2\1|g EOF d211 2 a212 4 $cat << EOF s|^$1\([$_sep]\)|$2\1|g s|^$1$|$2|g EOF d216 5 a220 7 $cat << EOF s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g s|\([$_sep]\)$1$|\1$2|g s|^$1\([$_sep]\)|$2\1|g s|^$1$|$2|g EOF d232 2 a233 4 $cat << EOF s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g EOF d237 5 a241 7 $cat << EOF s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*\)$|\1$2\2|g s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g EOF d262 2 a263 4 $cat << EOF s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g EOF d267 5 a271 7 $cat << EOF s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g s|\([$_sep]\)$1\(/[^$_sep]*\)$2$|\1$3\2$4|g s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g EOF d317 2 a318 4 $cat << EOF s|^$1[^$_sep]*\([$_sep]\)|\1|g s|^$1[^$_sep]*$||g EOF d322 5 a326 7 $cat << EOF s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g s|\([$_sep]\)$1[^$_sep]*$|\1|g s|^$1[^$_sep]*\([$_sep]\)|\1|g s|^$1[^$_sep]*$||g EOF @ 1.7 log @The "transform" file is used to transform arguments on the command line. The "untransform" file is used to unwrap *-config files and *.lai files. The transform file can be much stricter about what command line arguments should look like, so take advantage of that to fix the "libpath" and "libpath-in-define" regression tests. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.6 2004/11/08 22:29:19 jlam Exp $ d209 1 a209 1 # option. @ 1.7.2.1 log @EOL the tv-derecurse branch; it has become too outdated. The last live revision can be fetched at the tv-derecurse-eol tag. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.7 2004/11/09 17:16:16 jlam Exp $ @ 1.6 log @g/c unused variable _ws_sep. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.5 2004/11/08 22:26:31 jlam Exp $ d57 5 a61 1 # Outputs sed commands that correspond to $action for $arg. d149 8 a156 1 transform|untransform) d213 8 a220 1 transform|untransform) d238 8 a245 1 transform|untransform) d272 8 a279 1 transform|untransform) d331 8 a338 1 transform|untransform) @ 1.5 log @Whitespace fixes. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.4 2004/11/08 22:24:22 jlam Exp $ a61 1 _ws_sep=" " @ 1.4 log @Remove unnecessary argument checks. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.3 2004/09/26 05:50:39 jlam Exp $ d77 3 a79 3 gen $_action "opt-depot:$1:$2" gen $_action "opt-depot:-I$1:-I$2" gen $_action "opt-depot:-L$1:-L$2" d124 9 a132 11 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" tolibs= fromlib="-l$1"; shift while $test $# -gt 0; do case $1 in "") ;; *) case $tolibs in "") tolibs="-l$1" ;; *) tolibs="$tolibs -l$1" ;; esac ;; d134 5 a138 3 shift done gen $_action "opt:$fromlib:$tolibs" d165 6 a170 6 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" #gen $_action "opt:$1:$2" gen $_action "opt:-I$1:-I$2" gen $_action "opt:-L$1:-L$2" gen $_action "rpath-exact:$1:$2" gen $_action "sub-mangle:$1:$2" d177 6 a182 6 $debug_log $wrapperlog " (gen-transform) $_cmd" gen $_action "rm-optarg:-I/" gen $_action "rm-optarg:-L/" for _R in $rpath_options; do gen $_action "rm-optarg:$_R/" done d189 6 a194 6 $debug_log $wrapperlog " (gen-transform) $_cmd" gen $_action rm-optarg:-Wl,--rpath, gen $_action rm-optarg:-Wl,-rpath-link, gen $_action rm-optarg:-Wl,-rpath, gen $_action rm-optarg:-Wl,-R gen $_action rm-optarg:-R d238 2 a239 2 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt-sub-trailer:$1::$2:" d282 2 a283 2 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:$1:$2" d290 2 a291 2 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:$1:" d317 9 a325 9 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt:-I$1:" gen $_action "rm-optarg:-I$1/" gen $_action "opt:-L$1:" gen $_action "rm-optarg:-L$1/" for _R in $rpath_options; do gen $_action "opt:$_R$1:" gen $_action "rm-optarg:$_R$1/" done d333 3 a335 3 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "rpath-exact:$1:$2" gen $_action "sub-rpath:$1:$2" d342 4 a345 4 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" for _R in $rpath_options; do gen $_action "opt:$_R$1:$_R$2" done d353 7 a359 7 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" gen $_action "opt-sub-trailer:$1:/\.:$1:" gen $_action "opt-sub-trailer:-I$1:/\.:-I$1:" gen $_action "opt-sub-trailer:-L$1:/\.:-L$1:" for _R in $rpath_options; do gen $_action "opt-sub-trailer:$_R$1:/\.:$_R$1:" done d367 6 a372 6 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" #gen $_action "opt-sub:$1:$2" gen $_action "libpath:$1:$2" gen $_action "opt-sub:-I$1:-I$2" gen $_action "opt-sub:-L$1:-L$2" gen $_action "sub-rpath:$1:$2" d379 4 a382 4 $debug_log $wrapperlog " (gen-transform) $_cmd: $@@" for _R in $rpath_options; do gen $_action "opt-sub:$_R$1:$_R$2" done @ 1.3 log @Fix rmdir command so it passes remove-dir in the buildlink-transform regression test. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.2 2004/09/22 23:00:26 jlam Exp $ a76 2 case $_action in transform|untransform) a79 2 ;; esac a123 2 case $_action in transform|untransform) a138 2 ;; esac a164 2 case $_action in transform|untransform) a170 2 ;; esac a176 2 case $_action in transform|untransform) a182 2 ;; esac a188 2 case "$_action" in transform|untransform) a194 2 ;; esac a237 2 case $_action in transform|untransform) a239 2 ;; esac a281 2 case $_action in transform|untransform) a283 2 ;; esac a289 2 case $_action in transform|untransform) a291 1 esac a316 2 case $_action in transform|untransform) a325 2 ;; esac a332 2 case $_action in transform|untransform) a335 2 ;; esac a341 2 case $_action in transform|untransform) a345 2 ;; esac a352 2 case $_action in transform|untransform) a359 2 ;; esac a366 2 case $_action in transform|untransform) a372 2 ;; esac a378 2 case $_action in transform|untransform) a382 2 ;; esac @ 1.2 log @When mangling paths, also do (and undo) the transformations for full paths to static archives and libtool archives. This should fix the problem where a mangled path sometimes makes its way into the the executed command line. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.1 2004/09/21 15:01:41 jlam Exp $ d352 1 a352 1 gen $_action "opt-sub:-I$1:" d354 1 a354 1 gen $_action "opt-sub:-L$1:" d357 1 a357 1 gen $_action "opt-sub:$_R$1:" @ 1.1 log @Initial commit of a new wrapper script framework that encapsulates the non-buildlink-related code and moves it out of mk/buildlink3 into mk/wrapper. The buildlink3 code is modified to simply hook its transformations into the wrapper script framework. The wrapper script framework has some new features: * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by ). * Much improved debugging output. It's possible to output the wrapper work log in-line with normal output by setting WRAPPER_LOG to "stderr". Important differences in behaviour from the old buildlink3 code include: * Only move the -l options to the end of the command line, leaving the -L options in-place. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la The old --fix-la syntax no longer works. 20040818 ======== * Initial release of a new wrapper script framework that encapsulates the non-buildlink-related code and moves it out of mk/buildlink3. These features include: * making MIPSpro accept GCC options * making MIPSpro "ucode" accept GCC options * making SunPro accept GCC options * making "ld" accept -Wl,* options and silently removing the "-Wl," * (NEW) making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH One major benefit of this is that the buildlink3 code is now much tighter and easier to understand since it concerns itself solely with buildlink-related details. I haven't yet optimized the wrapper cache, so the new wrapper scripts may take slightly longer to execute than the old buildlink3 wrapper scripts, but I'll be improving this over time. 20040821 ======== * Move the inclusion of $cmd_sink outside of the main loop in wrapper.sh so that the $cmd_sink script can be used to globally scan and process the arguments. Move the LD_RUN_PATH code to a cmd-sink-unixware-gcc script. Garbage-collect the now unused export_vars-related code. * Add cmd-sink-aix-xlc for AIX xlc that munges -Wl,-R* into an appropriate -blibpath option. * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by ). * Move the code that converts full paths to shared libraries into the "-Ldir -llib" equivalents from the buildlink3 code into wrapper/logic. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Move the code that checks for absolute rpaths from the buildlink3 code into wrapper/arg-source. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Only move the -l options to the end of the command line, leaving the -L options in-place. * Add more debugging code. 20040824 ======== * Fix quoting problems after arguments are transformed. Remove the hack that was inserted that magically made almost everything work because we do it the right way now. * Move the inclusion of $logic outside of the main loop in wrapper.sh so that the $logic script doesn't have to worry about underflowing the argument buffer. * Encapsulate the loop in wrapper.sh that fills the argument buffer entirely within the arg-source script. * Move from the logic script into the arg-source script the transformations that merge or split arguments. * Fix bug where skipargs was effectively being ignored if it was more than 1. * Handle the whitespace in transformations in the logic script that turn one library option into multiple library options, e.g. "-lreadline" -> "-ledit -ltermcap". * Allow you to specify an environment variable WRAPPER_SKIP_TRANSFORM for whether you wish to skip the transformation step in the logic script. This is intended for testing purposes. * Added check_prog() and init_lib() functions to the shell code library to make it more reusable outside of the wrapper framework. * Allow the msg_log() function to output to "stdout" or "stderr". If you want to have all of the logging appear on the screen, then you can now set WRAPPER_LOG=stderr. * Make some of the script components not overridable on a per-wrapper basis. * Add a gen-transform.sh script that generates transformation sedfiles. The "transform" script is used to transform arguments, while the "untransform" script is used to unwrap files. Move the no-rpath logic from buildlink3/gen-transform.sh into wrapper/gen-transform.sh since it's not buildlink3-specific. * Check for a non-empty blibpath before adding the option in cmd-sink-aix-xlc. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Add a cmd-sink-libtool script that doesn't pass linker options to libtool unless we're in "link" mode. * Set _USE_RPATH to "yes" for UnixWare so that the wrappers will see the rpath options and convert them to a LD_RUN_PATH definition. * Add more debugging code. 20040826 ======== * Rewrite buildlink3/gen-transform.sh to produce more precise sed commands. Drop some unused commands from the mini-language, and add a few more that are more restrictive in their scope. * Fix problem where repeated options weren't properly handled by some of sed commands. It's not enough that they're "global replace", since some patterns match separator characters before and after each option. We must repeat those patterns twice to catch all instances correctly. * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * Add more debugging code. 20040828 ======== * Added a head_queue function to shell-lib that returns the head of the named queue without popping it off the front of the queue. * Strip consecutive, repeated library options from the command line when we read it in the logic script. * Be more careful about not underflowing the argument buffer. 20040906 ======== * shell-lib was moved into pkgsrc/mk/scripts; correct references to that file in the wrapper code. * Use opt-sub instead of sub-mangle when protecting -I/usr/include/* and -L/usr/lib/* from buildlink transformations. This avoids adding lines that look like "-I-I..." in the transformation sedfiles. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Fix bug in strip-slashdot where the "." wasn't backquoted and thus matched all characters instead of only the "." character. * Change the libtool wrapper to use a modified buildcmd script that doesn't rearrange any of the arguments. This should fix spurious problems where libtool doesn't understand how to parse the command line when the -l options are moved to the end of the argument list. * Fix bug in the logic script where the $cachearg and $cachedarg weren't being properly set at all times, which caused the cache to contain the wrong transformed argument. 20040907 ======== * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * Move back the code that splits absolute paths to shared libraries from arg-source back into logic. This allows us to correctly skip splitting those paths based on the previous option. Also add a sanity check that the library name in the split argument doesn't contain a "/" since shell globs are not as precise as REs. * Don't transform the path given after --dynamic-linker (used by GNU ld for ELF linkage). * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la 20040914 ======== * Add a loop in libtool-fix-la to ensure that all of the options listed in the dependency_libs lines of *.lai files are processed. This fixes a buildlink3 leakage bug. * Merge the gen-transform.sh scripts between buildlink3 and wrapper and place them all in wrapper. This makes sense since the commands simply allow for many types of transformations, which buildlink3 takes advantage of, but there is nothing inherently buildlink-ish about those commands. * Don't directly manipulate SUBST_SED.unwrap. Instead, create the value of SUBST_SED.unwrap by combining several other variables (currently just _UNWRAP_SED) to ensure that the correct ordering is preserved. * Correct some confusing debugging messages. @ text @d3 1 a3 1 # $NetBSD: gen-transform.sh,v 1.31 2004/08/28 06:02:21 jlam Exp $ d168 3 a170 2 # Change "src" into "dst" and "src/*" into "dst/*", and the # same in -I, -L, and rpath options. d410 2 a411 2 # Change "src/*" into "dst/*", and the same in -I, -L, and # rpath options. d418 1 @