Change how the build system handles packages

This makes the build system a little simpler, and in particular
will make it easier to handle the changes needed for cross-compilation.
Remove some unused variables
Rename $(Windows) to $(Windows_Host)
Fix when terminfo is built; fixes #7700

We now use the 'host' to determine whether stage0 builds terminfo,
and 'target' to determine whether stage1 does.

We don't build it if the platform is either Windows or ios.
Fix haddocking after the build system changes