[Buildroot] [PATCHv2] meson: add per package optional compiler/linker flags
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Sun Jun 23 10:36:14 UTC 2019
Hello Yann,
Thanks for respining. One question below.
On Sat, 22 Jun 2019 22:20:46 +0200
"Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:
Perhaps the commit should explain that as of today, Meson doesn't allow
to pass cflags/ldflags on the command line when a cross-compilation
file is used.
> Add LIBFOO_CFLAGS, LIBFOO_LDFLAGS and LIBFOO_CXXFLAGS variables to allow
> packages to provide their own flags, possibly overriding the generic
> ones entirely, like we allow for other infras.
>
> This means that the meson infra is the first and only infra for which
> FOO_CFLAGS, FOO_LDFLAGS, and FOOO_CXXFLAGS are meaningful, while for the
> other infras, they are just variable private to the package itself.
> Instead of naming those variables after the meson infra (e.g.
> LIBFOO_MESON_CFLAGS), we name them with a generic name, as mayb, just
mayb -> maybe
> maybe, we could also change the ither infras to also recognise those
ither -> other
> variables.
>
> To mimic this feature for packages that are bui9lt from the SDK, we also
built
> install a templatised version of cross-compilation.conf, with three new
> placeholders for custom flags. If a user wants to buidl a package that
build
> needs custom flags, they can use that template to generate a per-pacakge
package
> +* +FOO_CFLAGS+, to specify compiler arguments added to the package specific
> + +cross-compile.conf+ file +c_args+ property. By default, empty, so that
> + the global +TARGET_CFLAGS+ are used.
I find the wording "By default, empty, so that the global
+TARGET_CFLAGS+ are used" very confusing. Indeed, by default, those
variables are not empty, they are precisely defined to TARGET_CFLAGS.
For example, in the autotools infra documentation, we say:
* +LIBFOO_AUTORECONF+, tells whether the package should
be autoreconfigured or not (i.e. if the configure script and
Makefile.in files should be re-generated by re-running autoconf,
automake, libtool, etc.). Valid values are +YES+ and
+NO+. By default, the value is +NO+
So we just say that the default value is NO, not that it is empty and
that NO is used :)
For extra clarity, it could be rephrased like this:
When no value is specified by the package for this variable,
the value of +TARGET_CFLAGS+ will be used by the
+meson-package+ infrastructure.
If you agree with this change, I can fix that up when applying.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the buildroot
mailing list