pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Add a new command "abs-rpath" to the gen...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bca8f35cafaf
branches:  trunk
changeset: 466209:bca8f35cafaf
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Jan 13 07:52:37 2004 +0000

description:
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:

 mk/buildlink3/bsd.buildlink3.mk |   8 +++++++-
 mk/buildlink3/gen-transform.sh  |  34 ++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 13 deletions(-)

diffs (94 lines):

diff -r 2c3a07c4ca1c -r bca8f35cafaf mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Tue Jan 13 07:15:41 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Tue Jan 13 07:52:37 2004 +0000
@@ -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+=       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 -r 2c3a07c4ca1c -r bca8f35cafaf mk/buildlink3/gen-transform.sh
--- a/mk/buildlink3/gen-transform.sh    Tue Jan 13 07:15:41 2004 +0000
+++ b/mk/buildlink3/gen-transform.sh    Tue Jan 13 07:52:37 2004 +0000
@@ -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 @@
 #      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 @@
                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 @@
                case "$action" in
                transform|untransform)
                        @CAT@ >> $sedfile << EOF
-s|$2/[^        \`"':;]*||g
+s|$2[^         \`"':;]*||g
 EOF
                        ;;
                esac
@@ -182,17 +192,17 @@
                ;;
        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



Home | Main Index | Thread Index | Old Index