Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Define RUMPPRG, which is just like PROG, except it ...



details:   https://anonhg.NetBSD.org/src/rev/d0e4f35955ff
branches:  trunk
changeset: 759599:d0e4f35955ff
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Dec 13 17:22:26 2010 +0000

description:
Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}.  The rump client
is not installed suid/sgid by default even if BINMODE is defined.

diffstat:

 share/mk/bsd.own.mk  |   9 ++++++++-
 share/mk/bsd.prog.mk |  39 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 42 insertions(+), 6 deletions(-)

diffs (110 lines):

diff -r 06d3685bbecb -r d0e4f35955ff share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Mon Dec 13 16:54:04 2010 +0000
+++ b/share/mk/bsd.own.mk       Mon Dec 13 17:22:26 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.own.mk,v 1.645 2010/12/05 09:54:34 mrg Exp $
+#      $NetBSD: bsd.own.mk,v 1.646 2010/12/13 17:22:26 pooka Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -442,6 +442,13 @@
 BINMODE?=      555
 NONBINMODE?=   444
 
+# These are here mainly because we don't want suid root in case
+# a Makefile defines BINMODE.
+RUMPBINGRP?=   wheel
+RUMPBINOWN?=   root
+RUMPBINMODE?=  555
+RUMPNONBINMODE?=444
+
 MANDIR?=       /usr/share/man
 MANGRP?=       wheel
 MANOWN?=       root
diff -r 06d3685bbecb -r d0e4f35955ff share/mk/bsd.prog.mk
--- a/share/mk/bsd.prog.mk      Mon Dec 13 16:54:04 2010 +0000
+++ b/share/mk/bsd.prog.mk      Mon Dec 13 17:22:26 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.prog.mk,v 1.254 2010/12/10 20:08:17 joerg Exp $
+#      $NetBSD: bsd.prog.mk,v 1.255 2010/12/13 17:22:26 pooka Exp $
 #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -179,6 +179,11 @@
        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
 
+__progrumpinstall: .USE
+       ${_MKTARGET_INSTALL}
+       ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
+               ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
+
 __progdebuginstall: .USE
        ${_MKTARGET_INSTALL}
        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
@@ -204,6 +209,22 @@
 _CCLINK=       ${CXX} ${_CCLINKFLAGS}
 .endif
 
+.if defined(RUMPPRG)
+PROG=                  ${RUMPPRG}
+PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
+. if defined(SRCS)
+SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
+SRCS+=                 ${PROG}_hostops.c
+. else
+SRCS=                  ${PROG}.c ${PROG}_hostops.c
+SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
+. endif
+LDADD.rump.${PROG}+=   -lrumpclient
+DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
+MAN.rump.${PROG}=      # defined but feeling empty
+_RUMPINSTALL.rump.${PROG}=# defined
+.endif
+
 .if defined(PROG)
 _CCLINK?=      ${CC} ${_CCLINKFLAGS}
 .  if defined(MAN)
@@ -224,14 +245,14 @@
 
 # Turn the single-program PROG and PROG_CXX variables into their multi-word
 # counterparts, PROGS and PROGS_CXX.
-.if defined(PROG_CXX) && !defined(PROGS_CXX)
+.if !defined(RUMPPRG)
+.  if defined(PROG_CXX) && !defined(PROGS_CXX)
 PROGS_CXX=     ${PROG_CXX}
-.elif defined(PROG) && !defined(PROGS)
+.  elif defined(PROG) && !defined(PROGS)
 PROGS=         ${PROG}
+.  endif
 .endif
 
-
-
 #
 # Per-program definitions and targets.
 #
@@ -351,7 +372,11 @@
                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
 
 .if ${MKUPDATE} == "no"
+.if defined(_RUMPINSTALL.${_P})
+${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
+.else
 ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
+.endif
 .if !defined(BUILD) && !make(all) && !make(${_P})
 ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
 .endif
@@ -362,7 +387,11 @@
 .endif
 .endif #  define(_PROGDEBUG.${_P})
 .else  # MKUPDATE != no
+.if defined(_RUMPINSTALL.${_P})
+${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
+.else
 ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
+.endif
 .if !defined(BUILD) && !make(all) && !make(${_P})
 ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
 .endif



Home | Main Index | Thread Index | Old Index