74e574c8a6
Meson does not allow to pass CFLAGS/LDFLAGS/CXXFLAGS via the environment or via command-line arguments or options (instead, those flags from the environment are passed to the host compiler, which is seldom what we need). The only way to pas those flags is via the cross-compilation.conf file. Add LIBFOO_CFLAGS, LIBFOO_LDFLAGS and LIBFOO_CXXFLAGS variables to allow packages to provide their own flags, possibly overriding the generic ones entirely, as we allow for other infras. Those per-package flags will then be used to generate the per-package cross-compilation.conf. This means that the meson infra is the first and only infra for which FOO_CFLAGS, FOO_LDFLAGS, and FOO_CXXFLAGS are meaningful, while for the other infras, they are just variables private to the package itself. Instead of naming those variables after the meson infra (e.g. FOO_MESON_CFLAGS), we name them with a generic name, as maybe, just maybe, we could also change the other infras to also recognise those variables. Just like for the HOST_MESON_SED_CFLAGS etc., we need to add auxiliary variables to do convert the shell-formatted argument list into the JSON-formatted list that meson expects. We can't use a pure-make construct because the CFLAGS can contain quoting that needs to be expanded by the shell. Similarly, we need a condition on the strip'ed variable to avoid passing empty arguments. To mimic this feature for packages that are built from the SDK, we also install a templatised version of cross-compilation.conf, with three new placeholders for custom flags. If a user wants to build a package that needs custom flags, they can use that template to generate a per-package cross-compilation.conf. Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> |
||
---|---|---|
.. | ||
adding-board-support.txt | ||
adding-packages-asciidoc.txt | ||
adding-packages-autotools.txt | ||
adding-packages-cargo.txt | ||
adding-packages-cmake.txt | ||
adding-packages-conclusion.txt | ||
adding-packages-directory.txt | ||
adding-packages-generic.txt | ||
adding-packages-gettext.txt | ||
adding-packages-golang.txt | ||
adding-packages-hooks.txt | ||
adding-packages-kconfig.txt | ||
adding-packages-kernel-module.txt | ||
adding-packages-linux-kernel-spec-infra.txt | ||
adding-packages-luarocks.txt | ||
adding-packages-meson.txt | ||
adding-packages-perl.txt | ||
adding-packages-python.txt | ||
adding-packages-rebar.txt | ||
adding-packages-tips.txt | ||
adding-packages-virtual.txt | ||
adding-packages-waf.txt | ||
adding-packages.txt | ||
advanced.txt | ||
appendix.txt | ||
beyond-buildroot.txt | ||
ccache-support.txt | ||
common-usage.txt | ||
configure-other-components.txt | ||
configure.txt | ||
contribute.txt | ||
customize-configuration.txt | ||
customize-device-permission-tables.txt | ||
customize-directory-structure.txt | ||
customize-outside-br.txt | ||
customize-packages.txt | ||
customize-patches.txt | ||
customize-post-image.txt | ||
customize-quick-guide.txt | ||
customize-rootfs.txt | ||
customize-users-tables.txt | ||
customize.txt | ||
debugging-buildroot.txt | ||
developers.txt | ||
download-infra.txt | ||
download-location.txt | ||
eclipse-integration.txt | ||
faq-troubleshooting.txt | ||
getting.txt | ||
how-buildroot-works.txt | ||
introduction.txt | ||
known-issues.txt | ||
legal-notice.txt | ||
make-tips.txt | ||
makedev-syntax.txt | ||
makeusers-syntax.txt | ||
manual.mk | ||
manual.txt | ||
migrating.txt | ||
package-make-target.txt | ||
patch-policy.txt | ||
prerequisite.txt | ||
quickstart.txt | ||
rebuilding-packages.txt | ||
resources.txt | ||
using-buildroot-debugger.txt | ||
using-buildroot-development.txt | ||
using-buildroot-toolchain.txt | ||
writing-rules.txt |