diff options
author | jlam <jlam@pkgsrc.org> | 2004-12-18 19:24:26 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-12-18 19:24:26 +0000 |
commit | 8b2040b4099326c3df41ba99ace8f6ec746ab61a (patch) | |
tree | a46e69a2763d5a4dd32b7a8c69c696bae154da76 /mk | |
parent | a5d15ead5cb19781bb5a34e2c233e2366870ae14 (diff) | |
download | pkgsrc-8b2040b4099326c3df41ba99ace8f6ec746ab61a.tar.gz |
Always create a ${TOOLS_DIR}/bin/rpcgen to wrap the real rpcgen.
The wrapper will correctly set the CPP environment variable to a
stat((2)able path to a C preprocessor, then rely on the PATH to
find and invoke the real rpcgen.
Remove NO_EXPORT_CPP in package Makefiles where it was used just to
avoid problems with rpcgen. The build system now just does the right
thing automatically without needing package-specific knowledge.
This fixes PR pkg/27272.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/tools.mk | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/mk/tools.mk b/mk/tools.mk index 3b74bbb8a74..f17c69d3c5a 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -1,4 +1,4 @@ -# $NetBSD: tools.mk,v 1.46 2004/11/02 22:24:35 wiz Exp $ +# $NetBSD: tools.mk,v 1.47 2004/12/18 19:24:26 jlam Exp $ # # This Makefile creates a ${TOOLS_DIR} directory and populates the bin # subdir with tools that hide the ones outside of ${TOOLS_DIR}. @@ -391,6 +391,27 @@ ${TOOLS_DIR}/bin/make: fi .endif +# Always create a ${TOOLS_DIR}/bin/rpcgen to wrap the real rpcgen. +# The wrapper will correctly set the CPP environment variable to a +# stat((2)able path to a C preprocessor, then rely on the PATH to +# find and invoke the real rpcgen. +# +override-tools: ${TOOLS_DIR}/bin/rpcgen +.if !target(${TOOLS_DIR}/bin/rpcgen) +${TOOLS_DIR}/bin/rpcgen: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + ( ${ECHO} '#!${TOOLS_SHELL}'; \ + ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-${_TOOLS_WRAP_LOG}}"'; \ + ${ECHO} 'CPP="${WRAPPER_BINDIR}/cpp"; export CPP'; \ + PATH=`${ECHO} "${PATH}" | ${SED} -e "s,.*${.TARGET:H}:,,"`; \ + ${ECHO} "PATH=\"$$PATH\"; export PATH"; \ + ${ECHO} '${ECHO} "<.> rpcgen $$*" >> $$wrapperlog'; \ + ${ECHO} 'rpcgen "$$@"'; \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +.endif + .if defined(USE_TBL) && !empty(USE_TBL:M[yY][eE][sS]) . if exists(/usr/bin/tbl) _TOOLS_PROGNAME.tbl= /usr/bin/tbl |