view pax-mark-vm.in @ 2705:f59e4269da38

Avoid giving PAX_COMMAND a value if no PaX utility is available. 2014-02-21 Andrew John Hughes <gnu.andrew@member.fsf.org> * acinclude.m4: (IT_WITH_PAX): Leave PAX_COMMAND with the empty string rather than "not specified" to avoid build failures. * pax-mark-vm.in: Update PAX_COMMAND check.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Fri, 21 Feb 2014 22:04:31 +0000
parents 70bfc9d0aa81
children
line wrap: on
line source

#!/bin/sh

# Taken from Gentoo's pax-utils.eclass
list_paxables() {
	file "$@" 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//'
}

if test "x@PAX_COMMAND@" != "x"; then
	for paxable in `list_paxables "${1}"/bin/* "${1}"/jre/bin/*`; do
		echo "PaX mark @PAX_COMMAND_ARGS@ ${paxable}"
		@PAX_COMMAND@ @PAX_COMMAND_ARGS@ "${paxable}"
	done
fi