pkgsrc/mk/check/check-portability.mk
rillig edf2ea6495 mk/check: enable check-portability for [[
Since pkgtools/check-portability is not installed by default, it will not
harm any existing pkgsrc setup. To activate it, it has to be installed
manually. After a testing phase, it will be installed whenever
PKG_DEVELOPER is set.
2020-03-11 19:21:00 +00:00

49 lines
1.4 KiB
Makefile

# $NetBSD: check-portability.mk,v 1.10 2020/03/11 19:21:00 rillig Exp $
#
# This file contains some checks that are applied to the configure
# scripts to check for certain constructs that are known to cause
# problems on some platforms. The detailed checks are in
# check-portability.sh.
#
# User-settable variables:
#
# CHECK_PORTABILITY
# Whether to enable some portability checks for the configure
# scripts before they are run.
#
# Default value: yes for PKG_DEVELOPERs, no otherwise.
#
# Package-settable variables:
#
# CHECK_PORTABILITY_SKIP
# The list of files that should be skipped in the portability
# check.
#
# Default value: empty.
# Example: debian/*
_VARGROUPS+= check-portability
_USER_VARS.check-portability= CHECK_PORTABILITY
_PKG_VARS.check-portability= CHECK_PORTABILITY_SKIP
.if ${PKG_DEVELOPER:Uno} != "no"
CHECK_PORTABILITY?= yes
.endif
CHECK_PORTABILITY?= no
.if defined(SKIP_PORTABILITY_CHECK)
PKG_FAIL_REASON+= "[check-portability.mk] SKIP_PORTABILITY_CHECK is obsolete."
.endif
CHECK_PORTABILITY_SKIP?= # none
.if ${CHECK_PORTABILITY:M[Yy][Ee][Ss]} != ""
pre-configure-checks-hook: _check-portability
.endif
.PHONY: _check-portability
_check-portability:
@${STEP_MSG} "Checking for portability problems in extracted files"
${RUN} \
[ -d ${WRKSRC}/. ] || exit 0; \
cd ${WRKSRC}; \
env SKIP_FILTER=${CHECK_PORTABILITY_SKIP:@p@${p}) skip=yes;;@:Q} \
PREFIX=${PREFIX} \
sh ${PKGSRCDIR}/mk/check/check-portability.sh