[Buildroot] [PATCH v2, 1/1] package/brltty: fix build with expat
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Fri Oct 18 08:15:04 UTC 2019
On Thu, 17 Oct 2019 20:22:13 +0200
"Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:
> > for variable in CC CFLAGS CXX CXXFLAGS LDFLAGS LDLIBS
> > do
> > unset "${variable}"
> > variableForBuild="${variable}_FOR_BUILD"
> > eval test '"${'"${variableForBuild}"'+set}"' != "set" || eval "${variable}"'="${'"${variableForBuild}"'}"'
> > done
> >
> > "${sourceRoot}/configure" \
> > --disable-api \
> > --disable-gpm \
> > --disable-iconv \
> > --disable-icu \
> >
> > The issue is that for some reason the magic "eval" stuff doesn't do its
> > job. Indeed, if I change the ${sourceRoot}/configure invocation to:
> >
> > CC=${CC_FOR_BUILD} \
> > CFLAGS=${CFLAGS_FOR_BUILD} \
> > CXX=${CXX_FOR_BUILD} \
> > CXXFLAGS=${CXXFLAGS_FOR_BUILD} \
> > LDFLAGS=${LDFLAGS_FOR_BUILD} \
> > LDLIBS=${LDLIBS_FOR_BUILD} \
> > "${sourceRoot}/configure" \
> > --disable-api \
> > --disable-gpm \
> [--SNIP--]
> > Perhaps Yann can shed some light as to why the magic eval stuff doesn't
> > behave like it should.
>
> The difference I can spot is that in the first case, the 'unset' will
> cause the variables to be unset *and* unexported. Then the variables are
> (maybe) properly set by the eval, but they are not exported, and so are
> just not in the environment, and thus the sub-configure does not get
> them.
Ah, so:
eval test '"${'"${variableForBuild}"'+set}"' != "set" || eval "${variable}"'="${'"${variableForBuild}"'}"'
should be changed to:
eval test '"${'"${variableForBuild}"'+set}"' != "set" || eval export "${variable}"'="${'"${variableForBuild}"'}"'
?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the buildroot
mailing list