summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-01-21 08:04:29 +0000
committerjlam <jlam@pkgsrc.org>2004-01-21 08:04:29 +0000
commit4ea5e626c5dd30472bb8d7410dedbeedcdce5600 (patch)
tree262d628916979dca9110fa699b29078304ba0062 /mk
parent008a41b7ece21743ce4795b9f687e2d2a16c0b68 (diff)
downloadpkgsrc-4ea5e626c5dd30472bb8d7410dedbeedcdce5600.tar.gz
Add a new command "sub-rpath" that does the same thing as "rpath" but only
protects subdirectories of the named paths in rpath options to the linker. Use sub-rpath to protect /usr/lib/* in rpath options to the linker.
Diffstat (limited to 'mk')
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk7
-rw-r--r--mk/buildlink3/gen-transform.sh12
2 files changed, 17 insertions, 2 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index b6eaf0267fd..5d03b5ac076 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.52 2004/01/21 07:54:50 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.53 2004/01/21 08:04:29 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -746,6 +746,11 @@ _BLNK_TRANSFORM+= rpath:${_BLNK_MANGLE_DIR.${BUILDLINK_X11_DIR}}:${X11BASE}
_BLNK_TRANSFORM+= rpath:${_dir_}:${_BLNK_MANGLE_DIR.${_dir_}}
.endfor
#
+# Protect /usr/lib/* as they're all allowed to be specified for the
+# runtime library search path.
+#
+_BLNK_TRANSFORM+= sub-rpath:/usr/lib:${_BLNK_MANGLE_DIR./usr/lib}
+#
# Change references to ${DEPOTBASE}/<pkg> into ${LOCALBASE} so that
# "overwrite" packages think headers and libraries for "pkgviews" packages
# are just found in the default view.
diff --git a/mk/buildlink3/gen-transform.sh b/mk/buildlink3/gen-transform.sh
index 36afeed1fd9..ace9d3198b2 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.16 2004/01/21 07:54:50 jlam Exp $
+# $NetBSD: gen-transform.sh,v 1.17 2004/01/21 08:04:29 jlam Exp $
transform="@_BLNK_TRANSFORM_SEDFILE@"
untransform="@_BLNK_UNTRANSFORM_SEDFILE@"
@@ -12,6 +12,8 @@ untransform="@_BLNK_UNTRANSFORM_SEDFILE@"
# sub-mangle:src:dst mangles "src/*" into "dst/*"
# rpath:src:dst translates the directory "src" into "dst"
# in rpath options
+# sub-rpath:src:dst translates "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,*"
@@ -90,6 +92,14 @@ EOF
gen $action mangle:-Wl,-R$2:-Wl,-R$3
gen $action mangle:-R$2:-R$3
;;
+ sub-rpath)
+ gen $action sub-mangle:-Wl,--rpath-link,$2:-Wl,--rpath-link,$3
+ gen $action sub-mangle:-Wl,--rpath,$2:-Wl,--rpath,$3
+ gen $action sub-mangle:-Wl,-rpath-link,$2:-Wl,-rpath-link,$3
+ gen $action sub-mangle:-Wl,-rpath,$2:-Wl,-rpath,$3
+ gen $action sub-mangle:-Wl,-R$2:-Wl,-R$3
+ gen $action sub-mangle:-R$2:-R$3
+ ;;
abs-rpath)
gen $action __r:-Wl,--rpath-link,\\.
gen $action __r:-Wl,--rpath,\\.