Subject: Cross building on a host with a bad /bin/sh
To: None <>
From: Alan Barrett <>
List: tech-toolchain
Date: 09/11/2006 22:00:47
On Tue, 05 Sep 2006, Garrett D'Amore wrote:
> I've learned that if the following environment variables are set, I can
> bootstrap gcc4.  It would be nice if could detect this and set
> them up itself.  Here they are:
> CONFIG_SH=/usr/xpg4/bin/sh
> BSHELL=/usr/xpg4/bin/sh
> HOST_SH=/usr/xpg4/bin/sh
contains a patch for this and several other issues:

* tries to detect a suitable value for HOST_SH,
  and passes it to the rest of the build as all three of
* make accepts a new compile time flag (_BASENAME_DEFSHELL) to
  override the basename of the default shell.
* The configure script for the tools version of make passes the
* Many Makefiles and scripts under gnu/dist now use ${CONFIG_SHELL}
  to run move-if-change.
* Some other minor details.

I have successfully built an i386 system using these patches in
a chroot environment in which /bin/sh was replaced with a wrapper
that logged every time it was invoked; it was invoked only because
/usr/bin/true starts with "#!/bin/sh".

--apb (Alan Barrett)