summaryrefslogtreecommitdiff
path: root/mk/tools/rpcgen.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-04-15 00:00:21 +0000
committerjlam <jlam@pkgsrc.org>2005-04-15 00:00:21 +0000
commit32d92202818b9e0728a9cc8a52a0d5ef205638e0 (patch)
tree1a36dbd7b7cfce8f711a1bb2e377c2d827c3c663 /mk/tools/rpcgen.mk
parent8596ac419754becb5dffdc57d05347b4325f07e4 (diff)
downloadpkgsrc-32d92202818b9e0728a9cc8a52a0d5ef205638e0.tar.gz
Initial commit of the new tools framework. This is currently designed
to be a drop-in replacement for mk/tools.mk, but isn't yet enabled pending further testing. To use, edit bsd.pkg.mk to include bsd.tools.mk instead of tools.mk. The major changes from the old tools framework are: (1) The new interface to using the tools framework is through setting USE_TOOLS in the package Makefile, e.g., USE_TOOLS+= autoconf gmake yacc (2) Bison/yacc handling is improved. Instead of adding checks for /usr/bin/yacc to the package Makefile and explicitly setting YACC, e.g., security/mit-krb5/Makefile, simply add "yacc" to USE_TOOLS. If bison is explicitly required, then add "bison" to USE_TOOLS instead. (3) GNU auto* tools are handled differently. "autoconf", "aclocal", "automake", etc. will be tools in ${TOOLS_DIR} that point to the correct versions of the auto* tools. Instead of patching Makefiles or scripts to use ${AUTOCONF}, ${ACLOCAL}, etc., the correct versions of the tools will be called if they are invoked simply by their bare names. This is selected by adding either "autoconf" or "autoconf213", or "automake" or "automake14" to USE_TOOLS. The new tools framework will deprecate the following variables: ACLOCAL AUTORECONF AUTOCONF BUILD_USES_GETTEXT_M4 AUTOHEADER USE_GNU_TOOLS AUTOMAKE USE_TBL The new tools framework will deprecate the following *.mk files: mk/autoconf.mk mk/automake.mk mk/tools.mk Additional documentation on how to use bsd.tools.mk to create new tools under ${TOOLS_DIR} may be found in the header comments in bsd.tools.mk.
Diffstat (limited to 'mk/tools/rpcgen.mk')
-rw-r--r--mk/tools/rpcgen.mk36
1 files changed, 36 insertions, 0 deletions
diff --git a/mk/tools/rpcgen.mk b/mk/tools/rpcgen.mk
new file mode 100644
index 00000000000..37228484d2e
--- /dev/null
+++ b/mk/tools/rpcgen.mk
@@ -0,0 +1,36 @@
+# $NetBSD: rpcgen.mk,v 1.1 2005/04/15 00:00:21 jlam Exp $
+
+# Create an rpcgen script that correctly sets the CPP environment
+# variable to a stat(2)able path to a C preprocessor, then invokes
+# the real rpcgen.
+#
+.if !defined(TOOLS_REAL_CMD.rpcgen)
+TOOLS_EXECDIRS.rpcgen?= ${TOOLS_EXECDIRS}
+. for _d_ in ${TOOLS_EXECDIRS.rpcgen}
+. if exists(${_d_}/rpcgen)
+TOOLS_REAL_CMD.rpcgen?= ${_d_}/rpcgen
+. endif
+. endfor
+. undef _d_
+TOOLS_REAL_CMD.rpcgen?= ${FALSE}
+.endif
+TOOLS_CMD.rpcgen= ${TOOLS_DIR}/bin/rpcgen
+.if ${OPSYS} == "NetBSD"
+TOOLS_ARGS.rpcgen?= -b
+.endif
+RPCGEN?= rpcgen
+
+.if !target(${TOOLS_CMD.rpcgen})
+override-tools: ${TOOLS_CMD.rpcgen}
+${TOOLS_CMD.rpcgen}:
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ( ${ECHO} '#!'${TOOLS_SHELL:Q}; \
+ ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-'${_TOOLS_WRAP_LOG:Q}'}"'; \
+ ${ECHO} 'CPP='${WRAPPER_BINDIR:Q}'/cpp"; export CPP'; \
+ ${ECHO} '${ECHO} "[*] '${TOOLS_CMD.rpcgen:Q}' $$*" >> $$wrapperlog'; \
+ ${ECHO} '${ECHO} "<.> '${TOOLS_REAL_CMD.rpcgen:Q} ${TOOLS_ARGS.rpcgen:Q}' $$*" >> $$wrapperlog'; \
+ ${ECHO} ${TOOLS_REAL_CMD.rpcgen:Q} ${TOOLS_ARGS.rpcgen:Q} '"$$@"'; \
+ ) > ${.TARGET}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+.endif