diff options
author | jlam <jlam@pkgsrc.org> | 2004-01-13 07:52:37 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-01-13 07:52:37 +0000 |
commit | 231aa68659077b2557f4f98047a96feccf7414e2 (patch) | |
tree | 19bb739c7ee2c65868fc90dfbc0e486dfa8f9d89 /mk/buildlink3/gen-transform.sh | |
parent | 1dbf1ed26d4bbd2351d07ebb8e0c7f403b0e748b (diff) | |
download | pkgsrc-231aa68659077b2557f4f98047a96feccf7414e2.tar.gz |
Add a new command "abs-rpath" to the gen-transform.sh script that removes
rpath options that try to add relative paths to the runtime library search
path. This basically partly cleans up after lazy programmers.
Diffstat (limited to 'mk/buildlink3/gen-transform.sh')
-rw-r--r-- | mk/buildlink3/gen-transform.sh | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/mk/buildlink3/gen-transform.sh b/mk/buildlink3/gen-transform.sh index 60148c32ce2..1ca7d91f019 100644 --- a/mk/buildlink3/gen-transform.sh +++ b/mk/buildlink3/gen-transform.sh @@ -1,6 +1,6 @@ #!@BUILDLINK_SHELL@ # -# $NetBSD: gen-transform.sh,v 1.10 2004/01/11 03:30:20 grant Exp $ +# $NetBSD: gen-transform.sh,v 1.11 2004/01/13 07:52:37 jlam Exp $ transform="@_BLNK_TRANSFORM_SEDFILE@" untransform="@_BLNK_UNTRANSFORM_SEDFILE@" @@ -11,6 +11,8 @@ untransform="@_BLNK_UNTRANSFORM_SEDFILE@" # mangle:src:dst mangles the directory "src" into "dst" # rpath:src:dst translates the directory "src" into "dst" # in rpath options +# abs-rpath removes all rpath options that try to add +# relative paths # no-rpath removes "-R*", "-Wl,-R", and "-Wl,-rpath,*" # depot:src:dst translates "src/<dir>/" into "dst/" # I:src:dst translates "-Isrc" into "-Idst" @@ -56,6 +58,14 @@ EOF gen $action mangle:-Wl,-R$2:-Wl,-R$3 gen $action mangle:-R$2:-R$3 ;; + abs-rpath) + gen $action __r:-Wl,--rpath-link,[^/] + gen $action __r:-Wl,--rpath,[^/] + gen $action __r:-Wl,-rpath-link,[^/] + gen $action __r:-Wl,-rpath,[^/] + gen $action __r:-Wl,-R[^/] + gen $action __r:-R[^/] + ;; no-rpath) gen $action _r:-Wl,--rpath-link, gen $action _r:-Wl,--rpath, @@ -164,7 +174,7 @@ EOF case "$action" in transform|untransform) @CAT@ >> $sedfile << EOF -s|$2/[^ \`"':;]*||g +s|$2[^ \`"':;]*||g EOF ;; esac @@ -182,17 +192,17 @@ EOF ;; r) case "$2" in - "") r=__r ;; - *) r=_r ;; + "") r=__r; pat="/" ;; + *) r=_r; pat="$2" ;; esac - gen $action $r:-I$2 - gen $action $r:-L$2 - gen $action $r:-Wl,--rpath-link,$2 - gen $action $r:-Wl,--rpath,$2 - gen $action $r:-Wl,-rpath-link,$2 - gen $action $r:-Wl,-rpath,$2 - gen $action $r:-Wl,-R$2 - gen $action $r:-R$2 + gen $action $r:-I$pat + gen $action $r:-L$pat + gen $action $r:-Wl,--rpath-link,$pat + gen $action $r:-Wl,--rpath,$pat + gen $action $r:-Wl,-rpath-link,$pat + gen $action $r:-Wl,-rpath,$pat + gen $action $r:-Wl,-R$pat + gen $action $r:-R$pat ;; S) case "$action" in |