[patch] to libstdc++-v3: fix for the Bourne shell

Zack Weinberg zackw@stanford.edu
Thu Jan 25 22:24:00 GMT 2001


On Thu, Jan 25, 2001 at 09:54:30PM -0800, Michael Sokolov wrote:
> Hi there,
> 
> There is a Bourne shell portability bug in libstdc++-v3's configure
> (acinclude.m4 actually). The GLIBCPP_CHECK_GNU_MAKE macro uses ${MAKE:-make}.
> This is not supported by the Bourne shell and prevents libstdc++-v3 from
> building on UNIX. The patch below changes it to the standard Bourne shell
> ${MAKE-make}.

It is worth pointing out here that ${MAKE:-make} and ${MAKE-make} are
*not* the same thing.  Your description makes it sound like they are.

Paraphrase of bash man page:

       ${parameter:-word}
              Use Default Values.  If parameter is unset or null,
              the expansion of word is  substituted.   Otherwise,
              the value of parameter is substituted.

              If the colon is omitted, bash checks only for a
              parameter which is unset.

Your suggested change therefore introduces a bug: if the configure
script is run with MAKE set to the empty string, it will choke.  A
precisely equivalent change would be to change ${MAKE:-make} to $MAKE,
and insert

if test -z "$MAKE"; then MAKE=make; fi

before all uses of $MAKE.  [This bug is extremely unlikely to trigger
in the real world, and the libstdc++3 maintainers may feel that using
${MAKE-make} is easier to comprehend.]

I would also like to remind you that there is no unique "UNIX" nor is
there any unique "Bourne shell."  The ${MAKE:-make} construct is not
supported by the incarnation of the Bourne shell which shipped with
the incarnation of Unix you are using (4.2 or 4.3 BSD, I forget
which).  Please use more precise phrasing in the future.

zw
in a nitpicky mood this evening


More information about the Gcc-patches mailing list