Of course, if you're going to cross-compile Mach, you need the appropriate cross-development tools. See the section on cross-compilation below.
To learn more of the gory details of how the new build environment works, see the page on the build environment.
To configure the system, unpack the machine-independent and machine-dependent source trees (e.g. "mach4" and "mach4-i386") somewhere, create a separate object directory to build into, and run the configure script in the machine-dependent source tree from within the object directory. (Currently the object directories MUST be SEPARATE FROM the source directories.) If you're using a version of Mach4 earlier than UK02p21, then you'll have to specify the location of the machine-independent source tree on the configure command line with a "--with-mach4=DIR" option. Finally, type `make -r' or `make -r install' to build the kernel and optionally install it. (You don't actually have to use `-r', but GNU make runs faster if you do.) For example:
tar xvzf /tmp/mach4.tar.gz tar xvzf /tmp/mach4-i386.tar.gz mkdir obj cd obj ../mach4-i386/configure --with-mach4=../mach4 make -r make -r install
All installed files will go into directories named relative to the prefix you specify on the configure command line, or `/usr/local' by default, as per normal GNU conventions. If all goes well, an appropriate boot image should be created in the object directory, which you can use to boot Mach.
For machine-specific details on installing and booting Mach, see the following pages:
--enable-debug: Turns on various kernel debugging features, such as extensive sanity checks and (on the i386) the kernel debugger.
--enable-libmach: Enables generation of the CMU UX server-specific library libmach.a. Generally only needed in order to compile programs in the CMU USER distribution. Other Mach servers, such as those in Lites and the Hurd, only use the (more) personality-neutral standalone library libmach_sa.a.
With the new build environment you can easly cross compile Mach from a different architecture and/or OS. To cross compile from a different (non-Mach) OS but on the same processor architecture, you normally shouldn't have to do anything special; the "normal" procedure above is known to work on Linux anyway. If you have any problems, try the cross compilation procedure described below.
To cross compile from a different architecture, you will have to have all the standard cross-development tools built. In particular, Mach requires cross development versions of gcc, gas, ld, ar, and ranlib. You can get all these from prep.ai.mit.edu:/pub/{gcc-*,gas-*,binutils-*}. Just build and install them as the INSTALL files say to, using the `--target=' option to specify the target architecture and OS (e.g. `--target=i386-gnu'). It will probably be easiest if you install them in the same place your ordinary compiler is located: for example, use `--prefix=/usr' if gcc et al is in /usr/bin. As long as the new tools are configured for cross development, they will not overwrite the native tools that are already there, because they are given names prefixed with the target specification, e.g. `i386-gnu-gcc'.
Be sure to build and install gas and binutils before GCC. Even then, GCC may fail to compile completely because of missing header files (probably stdio.h). If it fails while trying to build libgcc2.a, then you've gotten far enough for the purposes of Mach - the compiler has already been built, and you can just `make install' at that point and go back to Mach.
To cross compile Mach itself, the only additional thing you need to do is tell the Mach build environment where to find the cross compilation tools. The normal GNU way to do this, I understand, is to specify the tools as variable overrides on the `make' command line; e.g. `make CC=i386-gnu-gcc LD=...' You can do it this way if you want; if you do, you'll need to set the variables CC, LD, AR, STRIP, and RANLIB.
However, with this Mach distribution, there's an easier way. If you specify a --target option on the command line when running Mach's configure script, (e.g. `--target=i386-gnu'), then the makefiles will automatically be set up with the default names of the development tools it uses prefixed with the target name (e.g. `i386-gnu-gcc' etc.). You can still override those defaults on the `make' command line, but it should not be necessary to if your tools are named according to the standard conventions and are in your path.
Note that the LILO boot configuration requires an as86 and ld86 to assemble. These are available on linux, but I do not know of any cross versions of these programs. (I haven't yet tried to compile them anywhere other then linux.) Therefore, if you want your kernel to be bootable with LILO, you must find a way to get bootsetup (in mach4-i386/boot) assembled and linked. A cross build that does not have the x86 tools available will simply fail to make LILO-compatible boot images for you; the resulting boot images will still boot from NetBSD or Mach boot blocks however.