Subject: bin/706: kdump doesn't build a full ioctl.c
To: None <gnats-admin@NetBSD.ORG>
From: matthew green <mrg@splode.mame.mu.OZ.AU>
List: netbsd-bugs
Date: 01/06/1995 19:20:14
>Number:         706
>Category:       bin
>Synopsis:       kdump doesn't build a full ioctl.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan  6 19:20:12 1995
>Originator:     matthew green
>Organization:
bozotic softwar foundation.
>Release:        6-jan-95
>Environment:
	
System: NetBSD splode.mame.mu.OZ.AU 1.0A NetBSD 1.0A (_splode_) #112: Fri Jan 6 22:48:01 EST 1995 mrg@splode.mame.mu.OZ.AU:/splode/build/src/sys/arch/sparc/compile/_splode_ sparc


>Description:

	when kdump builds it just called awk directly on sys/ioctl{_compat,}.h
	directly without using cpp on it to get all the #include'ed files as
	well.  this results in a very very short ioctl.c that's relatively
	useless.

>How-To-Repeat:

	cd /usr/src/usr.bin/kdump; make

	and then view ioctl.c

>Fix:

	using gcc -dM option to cpp, we get at all the #define's.


Index: Makefile
===================================================================
RCS file: /local/cvs/src/usr.bin/kdump/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** 1.1.1.1	1995/01/06 23:24:23
--- Makefile	1995/01/06 23:32:07
***************
*** 6,12 ****
  CFLAGS+=-I${.CURDIR}/../ktrace
  SRCS=	kdump.c ioctl.c subr.c
  .PATH:	${.CURDIR}/../ktrace
! CLEANFILES+=ioctl.c
  
  ioctl.c: mkioctls
  	/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include/sys/ioctl.h \
--- 6,12 ----
  CFLAGS+=-I${.CURDIR}/../ktrace
  SRCS=	kdump.c ioctl.c subr.c
  .PATH:	${.CURDIR}/../ktrace
! CLEANFILES+=ioctl.c mkioctl.c
  
  ioctl.c: mkioctls
  	/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include/sys/ioctl.h \
Index: mkioctls
===================================================================
RCS file: /local/cvs/src/usr.bin/kdump/mkioctls,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 mkioctls
*** 1.1.1.1	1995/01/06 23:24:24
--- mkioctls	1995/01/06 23:31:14
***************
*** 1,6 ****
  #	$Id: mkioctls,v 1.4 1994/12/24 16:47:28 cgd Exp $
  #
! awk '
  BEGIN {
  	print "#include <sys/param.h>"
  	print "#include <sys/socket.h>"
--- 1,14 ----
  #	$Id: mkioctls,v 1.4 1994/12/24 16:47:28 cgd Exp $
  #
! 
! >mkioctl.c
! 
! for file
! do
! 	echo "#include <$file>" >> mkioctl.c
! done
! 
! cpp -dM mkioctl.c | awk '
  BEGIN {
  	print "#include <sys/param.h>"
  	print "#include <sys/socket.h>"
***************
*** 33,36 ****
  	print "\n\treturn(NULL);"
  	print "}"
  }
! ' $1 $2
--- 41,44 ----
  	print "\n\treturn(NULL);"
  	print "}"
  }
! '
>Audit-Trail:
>Unformatted: