Subject: Re: where to build ndiscvt?
To: Greg Troxel <gdt@ir.bbn.com>
From: Alan Ritter <ritter.alan@gmail.com>
List: tech-kern
Date: 04/20/2006 10:32:22
------=_Part_22345_3206821.1145554342525
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 4/20/06, Greg Troxel <gdt@ir.bbn.com> wrote:
> "Alan Ritter" <ritter.alan@gmail.com> writes:
>
> > Would this imply not including it in the distribution at all, but only
> > adding a src/tools/ndiscvt?
>
> No, it would be like make, and cc, tsort and zic, and all the other
> things in src/tools.  The program would be compiled normally and
> available in userland in addition to being available as a host tool.
>
> > ndiscvt will really only be used to build a new kernel, so I can see
> > the argument that it is a tool, but at the same time it will most
> > likely be run by hand instead of from an automated script. It might be
> > a bit teadeous for users who just want their laptop network card to
> > work to have to build a new toolchain.  But perhaps I'm
> > misunderstanding.
>
> I didn't mean to imply it should be host tool only, and not also
> normally built.
>
> I think that after putting ndiscvt someplace (presumably /usr/sbin)
> then all one needs to do is add a src/tools/ndiscvt/Makefile with a
> few lines in it.  This will make nbndiscvt in
> [TOOLDIR=3D/usr/obj/tools]/bin, in addition to /usr/sbin/ndiscvt
>
> Normal users won't use it as a host tool, just as a regular program.

OK, I think I'm starting to understand...

I just tried adding a src/tools/ndiscvt/Makefile, and added ndiscvt to
tools/Makefile, but there seems to be a slight problem compiling.

The following header file is included from sys/compat/ndis:

#include <compat/ndis/pe_var.h>

And this seems to cause a problem when building ndiscvt as a tool (it
can't find the header file).  Any idea on how this should be dealt
with?  Should pe_var.h be moved, or is there some way to pass a -I
flag to the compiler for ndiscvt (I've attached a copy of the makefile
I'm trying to use)?

#   compile  ndiscvt/ndiscvt.lo
cc -O -I/usr/src/../obj/tools/compat
-I/usr/src/../obj/tools/compat/include=20
-I/usr/src/tools/ndiscvt/../compat -DHAVE_NBTOOL_CONFIG_H=3D1=20
-D_FILE_OFFSET_BITS=3D64  -c -o ndiscvt.lo.o  =20
/usr/src/usr.sbin/ndiscvt/ndiscvt.c
/usr/src/usr.sbin/ndiscvt/ndiscvt.c:59:32: compat/ndis/pe_var.h: No
such file or directory

------=_Part_22345_3206821.1145554342525
Content-Type: application/octet-stream; name=Makefile
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="Makefile"

#	$NetBSD$

HOSTPROGNAME=	${_TOOL_PREFIX}ndiscvt
HOST_SRCDIR=	usr.sbin/ndiscvt

.include "${.CURDIR}/../Makefile.host"

.PATH: ${.CURDIR}/../../sys/compat/ndis

CFLAGS+=-I. -I${.CURDIR} -I${.CURDIR}/../../sys

------=_Part_22345_3206821.1145554342525--