summaryrefslogtreecommitdiff
path: root/mk/buildlink3
diff options
context:
space:
mode:
authorjlam <jlam>2004-01-13 07:52:37 +0000
committerjlam <jlam>2004-01-13 07:52:37 +0000
commit2cd9711baa50fc104e8956d1990f51224cdab9b5 (patch)
tree19bb739c7ee2c65868fc90dfbc0e486dfa8f9d89 /mk/buildlink3
parent8a16aa01482ec5986001d84083fdf08bd3f42039 (diff)
downloadpkgsrc-2cd9711baa50fc104e8956d1990f51224cdab9b5.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')
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk8
-rw-r--r--mk/buildlink3/gen-transform.sh34
2 files changed, 29 insertions, 13 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index 9d40cc5bf1f..28a3d30d84c 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.47 2004/01/11 06:50:58 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.48 2004/01/13 07:52:37 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -767,6 +767,12 @@ _BLNK_TRANSFORM+= r:
_BLNK_TRANSFORM+= no-rpath
.endif
#
+# Remove rpath options that try to add relative paths to the runtime
+# library search path. This basically partly cleans up after lazy
+# programmers.
+#
+_BLNK_TRANSFORM+= abs-rpath
+#
# Undo the protection for the directories that we allow to be specified
# for the runtime library search path.
#
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