From fb3e326ed2daf329c1d678446cdab87bb3d780dd Mon Sep 17 00:00:00 2001 From: cgd Date: Tue, 16 Jan 2001 02:46:25 +0000 Subject: [PATCH] Pass CPP and CPPFLAGS to makerrnos.sh, and use them. Default to cpp and empty, respectively, if not provided. --- usr.bin/ktruss/Makefile | 4 ++-- usr.bin/ktruss/makeerrnos.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.bin/ktruss/Makefile b/usr.bin/ktruss/Makefile index 90fc49698078..c7e5497ed953 100644 --- a/usr.bin/ktruss/Makefile +++ b/usr.bin/ktruss/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2001/01/11 14:25:27 enami Exp $ +# $NetBSD: Makefile,v 1.10 2001/01/16 02:46:25 cgd Exp $ PROG= ktruss SRCS= ktrace.c dump.c subr.c ioctl.c misc.c setemul.c @@ -11,7 +11,7 @@ WFORMAT=1 dump.c misc.c: misc.h misc.h: ${DESTDIR}/usr/include/sys/errno.h \ ${DESTDIR}/usr/include/sys/signal.h - ${.CURDIR}/makeerrnos.sh \ + CPP=${CPP:Q} CPPFLAGS=${CPPFLAGS:Q} ${.CURDIR}/makeerrnos.sh \ ${DESTDIR}/usr/include/sys/errno.h \ ${DESTDIR}/usr/include/sys/signal.h misc diff --git a/usr.bin/ktruss/makeerrnos.sh b/usr.bin/ktruss/makeerrnos.sh index 227fe2a74323..bdd8fdf24313 100755 --- a/usr.bin/ktruss/makeerrnos.sh +++ b/usr.bin/ktruss/makeerrnos.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: makeerrnos.sh,v 1.1 1999/07/12 04:13:34 mrg Exp $ +# $NetBSD: makeerrnos.sh,v 1.2 2001/01/16 02:46:25 cgd Exp $ if [ $# -ne 3 ]; then echo "usage: makeerrnos.sh errno.h signal.h output" @@ -12,12 +12,15 @@ SIGNALH=$2 CFILE=$3.c HFILE=$3.h +: ${CPP:=cpp} +: ${CPPFLAGS:=} + cat <<__EOF__ > $CFILE #include "misc.h" struct systab errnos[] = { __EOF__ -cat ${DESTDIR}/usr/include/sys/errno.h | cpp -dM | +cat ${DESTDIR}/usr/include/sys/errno.h | ${CPP} ${CPPFLAGS} -dM | awk ' /^#[ ]*define[ ]*E[A-Z0-9]*[ ]*[0-9-][0-9]*[ ]*.*/ { for (i = 1; i <= NF; i++) @@ -41,7 +44,7 @@ cat <<__EOF__ >> $CFILE struct systab signals[] = { __EOF__ -cat ${DESTDIR}/usr/include/sys/signal.h | cpp -dM | +cat ${DESTDIR}/usr/include/sys/signal.h | ${CPP} ${CPPFLAGS} -dM | awk ' /^#[ ]*define[ ]*S[A-Z0-9]*[ ]*[0-9-][0-9]*[ ]*.*/ { for (i = 1; i <= NF; i++)