[Buildroot] [PATCH next v2] package/luarocks: rework configuration file for per-package folders
thomas.petazzoni at bootlin.com
Wed Nov 21 07:46:39 UTC 2018
On Tue, 20 Nov 2018 23:11:28 +0100, Arnout Vandecappelle wrote:
> On 20/11/2018 14:01, Thomas Petazzoni wrote:
> > +LUAROCKS_RUN_ENV = \
> > + LUA_PATH="$(HOST_DIR)/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua" \
> > + STAGING_DIR="$(STAGING_DIR)" \
> > + TARGET_DIR="$(TARGET_DIR)" \
> These two are already exported in top-level Makefile, so it shouldn't be needed
> (note that when a variable is exported, it will get its value from the context
> where the shell is started, not from where the 'export' statement is put, so it
> does exactly what we need it to).
> > + TARGET_CC="$(TARGET_CC)" \
> > + TARGET_CFLAGS="$(LUAROCKS_CFLAGS)" \
> > + TARGET_LDFLAGS="$(TARGET_LDFLAGS)"
> For these three, I expect other package infras will need it as well, so it
> would make sense to export them too.
Generally speaking, I am not a big fan of things exported in the
environment. One thing I very often do when debugging build issues is
copy/paste the command line that Buildroot ran, to run it again on my
own, sometimes doing additional tweaks. When there's more and more
stuff "hidden" (i.e exported in the environment), it makes that more
and more difficult.
In addition, as you can see here, the TARGET_CFLAGS we use are *NOT*
the global TARGET_CFLAGS that Buildroot defines. It's LUAROCKS_CFLAGS,
which is TARGET_CFLAGS + a few additional luarocks specific CFLAGS.
So no, exporting TARGET_CFLAGS globally doesn't solve that particularly
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
More information about the buildroot