pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Extend the "l" command by allowing chang...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/713629e47c05
branches:  trunk
changeset: 465634:713629e47c05
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Jan 03 20:23:51 2004 +0000

description:
Extend the "l" command by allowing changing "-lfoo" into "-lbar -lbaz" by
saying "l:foo:bar:baz".

diffstat:

 mk/buildlink3/gen-transform.sh |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 8fb9ad2ca47a -r 713629e47c05 mk/buildlink3/gen-transform.sh
--- a/mk/buildlink3/gen-transform.sh    Sat Jan 03 18:49:33 2004 +0000
+++ b/mk/buildlink3/gen-transform.sh    Sat Jan 03 20:23:51 2004 +0000
@@ -1,6 +1,6 @@
 #!@BUILDLINK_SHELL@
 #
-# $NetBSD: gen-transform.sh,v 1.3 2003/09/03 16:35:01 jlam Exp $
+# $NetBSD: gen-transform.sh,v 1.4 2004/01/03 20:23:51 jlam Exp $
 
 transform="@_BLNK_TRANSFORM_SEDFILE@"
 untransform="@_BLNK_UNTRANSFORM_SEDFILE@"
@@ -15,7 +15,7 @@
 #      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"
+#      l:foo:bar[:baz1...]     translates "-lfoo" into "-lbar [-lbaz...]"
 #      P:src:dst               translates "src/libfoo.{a,la}" into
 #                                      "dst/libfoo.{a,la}"
 #      p:path                  translates "path/*/libfoo.so" into
@@ -95,10 +95,17 @@
        l)
                case "$action" in
                transform|untransform)
+                       shift
+                       fromlib="-l$1"; shift
+                       tolibs="-l$1"; shift
+                       while [ $# -gt 0 ]; do
+                               tolibs="$tolibs -l$1"
+                               shift
+                       done
                        @CAT@ >> $sedfile << EOF
-s|-$1$2\([     "':;]\)|-$1$3\1|g
-s|-$1$2$|-$1$3|g
-s|-$1$2/|-$1$3/|g
+s|$fromlib\([  "':;]\)|$tolibs\1|g
+s|$fromlib|$tolibs|g
+s|$fromlib/|$tolibs/|g
 EOF
                        ;;
                esac



Home | Main Index | Thread Index | Old Index