diff options
author | jlam <jlam> | 2005-06-08 05:54:17 +0000 |
---|---|---|
committer | jlam <jlam> | 2005-06-08 05:54:17 +0000 |
commit | 5532ae2191fb38ca5d2fef353bfb70643d5a078b (patch) | |
tree | 921f3e3129237df8f2145f40d9cf2b8ba4012f74 /mk | |
parent | 0046d52c18794e119483a923c60a3c04f3661b97 (diff) | |
download | pkgsrc-5532ae2191fb38ca5d2fef353bfb70643d5a078b.tar.gz |
Properly turn:
-Wl,-rpath -Wl,/dir1:/dir2:/dir3
into:
-Wl,-rpath,/dir1 -Wl,-rpath,/dir2 -Wl,-rpath,/dir3
Do the same for -Wl,-R and -Wl,-rpath-link. This makes the wrapper
scripts pass the test in regress/buildlink-transform/rpath-merge.mk
and fixes PR pkg/27702.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/wrapper/arg-source | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/mk/wrapper/arg-source b/mk/wrapper/arg-source index 2e0fd74e39b..69cdb3e3506 100644 --- a/mk/wrapper/arg-source +++ b/mk/wrapper/arg-source @@ -1,4 +1,4 @@ -# $NetBSD: arg-source,v 1.5 2005/06/08 05:02:50 jlam Exp $ +# $NetBSD: arg-source,v 1.6 2005/06/08 05:54:17 jlam Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -81,6 +81,37 @@ while $test $# -gt 0; do IFS="${save_IFS}" ;; ############################################################## + # Merge and split "-Wl,-R -Wl,/dir1:/dir2" into + # "-Wl,-R/dir1 -Wl,-R/dir2". Same for -Wl,-rpath and + # -Wl,-rpath-link. + ############################################################## + -Wl,-R|-Wl,-rpath|-Wl,-rpath-link|-Wl,--rpath) + nextarg="$1"; shift + case $arg in + -Wl,-R) R="-Wl,-R" ;; + -Wl,-rpath) R="-Wl,-rpath," ;; + -Wl,-rpath-link) R="-Wl,-rpath-link," ;; + -Wl,--rpath) R="-Wl,--rpath," ;; + esac + nextarg="${nextarg#-Wl}" + case $nextarg in + *:*) + save_IFS="${IFS}"; IFS=":" + for dir in $nextarg; do + shquote "$dir"; dir="$shquoted" + append_queue argbuf "$R$dir" + $debug_log $wrapperlog " (arg-source) push: $R$dir" + done + IFS="${save_IFS}" + ;; + *) + shquote "$nextarg"; nextarg="$shquoted" + append_queue argbuf "$R$nextarg" + $debug_log $wrapperlog " (arg-source) push: $R$nextarg" + ;; + esac + ;; + ############################################################## # "-Xlinker arg" is the equivalent of "-Wl,arg" so convert it # here before queueing it up. ############################################################## |