if ${PROG_PAX} is defined, run paxctl on the binary after linking with

the value of the variable. This way, if you set:

    PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.
This commit is contained in:
christos 2006-11-10 17:13:15 +00:00
parent 2354d57484
commit fef715f487
3 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.187 2006/11/09 17:06:54 christos Exp $
# $NetBSD: bsd.README,v 1.188 2006/11/10 17:13:15 christos Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the new make "include" files for the BSD
@ -987,6 +987,11 @@ PROG_CXX If defined, the name of the program to build. Also
compiler rather than the C compiler. PROG_CXX overrides
the value of PROG if PROG is also set.
PROG_PAX If defined then paxctl(1) is ran on binary after link
time, with the value of the variable as args to it.
PROG_PAX.${PROG} Custom override for PROG_PAX.
PROGNAME The name that the above program will be installed as, if
different from ${PROG}.

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.482 2006/10/18 23:31:50 bjh21 Exp $
# $NetBSD: bsd.own.mk,v 1.483 2006/11/10 17:13:15 christos Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@ -210,6 +210,7 @@ LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.prog.mk,v 1.217 2006/10/22 22:53:41 pooka Exp $
# $NetBSD: bsd.prog.mk,v 1.218 2006/11/10 17:13:15 christos Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.ifndef HOSTPROG
@ -11,6 +11,10 @@
PROG= ${PROG_CXX}
.endif
.if defined(PROG_PAX)
PROG_PAX.${PROG}?= ${PROG_PAX}
.endif
##### Basic targets
realinstall: proginstall scriptsinstall
clean: cleanprog
@ -212,6 +216,9 @@ ${PROG}: .gdbinit ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD
${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}
.endif # defined(DESTDIR)
.endif # !commands(${PROG})
.if defined(PROG_PAX.${PROG})
${PAXCTL} ${PROG_PAX.${PROG}} ${.TARGET}
.endif
${PROG}.ro: ${OBJS} ${DPADD}
${_MKTARGET_LINK}