README.mknative revision 1.4
11.4Suwe$NetBSD: README.mknative,v 1.4 2006/11/23 23:33:56 uwe Exp $
21.1Snathanw
31.1SnathanwThis file describes how to use the cross-compiler to generate the
41.1Snathanwnative files for GDB on a target platform.
51.1Snathanw
61.1SnathanwNOTE:  DO NOT RUN "mknative" BY HAND!  It requires the Makefile in this
71.1Snathanwdirectory to set up certain environments first.
81.1Snathanw
91.1SnathanwSince libc's features change over time, the config.h files can change as a
101.1Snathanwresult; thus the instructions below are the same no matter whether
111.1Snathanwbootstrapping on a cross or native host.  This is important: even on a
121.1Snathanw"native" host, you should bootstrap the toolchain by building from an
131.1Snathanwup-to-date source tree to a $DESTDIR using the exact same instructions.
141.1Snathanw
151.1SnathanwIn these notes, MACHINE is the $MACHINE of the target.  These files can be
161.1Snathanwcross-generated.  Though a $MACHINE_ARCH all uses the same config files, you
171.1Snathanwmust pick a specific $MACHINE so that building the requisite bits below will
181.1Snathanwwork.
191.1Snathanw
201.1Snathanw1. Set MKMAINTAINERTOOLS=yes in mk.conf.  (Needed so that src/tools/gettext
211.1Snathanw   gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.)
221.1Snathanw
231.1Snathanw2. Build and install a cross toolchain (via "build.sh -m MACHINE tools").
241.1Snathanw
251.1Snathanw3. At top level, do "nbmake-MACHINE do-distrib-dirs obj includes".
261.1Snathanw
271.2Smrg4. In src/gnu/lib/crtstuff4 do "nbmake-MACHINE depend all install"
281.1Snathanw
291.3Suwe5. In src/lib/csu, src/gnu/lib/libgcc4, and src/lib, do
301.3Suwe   "nbmake-MACHINE all install".
311.1Snathanw
321.1Snathanw6. In src/tools/gdb, do "nbmake-MACHINE obj native-gdb".
331.1Snathanw
341.1Snathanw   This will do a full configury in ${.OBJDIR}/.native that is a "Canadian"
351.1Snathanw   cross toolchain (--build reflects the host platform, but --host and
361.1Snathanw   --target are the target).  The result is a tree that would build a
371.1Snathanw   native-to-NetBSD GDB on a cross host, and mknative pulls glue data
381.1Snathanw   from this.
391.1Snathanw
401.4Suwe   NOTE: this step writes files under src/gnu/usr.bin/gdb6, so you
411.4Suwe   need to do it in a writable src tree!
421.4Suwe
431.1Snathanw7. Try out a full build using "nbmake-MACHINE" in
441.1Snathanw   src/gnu/usr.bin/gdb6; the result should include a native GDB.
451.1Snathanw
461.1Snathanw8. If all is well, commit the glue files and directories added to
471.1Snathanw   src/gnu/usr.bin/gdb6.
48