Add support for CHECK_WRKREF_EXTRA_DIRS to check-shlibs. If "extra" is

listed in CHECK_WRKREF then these directories will added to the checks
for rpath references.
This commit is contained in:
jperkin 2015-11-16 17:53:29 +00:00
parent b14f70748f
commit c2fe79eceb
2 changed files with 13 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: check-shlibs-elf.awk,v 1.11 2015/08/10 15:11:47 jperkin Exp $ # $NetBSD: check-shlibs-elf.awk,v 1.12 2015/11/16 17:53:29 jperkin Exp $
# #
# Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. # Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>.
# All rights reserved. # All rights reserved.
@ -121,11 +121,18 @@ function checkshlib(DSO, needed, rpath, found, dso_rpath, got_rpath, nrpath) {
if (!got_rpath) if (!got_rpath)
nrpath = split(system_rpath, rpath, ":") nrpath = split(system_rpath, rpath, ":")
close(cmd) close(cmd)
nedirs = split(extradirs, edirs, " ")
for (p in rpath) { for (p in rpath) {
if (rpath[p] == wrkdir || if (rpath[p] == wrkdir ||
substr(rpath[p], 1, length(wrkdir) + 1) == wrkdir "/") { substr(rpath[p], 1, length(wrkdir) + 1) == wrkdir "/") {
print DSO ": rpath relative to WRKDIR" print DSO ": rpath relative to WRKDIR"
} }
for (e = 1; e <= nedirs; e++) {
if (rpath[p] == edirs[e] ||
substr(rpath[p], 1, length(edirs[e]) + 1) == edirs[e] "/") {
print DSO ": rpath " rpath[p] " relative to CHECK_WRKREF_EXTRA_DIRS directory " edirs[e]
}
}
} }
for (lib in needed) { for (lib in needed) {
for (p = 1; p <= nrpath; p++) { for (p = 1; p <= nrpath; p++) {
@ -160,6 +167,7 @@ BEGIN {
destdir = ENVIRON["DESTDIR"] destdir = ENVIRON["DESTDIR"]
readelf = ENVIRON["READELF"] readelf = ENVIRON["READELF"]
wrkdir = ENVIRON["WRKDIR"] wrkdir = ENVIRON["WRKDIR"]
extradirs = ENVIRON["CHECK_WRKREF_EXTRA_DIRS"]
pkg_info_cmd = ENVIRON["PKG_INFO_CMD"] pkg_info_cmd = ENVIRON["PKG_INFO_CMD"]
depends_file = ENVIRON["DEPENDS_FILE"] depends_file = ENVIRON["DEPENDS_FILE"]
if (readelf == "") if (readelf == "")

View file

@ -1,4 +1,4 @@
# $NetBSD: check-shlibs.mk,v 1.26 2015/08/17 17:35:23 jperkin Exp $ # $NetBSD: check-shlibs.mk,v 1.27 2015/11/16 17:53:29 jperkin Exp $
# #
# This file verifies that all libraries used by the package can be found # This file verifies that all libraries used by the package can be found
# at run-time. # at run-time.
@ -67,6 +67,9 @@ CHECK_SHLIBS_NATIVE_ENV+= DEPENDS_FILE=${_RRDEPENDS_FILE:Q}
CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q} CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q}
. endif . endif
CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q} CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q}
. if !empty(CHECK_WRKREF:Mextra)
CHECK_SHLIBS_NATIVE_ENV+= CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q}
. endif
_check-shlibs: error-check .PHONY _check-shlibs: error-check .PHONY
@${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}"