diff options
author | jlam <jlam> | 2003-08-30 07:48:53 +0000 |
---|---|---|
committer | jlam <jlam> | 2003-08-30 07:48:53 +0000 |
commit | 1dc00678b5c5dff9912ecc67a4651b9c73efe8e5 (patch) | |
tree | 524af1aa2443bdfbd60082f8ef62da4937c45e4e | |
parent | 5629ff2e4349f92625b9b1aa238befdd43b9601b (diff) | |
download | pkgsrc-1dc00678b5c5dff9912ecc67a4651b9c73efe8e5.tar.gz |
Add a new command "depot:src:dst" that translates "src/<dir>/" into "dst/".
Also be more strict about matching either non-separators or separators that
can appear after a directory name.
-rw-r--r-- | mk/buildlink3/gen-transform.sh | 89 |
1 files changed, 51 insertions, 38 deletions
diff --git a/mk/buildlink3/gen-transform.sh b/mk/buildlink3/gen-transform.sh index d9a6baf02d9..0cbcef3327b 100644 --- a/mk/buildlink3/gen-transform.sh +++ b/mk/buildlink3/gen-transform.sh @@ -1,6 +1,6 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: gen-transform.sh,v 1.1.2.6 2003/08/28 19:12:55 jlam Exp $ +# $NetBSD: gen-transform.sh,v 1.1.2.7 2003/08/30 07:48:53 jlam Exp $ transform="@_BLNK_TRANSFORM_SEDFILE@" untransform="@_BLNK_UNTRANSFORM_SEDFILE@" @@ -11,17 +11,18 @@ untransform="@_BLNK_UNTRANSFORM_SEDFILE@" # mangle:src:dst mangles the directory "src" into "dst" # rpath:src:dst mangles the directory "src" into "dst" # in rpath options -# I:src:dst translates "-Isrc" into "-Idst" -# L:src:dst translates "-Lsrc" into "-Ldst" -# l:foo:bar translates "-lfoo" into "-lbar" +# no-rpath removes "-R*", "-Wl,-R", and "-Wl,-rpath,*" +# depot:src:dst translates "src/<dir>/" into "dst/" +# I:src:dst translates "-Isrc" into "-Idst" +# L:src:dst translates "-Lsrc" into "-Ldst" +# l:foo:bar translates "-lfoo" into "-lbar" # P:src:dst translates "src/libfoo.{a,la}" into # "dst/libfoo.{a,la}" # p:path translates "path/*/libfoo.so" into # "-Lpath/* -lfoo" -# r:dir removes "dir" and "dir/*" -# S:foo:bar translates word "foo" into "bar" -# s:foo:bar translates "foo" into "bar" -# no-rpath removes "-R*", "-Wl,-R", and "-Wl,-rpath,*" +# r:dir removes "dir" and "dir/*" +# S:foo:bar translates word "foo" into "bar" +# s:foo:bar translates "foo" into "bar" gen() { action=$1; shift @@ -37,7 +38,7 @@ gen() { case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|$2\([/ ]\)|$3\1|g +s|$2\([/ \`"':;]\)|$3\1|g s|$2$|$3|g EOF ;; @@ -59,18 +60,28 @@ EOF gen $action _r:-Wl,-R gen $action _r:-R ;; + depot) + case "$action" in + transform|untransform) + @CAT@ >> $sedfile << EOF +s|$2/[^/ \`"':;]*\(/[^ \`"':;]\)|$3\1|g +s|$2/[^/ \`"':;]*$|$3|g +EOF + ;; + esac + ;; I|L) case "$action" in transform) @CAT@ >> $sedfile << EOF -s|-$1$2\([ ]\)$|-$1$3\1|g +s|-$1$2\([ \`"':;]\)$|-$1$3\1|g s|-$1$2$|-$1$3|g s|-$1$2/|-$1$3/|g EOF ;; untransform) @CAT@ >> $sedfile << EOF -s|-$1$3\([ ]\)$|-$1$2\1|g +s|-$1$3\([ \`"':;]\)$|-$1$2\1|g s|-$1$3$|-$1$2|g s|-$1$3/|-$1$2/|g EOF @@ -81,7 +92,7 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|-$1$2\([ ]\)|-$1$3\1|g +s|-$1$2\([ "';;]\)|-$1$3\1|g s|-$1$2$|-$1$3|g s|-$1$2/|-$1$3/|g EOF @@ -92,18 +103,18 @@ EOF case "$action" in transform) @CAT@ >> $sedfile << EOF -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.la\)\([ ]\)|$3\1\2|g -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.la\)$|$3\1|g -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.a\)\([ ]\)|$3\1\2|g -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.a\)$|$3\1|g +s|$2\(/[^ \`"':;]*/lib[^/ \`"':;]*\.la\)\([ \`"':;]\)|$3\1\2|g +s|$2\(/[^ \`"':;]*/lib[^/ \`"':;]*\.la\)$|$3\1|g +s|$2\(/[^ \`"':;]*/lib[^/ \`"':;]*\.a\)\([ \`"':;]\)|$3\1\2|g +s|$2\(/[^ \`"':;]*/lib[^/ \`"':;]*\.a\)$|$3\1|g EOF ;; untransform) @CAT@ >> $sedfile << EOF -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.a\)\([ ]\)|$2\1\2|g -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.a\)$|$2\1|g -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.la\)\([ ]\)|$2\1\2|g -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.la\)$|$2\1|g +s|$3\(/[^ \`"':;]*/lib[^/ \`"':;]*\.a\)\([ \`"':;]\)|$2\1\2|g +s|$3\(/[^ \`"':;]*/lib[^/ \`"':;]*\.a\)$|$2\1|g +s|$3\(/[^ \`"':;]*/lib[^/ \`"':;]*\.la\)\([ \`"':;]\)|$2\1\2|g +s|$3\(/[^ \`"':;]*/lib[^/ \`"':;]*\.la\)$|$2\1|g EOF ;; esac @@ -112,20 +123,22 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.so\.[0-9]*|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.so\.[0-9]*|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.so|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.so|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.[0-9]*\.dylib|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.[0-9]*\.dylib|-L\1 -l\2|g -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.dylib|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.dylib|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.so\.[0-9]*|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.so|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.so|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.[0-9]*\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.[0-9]*\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.[0-9]*\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.[0-9]*\.dylib|-L\1 -l\2|g +s|\($2/[^ \`"':;]*\)/lib\([^/ \`"':;]*\)\.dylib|-L\1 -l\2|g +s|\($2\)/lib\([^/ \`"':;]*\)\.dylib|-L\1 -l\2|g EOF ;; esac @@ -134,7 +147,7 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|$2/[^ "':;]*||g +s|$2/[^ \`"':;]*||g EOF ;; esac @@ -143,9 +156,9 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|$2\([ ]\)|\1|g +s|$2\([ \`"':;]\)|\1|g s|$2$||g -s|$2/[^ "':;]*||g +s|$2/[^ \`"':;]*||g EOF ;; esac @@ -168,7 +181,7 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|$2\([ ]\)|$3\1|g +s|$2\([ \`"':;]\)|$3\1|g s|$2$|$3|g EOF ;; |