pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Suppress duplicates when splitting -Wl,-...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b44961d5e73c
branches:  trunk
changeset: 465881:b44961d5e73c
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Jan 07 17:31:02 2004 +0000

description:
Suppress duplicates when splitting -Wl,-R/dir1:/dir2:... into separate
arguments.  This avoids overfilling the circular buffer (length 5) used
by the buildlink3 wrappers.

diffstat:

 mk/buildlink3/buffer |  22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diffs (38 lines):

diff -r 5b090d674236 -r b44961d5e73c mk/buildlink3/buffer
--- a/mk/buildlink3/buffer      Wed Jan 07 16:57:35 2004 +0000
+++ b/mk/buildlink3/buffer      Wed Jan 07 17:31:02 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buffer,v 1.1 2003/10/09 12:15:15 jlam Exp $
+# $NetBSD: buffer,v 1.2 2004/01/07 17:31:02 jlam Exp $
 #
 # Fill the buffer if it's empty, and shift the arguments.  The next
 # argument checked by the cache and logic files is taken from the
@@ -35,14 +35,22 @@
                arg=`$echo "X$arg" | $Xsed -e "s|^"$R"||g"`
                allargs="$@"
                save_IFS="${IFS}"; IFS=":"
+               dirlist=
                set -- $arg
                while $test $# -gt 0; do
-                       if   $test -z "$buf1"; then buf1="$R$1"; shift
-                       elif $test -z "$buf2"; then buf2="$R$1"; shift
-                       elif $test -z "$buf3"; then buf3="$R$1"; shift
-                       elif $test -z "$buf4"; then buf4="$R$1"; shift
-                       elif $test -z "$buf5"; then buf5="$R$1"; shift
-                       fi
+                       case "$dirlist" in
+                       "$1"|"$1 "*) ;;
+                       *" $1 "*|*" $1") ;;
+                       *)      dirlist="$dirlist $1"
+                               if   $test -z "$buf1"; then buf1="$R$1"
+                               elif $test -z "$buf2"; then buf2="$R$1"
+                               elif $test -z "$buf3"; then buf3="$R$1"
+                               elif $test -z "$buf4"; then buf4="$R$1"
+                               elif $test -z "$buf5"; then buf5="$R$1"
+                               fi
+                               ;;
+                       esac
+                       shift
                done
                IFS="${save_IFS}"
                if $test -n "$allargs"; then



Home | Main Index | Thread Index | Old Index