pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Document this file, and do the command l...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d704ad94cd3d
branches:  trunk
changeset: 460994:d704ad94cd3d
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Sep 09 09:11:42 2003 +0000

description:
Document this file, and do the command length reduction by suppressing
repeated options as is done in in revision 1.3 of wrapper.sh.

diffstat:

 mk/buildlink3/libtool.sh |  50 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 48 insertions(+), 2 deletions(-)

diffs (76 lines):

diff -r 2a0ac8f43257 -r d704ad94cd3d mk/buildlink3/libtool.sh
--- a/mk/buildlink3/libtool.sh  Tue Sep 09 09:10:55 2003 +0000
+++ b/mk/buildlink3/libtool.sh  Tue Sep 09 09:11:42 2003 +0000
@@ -1,6 +1,6 @@
 #!@BUILDLINK_SHELL@
 #
-# $NetBSD: libtool.sh,v 1.2 2003/09/02 06:59:59 jlam Exp $
+# $NetBSD: libtool.sh,v 1.3 2003/09/09 09:11:42 jlam Exp $
 
 Xsed='@SED@ -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
@@ -69,17 +69,63 @@
                *)
                        cachehit=no
                        skipcache=no
+                       #
+                       # Marshall any group of consecutive arguments into
+                       # a single $arg to be checked in the cache and
+                       # logic files.
+                       #
                        . $marshall
+                       #
+                       # Check the private cache, and possibly set
+                       # skipcache=yes.
+                       #
                        . $private_cache
+                       #
+                       # Check the common cache shared by all of the other
+                       # wrappers.
+                       #
                        case $skipcache,$cachehit in
                        no,no)  . $cache ;;
                        esac
+                       #
+                       # If the cache doesn't cover the arg we're
+                       # examining, then run it through the
+                       # transformations and cache the result.
+                       #
                        case $cachehit in
                        no)     . $logic ;;
                        esac
                        ;;
                esac
-               cmd="$cmd $arg"
+               #
+               # Reduce command length by not appending options that we've
+               # already seen to the command.
+               #
+               case $arg in
+               -[DILR]*|-Wl,-R*|-Wl,-*,/*)
+                       #
+                       # These options are only ever useful the first time
+                       # they're given.  All other instances are redundant.
+                       #
+                       case "$cmd" in
+                       *" "$arg|*" "$arg" "*)  ;;
+                       *)      cmd="$cmd $arg" ;;
+                       esac
+                       ;;
+               -l*)
+                       #
+                       # Extra libraries are suppressed only if they're
+                       # repeated, e.g. "-lm -lm -lm -lm" -> "-lm".
+                       #
+                       case "$cmd" in
+                       *" "$arg)       ;;
+                       *)      cmd="$cmd $arg" ;;
+                       esac
+                       ;;
+               *)
+                       cmd="$cmd $arg"
+                       ;;
+               esac
        done
        ;;
 esac



Home | Main Index | Thread Index | Old Index