diff options
author | jlam <jlam> | 2003-09-08 21:10:26 +0000 |
---|---|---|
committer | jlam <jlam> | 2003-09-08 21:10:26 +0000 |
commit | 6656f4317a07371c2ce71230f66bc29309943080 (patch) | |
tree | 1c442966d21cfce4e5fc0a0fc2e6571f632cabe2 /mk | |
parent | 34d1ec5c67bf2870ad77e19604b6c9931a9b03b2 (diff) | |
download | pkgsrc-6656f4317a07371c2ce71230f66bc29309943080.tar.gz |
Reduce length of command lines executed by not appending some options that
we've already seen:
-[DILR]*|-Wl,-R*|-Wl,-*,/*
These are all only useful the first time we see them. All other
instances are redundant.
-l*
Extra libraries are suppressed if they're repeated, e.g.,
"-lm -lm -lm -lX11 -lX11 -lm -lm" -> "-lm -lX11 -lm".
The screen output is still likely to be very verbose, but you can check
in work/.work.log to see the actual commands executed.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/buildlink3/wrapper.sh | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/mk/buildlink3/wrapper.sh b/mk/buildlink3/wrapper.sh index 3cd4b4e164b..c95f4968f67 100644 --- a/mk/buildlink3/wrapper.sh +++ b/mk/buildlink3/wrapper.sh @@ -1,6 +1,6 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: wrapper.sh,v 1.2 2003/09/02 07:00:03 jlam Exp $ +# $NetBSD: wrapper.sh,v 1.3 2003/09/08 21:10:26 jlam Exp $ Xsed='@SED@ -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' @@ -57,7 +57,35 @@ while $test $# -gt 0; do case $cachehit in no) . $logic ;; 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 @_BLNK_WRAP_ENV@ |