diff options
author | jlam <jlam> | 2004-11-09 17:16:16 +0000 |
---|---|---|
committer | jlam <jlam> | 2004-11-09 17:16:16 +0000 |
commit | 202411f5c0d6fdfd1de1115dce3260aeda76698a (patch) | |
tree | d981cbb125e48e5e90b064d6e3ba12098378648d /mk/wrapper | |
parent | 4c32626e7d7d587f44196b24a4beed48f21e0ee1 (diff) | |
download | pkgsrc-202411f5c0d6fdfd1de1115dce3260aeda76698a.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 |