configure bug in binutils 2.9.1 and egcs 1.0.3a on FreeBSD

Roland McGrath roland@marker.cs.utah.edu
Sat May 16 13:18:00 GMT 1998


I am using FreeBSD 2.2.6, and its sh is finnicky about test expressions.
This bug shows up on this platform when you configure either binutils 2.9.1
or egcs 1.0.3a and have something like CFLAGS=-g in the environment.

The manifestation is seeing `[: syntax error' messages mysteriously several
times throughout the configure run.  Using sh -x, I traced it to some
instances of `if [ -z "$CFLAGS" -a -r Makefile ]' and the like.  It so
happens that $CFLAGS is -g, and the FreeBSD sh gives an error for
`[ -z -g -a -r Makefile ]' and other such constructions like 
`[ -z -g -a -n foo ]' (though, oddly, not for `[ -z -g ]' alone).

The fix I would recommend to work around this is to replace uses of
-z and -n with = and != tests, as in `[ "x$CFLAGS" = x ]'.

Note that invoking configure with bash does not alleviate the problem,
because someplace in the bowels of configure sees fit to reinvoke itself
with `eval /bin/sh configure ...'.


Thanks,
Roland



More information about the Gcc-bugs mailing list