-*- Text -*-

How to Build the Hurd.

I:

  First you must have GCC and binutils installed.  We use GCC 2.6.2 and
  binutils 2.5.2 as of this writing.  You need to configure binutils and
  GCC for the i386-gnu target.  In order to build the GNU C library for the
  Hurd, you will need gawk installed.

  You should have a special area to hold installed Hurd libraries and
  include files used in building Hurd binaries.  In addition, you need a
  separate device for the Hurd root filesystem.  Decide where you want
  these now.  The cross compiler will look in
  $(prefix)/i386-gnu/{include,lib} (i.e. /usr/local/i386/{include,lib}) by
  default, so make those symbolic links to where you install the Hurd
  libraries.

  You should get MiG from the Utah mach4 distribution, and build it to
  cross compile.  Set MIG appropriately in Maketools (usually to
  "i386-gnu-mig").

II:

  Edit Makeconf as follows:

    Set $(hurdinst) to the place where you will put Hurd libraries 
    and include files.

    Set $(hurdroot) to the place you mount the Hurd root device when
    running Unix.  Set $(hurdrootdev) to the Unix pathname (probably in
    /dev) of this device.  The last component of $(hurdrootdev) *mus* be
    the Mach kernel name of the disk.

    Set $(hurdsource) to the directory holding the file you are reading
    (the root of the Hurd distribution directory).

    You should not need to change anything else in Makeconf.  If you
    find you do, please let me know.

  Edit Maketools as follows:

    Set $(tooldir) to the directory which holds GNU ar and ranlib 
    for .

    MiG does not support cross-compilation, so it must be run on the
    correct target.  Set $(mighost) to the name of some machine that
    you can rsh to in order to run MiG.  This host is also used for
    some minor stages in building the Hurd because there are some other
    programs that it is too much trouble to make work with
    cross-compilation (right now, anyway).

    If you are using a 386, you should not need to change CCTARGET.

    Set CCVERSION to the version of GCC you are using.

    Make sure that /usr/local/bin/mig exists on the machine you will
    do compilation on; if that machine is not a Mach machine of the 
    same type as the machine you will run the Hurd on, then you need
    to edit /usr/local/bin/mig to call rsh to $(mighost).  If you don't
    want to do this, then set $(MIG) to the commented out version
    in Maketools.

    You should not need to change anything else in Maketools.  If you
    find you do, please let me know.

  If at any point you find this procedure confusing, please let me
  know--I'd like to make it better.


III:

  MAKE VERY SURE that gcc, for all Hurd work, does not use a gcc include
  directory with fixincludes processed files.  Your special GCC include
  directory should have *only* GCC include files.  

  Install the version of MiG that comes with the Utah release of the
  Mach kernel. This fixes some important bugs as well as including a
  couple new features.

  Next, install the GNU C library.  It should be configured for
  i386-gnu (though the second name, `compaq') could be different.
  Make sure you also give the following flags to configure:
  `--with-mach=FOO --with-hurd=BAR --prefix=/home/hm1/hurdinst'.
  (Except, of course, that you should replace the last path there with
  whatever you set $(hurdinst) to; replace FOO with the Mach `kernel'
  source directory and BAR as the hurd source directory
  ($(hurdsource)).)  You should have the latest version from
  alpha.gnu.ai.mit.edu.

  Now you should be able to build the Hurd.  Type `make'.


IV:

  Installation must be done on the machine running Mach; only building
  works with a cross-compiler.  

  On the machine which is running Mach, mount $(hurdrootdev) onto
  $(hurdroot).  Type `make install'.  

  You will probably want other programs too.  Things from
  fileutils, shellutils, and textutils are handy to have around.  Configure
  them with `CC=i386-gnu-gcc configure --prefix='.  This will get some
  autoconf tests wrong, but it's harmless.  You can install the generated
  binaries in $(hurdroot)/bin.  They're quite large; you'll probably
  want to strip them.


V: 
  To run the Hurd, make sure that $(hurdrootdev) is not mounted.  Then
  run `boot UFS' where boot is built in step III (and found in .../hurd/boot) 
  and ufs is in the .../hurd/ufs directory.  This should start everything
  and land you in a shell.  Type ps.  Cool, huh?

  At this point things aren't quite perfect.  Set some translators, like this:

  `settrans /dev /hurd/dev'
  `settrans /servers/socket/1 /hurd/pipes'
  `ln /servers/socket/1 /servers/socket/pflocal'

  At this point, you will no longer be able to use the standard fsck.
  No problem: the Hurd's fsck will work.

  When you want to stop running the Hurd (say, to install something new
  on its disk), kill the auth server.  This will cleanly shut down
  the Hurd.
