diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-09 09:11:42 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-09 09:11:42 +0000 |
commit | 71ea615ef570466e24631d2e0cb5b83509a32f65 (patch) | |
tree | 2efb3f2525d6cce7670f46cc19e9000b8523d534 /mk/buildlink3 | |
parent | 3ea756e459ef602d4e9988ba3edd274d23778cee (diff) | |
download | pkgsrc-71ea615ef570466e24631d2e0cb5b83509a32f65.tar.gz |
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 (limited to 'mk/buildlink3')
-rw-r--r-- | mk/buildlink3/libtool.sh | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/mk/buildlink3/libtool.sh b/mk/buildlink3/libtool.sh index 149833b602e..2dc4bc265b5 100644 --- a/mk/buildlink3/libtool.sh +++ b/mk/buildlink3/libtool.sh @@ -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 @@ case "$1" in *) 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 |