Index: Mk/Uses/elfctl.mk =================================================================== --- /dev/null +++ Mk/Uses/elfctl.mk @@ -0,0 +1,28 @@ +# Change an ELF binary's feature control note +# +# Feature: elfctl +# Usage: USES=elfctl +# Valid ARGS: none +# +# Variables +# +# ELF_FEATURES= path/to/file1:FEATURE(S) \ +# path/to/file2:FEATURE(S) +# +# The file paths listed in ELF_FEATURES are relative to ${PREFIX}. +# + +.if !defined(_INCLUDE_USES_ELFCTL_MK) +_INCLUDE_USES_ELFCTL_MK= yes + +.for feat in ${ELF_FEATURES} +_FEATLIST+= -e ${feat:C/.*://} ${STAGEDIR}${PREFIX}/${feat:C/:.*//} +.endfor + +.if ! empty(_FEATLIST) +_USES_install+= 620:elfctl-post-install +elfctl-post-install: + ${ELFCTL} -i ${_FEATLIST} +.endif + +.endif Index: Mk/bsd.commands.mk =================================================================== --- Mk/bsd.commands.mk +++ Mk/bsd.commands.mk @@ -34,6 +34,7 @@ DIFF?= /usr/bin/diff DIRNAME?= /usr/bin/dirname EGREP?= /usr/bin/egrep +ELFCTL?= /usr/bin/elfctl EXPR?= /bin/expr FALSE?= false # Shell builtin FILE?= /usr/bin/file