When the port is up and running, compiling the kernel will be done from within BSD. Until then, however, a cross-compiling environment will have to be setup on another UNIX platform. It is important that the machine and the operating system be as similar to the target machine and BSD as possible to avoid problems such as different CPU endianess (ordering of bytes in a word), include file discrepancies ( e.g., the macros in ctype.h are often implemented differently), and object file format differences.
The BSD project uses an enhanced make called pmake. Among other things, it allows makefiles to include other makefiles, a heavily-used feature throughout the system. It is the only program in the system that can be compiled with regular make, so it should be built first. The following tools should then be compiled: gcc, as, ld, ar, ranlib, and size.
One possible problem when compiling the development tools is that the native include files and libraries will be used with BSD sources. This may not only cause compilation errors, in which case a few BSD include files may have to be substituted for the native ones, but some library routines may have a different behavior or implementation. For example, the chmod() call on our cross-development platform interpreted its parameters differently than the BSD programs expected, so all of the files that the BSD linker generated had only execute permission instead of read and write permissions.
Since the UNIX used for cross-development is likely to already have tools with the above names, it will be useful to write a script that allows you to switch between using the native and the BSD executables. The script should also switch between the native and BSD include files and libraries. Alternatively, the BSD utilities could be renamed and the BSD makefiles and paths updated accordingly.