[Ultrix V4.3] Use SHELL=/bin/sh5

Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Fri Dec 18 13:19:00 GMT 1998


I tried to bootstrap egcs 1.1.1 on MIPS Ultrix V4.3.  This failed initially
due to the broken Ultrix /bin/sh: /bin/sh's builtin test mishandles (among
others) the following construct:

if [ -f no-such-file ]; then echo no; fi

sets the exit status to 1, causing a failure in gcc/Makefile's initial test
for lang-f77 (before the first touch of that file).  While one could
possibly `fix' the Makefile to ignore the return code in such tests, the
proper solution on Ultrix is to use /bin/sh5 instead, which is generally
bug-free and much faster than /bin/sh.

I tried several different ways to do this properly, but failed in different
ways: 

1. Setting SHELL in the toplevel config/mh-decstation doesn't work, since
   the toplevel (Cygnus) configure explicitly substitutes SHELL by
   ${CONFIG_SHELL-/bin/sh}.

2. CONFIG_SHELL in config/mh-decstation is ignored too.

3. Setting CONFIG_SHELL in the toplevel configure environment passes the
   SHELL setting down to the subdirectory Makefiles, but the same failure
   as before happens.

   I could trace this down to the fact that many inferior make's in
   gcc/Makefile don't pass FLAGS_TO_PASS (which contains the SHELL=/bin/sh5
   setting) to sub-makes.  This is quite confusing.  I'm not sure if it's
   possible to simply include those in every $(MAKE) invocation, but doubt
   it because those sub-make invocation explicitly pass many variables.
   Could one substitue all those by FLAGS_TO_PASS?

4. I finally settled on setting SHELL in gcc/config/mips/x-ultrix instead,
   which isn't entirely correct because it doesn't handle all the other
   toplevel directories, but a least it got me going.

Fri Dec 18 21:09:23 1998  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config/mips/x-ultrix (SHELL): Set to /bin/sh5 to work around
	broken /bin/sh.

===================================================================
RCS file: gcc/config/mips/RCS/x-ultrix,v
retrieving revision 1.1
diff -up -r1.1 gcc/config/mips/x-ultrix
/vol/gnu/bin/diff: conflicting specifications of output style
*** gcc/config/mips/x-ultrix	1997/08/11 15:57:35	1.1
--- gcc/config/mips/x-ultrix	1998/12/12 01:29:21
***************
*** 1,3 ****
--- 1,8 ----
+ # avoid broken /bin/sh: 
+ #	if [ -f no-such-file ]; then echo no; fi
+ # yields exit status 1, while /bin/sh5 is ok
+ SHELL = /bin/sh5
+ 
  # Define CC and OLDCC as the same, so that the tests:
  #	if [ x"$(OLDCC)" = x"$(CC)" ] ...
  #

-----------------------------------------------------------------------------
Rainer Orth, Technical Faculty, University of Bielefeld

Internet: ro@TechFak.Uni-Bielefeld.DE




More information about the Gcc-patches mailing list