Subject: Re: build just /usr/bin/iconv
To: None <netbsd-help@NetBSD.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-help
Date: 04/24/2005 08:08:15
"James K. Lowden" <jklowden@schemamania.org> writes:

> Then I thought, I can be a boy scout and fix it, so I'm pulled
> /usr/src/usr.bin from CVS.  "cd src/usr.bin/iconv/ && make" works. 
> Everything seems OK.  
> 
> My question is, do I have to build the whole thing first?  I don't want
> to, because I'd rather not check out the branch I'm using.  I'd rather try
> to build only /usr/bin/iconv from current sources on my netbsd-2-0-RELEASE
> box.  

Strictly speaking, you should use a -current toolchain to build
-current sources.  If you have all of the -current sources, you can
first use build.sh to build tools, and then use those tools to build
libc (if you change src/lib/libc/iconv/*) and /usr/bin/iconv.

I would use something like

(let WHEREFLAGS be:)
 -T /usr/obj/current/tools
 -O /usr/obj/current/i386
 -D /usr/obj/current/i386/destdir
 -R /usr/obj/current/releasedir

to keep the current build bits clearly separate from any 2.0 build you
might do.   Then

  ./build.sh WHEREFLAGS -u tools

should get you a toolchain.  Assuming i386, symlink
  /usr/obj/current/tools/bin/nbmake-386
to
  ~/bin/nbmake-i386-current
(or someplace in your path)

Then, you can go to directories and build/install then with the above
make script, which sets all the right paths.

But, your destdir is empty, and thus includes, libs etc. are missing.
So really the easiest thing to do is build all of current first - just
run build.sh with distribution instead of tools.  Then, you can
build/rebuild individual directories easily.  Note that

  nbmake-i386 install

will install into DESTDIR, set above.  To install a single directory's
build into the running system

  nbmake-i386 DESTDIR=/ install

But, installing current libc onto a 2.0 system is a bad move; the
generic rule is to update the kernel before userland.  In this case, I
think you'll immediately lose because the new libc uses statvfs (at
least I did on a 2.0->2.99.15 transition when I was trying to skip
steps).




-- 
        Greg Troxel <gdt@ir.bbn.com>