This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.2 PATCH: Avoid hardcoded uses of pwd
Alexandre Oliva writes:
> On May 15, 2002, Mark Mitchell <mark@codesourcery.com> wrote:
>
> >> I could go with `PWDCMD = $${PWDCMD-pwd}' in Makefiles, though.
>
> > I'm happy to leave the shell magic -- and even the semantics -- to you. :-)
Unfortunately, this approach doesn't work as expected: this trivial
Makefile
PWDCMD = $${PWDCMD-pwd}
echo:
echo ${PWDCMD}
${PWDCMD}
without PWDCMD in the environment yields
echo ${PWDCMD-pwd}
pwd
${PWDCMD-pwd}
/amnt/zacatecas/users/d17/rbgstaff/ro
with PWDCMD='amq -w', I get this instead:
echo ${PWDCMD-pwd}
${PWDCMD-pwd}
${PWDCMD-pwd}
/bin/sh: ${PWDCMD-pwd}: not found
make: *** [echo] Error 1
i.e. PWDCMD remains in the environment, but is set to the literal value
from the Makefile ;-( (verified with truss -f -a -e).
I'm going for this variant instead:
PWD = $${PWDCMD-pwd}
echo:
echo ${PWD}
${PWD}
which works as expected. A full bootstrap is still in progress.
> Rainer, patch with changes to Makefiles as per the discussion above
> pre-approved.
Thanks. Once the bootstrap and make check have completed successfully,
I'll post the exact version checked in.
Rainer