diff options
author | jlam <jlam@pkgsrc.org> | 2004-11-09 17:16:16 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-11-09 17:16:16 +0000 |
commit | 17f45b2ca7b926342362d2d1520bd663557c47ae (patch) | |
tree | d981cbb125e48e5e90b064d6e3ba12098378648d /mk/wrapper | |
parent | 0495c38889cc1daa6b3e03d81f37523fb046abb8 (diff) | |
download | pkgsrc-17f45b2ca7b926342362d2d1520bd663557c47ae.tar.gz |
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.
Diffstat (limited to 'mk/wrapper')
-rw-r--r-- | mk/wrapper/gen-transform.sh | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/mk/wrapper/gen-transform.sh b/mk/wrapper/gen-transform.sh index fc2db7f86b4..f11a0fb2c67 100644 --- a/mk/wrapper/gen-transform.sh +++ b/mk/wrapper/gen-transform.sh @@ -1,6 +1,6 @@ #! @WRAPPER_SHELL@ # -# $NetBSD: gen-transform.sh,v 1.6 2004/11/08 22:29:19 jlam Exp $ +# $NetBSD: gen-transform.sh,v 1.7 2004/11/09 17:16:16 jlam Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -54,7 +54,11 @@ rpath_options="-Wl,--rpath, -Wl,-rpath-link, -Wl,-rpath, -Wl,-R -R" ###################################################################### # gen action arg -# Outputs sed commands that correspond to $action for $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() { @@ -142,7 +146,14 @@ gen() ############################################################## libpath) case $_action in - transform|untransform) + transform) + $debug_log $wrapperlog " (gen-transform) $_cmd: $@" + $cat << EOF +s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g +s|^$1\(/[^$_sep]*\.la\)$|$2\1|g +EOF + ;; + untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" $cat << EOF s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g @@ -199,7 +210,14 @@ EOF ############################################################## opt) case $_action in - transform|untransform) + transform) + $debug_log $wrapperlog " (gen-transform) $_cmd: $@" + $cat << EOF +s|^$1\([$_sep]\)|$2\1|g +s|^$1$|$2|g +EOF + ;; + untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" $cat << EOF s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g @@ -217,7 +235,14 @@ EOF ############################################################### opt-depot) case $_action in - transform|untransform) + transform) + $debug_log $wrapperlog " (gen-transform) $_cmd: $@" + $cat << EOF +s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g +s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g +EOF + ;; + untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" $cat << EOF s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g @@ -244,7 +269,14 @@ EOF ############################################################## opt-sub-trailer) case $_action in - transform|untransform) + transform) + $debug_log $wrapperlog " (gen-transform) $_cmd: $@" + $cat << EOF +s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g +s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g +EOF + ;; + untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" $cat << EOF s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g @@ -296,7 +328,14 @@ EOF ############################################################## rm-optarg) case $_action in - transform|untransform) + transform) + $debug_log $wrapperlog " (gen-transform) $_cmd: $@" + $cat << EOF +s|^$1[^$_sep]*\([$_sep]\)|\1|g +s|^$1[^$_sep]*$||g +EOF + ;; + untransform) $debug_log $wrapperlog " (gen-transform) $_cmd: $@" $cat << EOF s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g |