summaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* meson: map powerpc64 TARGET_ARCH to ppc64 for the cross fileVictor Kamensky2018-10-291-0/+2
| | | | | | | | | | Meson uses 'ppc64' for 64 bit powerpc. Issue came up while building systemd for MACHINE that uses ppc64e5500 tune. (From OE-Core rev: eccd5414c37be26df63a90154c1808f6f5618b7d) Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: Fix build issues with /tmp mounted with noexecMark Asselstine2018-10-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit d297f7ebf3f6 [fribidi: use Meson instead of autotools] build failures have been observed with this package. The immediate issue was related to improperly named #defines per https://github.com/fribidi/fribidi/commit/46f52d588ab5, however, the root cause was FRIBIDI_SIZEOF_INT getting a value of "-1". After searching the meson logs the following was found: Could not run: /tmp/tmp2fxe6ha1/output.exe (error: [Errno 13] Permission denied) Checking for size of "int": -1 Which pointed to the real root cause being /tmp mounted with noexec, a common configuration on Redhat and other distros. This issues has been raised in the meson community: https://github.com/mesonbuild/meson/issues/2972 but is yet to be addressed. Using the discussion from issue#2972 and the fact that the underlying code makes use of python 'tempfile' we can simply create a 'tmp' directory and make use of TMPDIR to avoid this issue. (From OE-Core rev: 9800daf59d2235bc492d1aeb600e46ad62303510) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: stop Meson using target CFLAGS in native buildsRoss Burton2018-09-251-5/+10
| | | | | | | | | | | | | | | | With the goal of autoconf-compatibility Meson respects $CFLAGS et al in builds. In cross-compiled build the cross file is the one true source of flags and the environment isn't used, but in a native build the environment will still be respected. As this can lead to target flags being used in the build for native binaries (including a single native binary inside a target recipe), export CFLAGS=${BUILD_CFLAGS) et al. (From OE-Core rev: 4ca0002860dca771836c0ce1c7a92b79a5f2db3f) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: pass correct endian in the cross fileRoss Burton2018-09-251-7/+13
| | | | | | | | | | | | Meson doesn't care for the value of the endian field, but packages may want to use it and Meson master now validates the value. Use siteinfo to obtain the endianism and write the correct value. (From OE-Core rev: 2f9adf05efdddf8dae9c58976ae56cf32d9e57f0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: don't dump full error log on failureRoss Burton2018-08-021-1/+0
| | | | | | | | | | | If the configure fails then we don't really want to see hundreds of lines of test output (this would be similar to dumping out autoconf's config.log). The error includes the path of the full log if further debugging is required. (From OE-Core rev: 09917f582aa1a7b752fa96303e06f9f4712a1d86) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: improve code styleRoss Burton2018-07-101-1/+1
| | | | | | | | | Use elif for consistency. (From OE-Core rev: 2ad89f12c9819326b29588a8a6c642aaae990f18) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: map mipsel TARGET_ARCH to mips for the cross fileRoss Burton2018-07-061-0/+2
| | | | | | | | | | Meson uses 'mips' for both big- and little-endian MIPS machines, so map mipsel to mips. (From OE-Core rev: 23734432a24da77aa838ad4bdcbcc294cde08348) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: map architecture to correct values in cross fileRoss Burton2018-07-051-2/+14
| | | | | | | | | | | | | The cross file specifies the host/target cpu_family, which should be one of a defined set of values[1] but if it isn't Meson won't complain and instead recipes may behave unexpectedly. [1] http://mesonbuild.com/Reference-tables.html#cpu-families (From OE-Core rev: e33b902a1dc4294dac148715f4d3ca5b0a6ee1b7) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: various class improvementsRoss Burton2018-07-051-3/+4
| | | | | | | | | | | | | - Ensure that the PACKAGECONFIG arguments are always in EXTRA_OEMESON - Log the arguments that are being passed in do_configure. - Do verbose builds so the compile logs are useful for debugging build problems (From OE-Core rev: 3112ff268d095a65ecb893dd6ca88a85b0f70446) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: only use lists of commands in cross file if requiredRoss Burton2018-06-181-12/+13
| | | | | | | | | | | | | | | | There's a bug in Meson[1] where it find_program("foo") will fail if foo is defined in the cross file as a list. This is causing the Meson build of libdrm to fail, but for this instance we can work around the problem by only using lists in the cross file if there are arguments, and just using a string if there are not. [1] https://github.com/mesonbuild/meson/issues/3737 (From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: refactor native overrideMartin Kelly2018-06-041-10/+7
| | | | | | | | | | The native override is specified in two different places, so let's move it into a function to reduce code duplication. (From OE-Core rev: c455ec4a12d4966524da9436722476aa2d428765) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: fix to build for more projectsChen Qi2018-03-061-12/+8
| | | | | | | | | | | | | | | | | We should use the value of CC for the c compiler setting in cross compilation configuration file for meson. For example, if we only use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following do_compile failure for systemd. cc1: fatal error: linux/capability.h: No such file or directory Do the same change for LD, AR, NM, STRIP and READELF. (From OE-Core rev: 177bd96a531fcc85e62baff04aba327e2bccee07) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: Add support for nativesdkPeter Kjellerstedt2018-02-241-0/+13
| | | | | | | | | | | | We need to use the meson.cross file when building for nativesdk. Additionally, we need to trick meson's sanity tests, just as it is done for target builds. (From OE-Core rev: abcb330c462c2c06d36f8f3681a6bd07d562c1fe) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: Adjust for clang compilerKhem Raj2018-01-291-2/+7
| | | | | | | | | | | | Remove hardcoding c/c++ compiler to be gcc alone, its possible to use clang as replacement for cross compilers from meta-clang, therefore set clang/clang++ if TOOLCHAIN = "clang" (From OE-Core rev: 05789489d25a5ceac0403613ad789d78198be6ee) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: add MESON_LINK_ARGS to vardepsMartin Kelly2018-01-191-1/+1
| | | | | | | | | | | | | | | | Currently, we include MESON_C_ARGS in write_config[vardeps], but we don't include MESON_LINK_ARGS, which also affects meson.cross. In addition, we include TOOLCHAIN_OPTIONS, from which both are derived. Add MESON_LINK_ARGS, and remove TOOLCHAIN_OPTIONS, which does not directly appear in meson.cross and should be pulled in indirectly by MESON_C_ARGS and MESON_LINK_ARGS. (From OE-Core rev: 4db37cc8d9139076682e2528d29e92fad2eb1c90) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: include C{, XX}FLAGS in cross argsMartin Kelly2018-01-191-4/+6
| | | | | | | | | | | | | | | | | | Currently, CFLAGS and CXXFLAGS are not making it into the compile line. This is because meson appends CFLAGS/CXXFLAGS from the environment only for native but not for cross builds (probably to keep cross-builds more isolated). As a result, we need to make sure these vars goes into meson.cross. This is similar to what cmake.bbclass does with OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS. Change c_args and cpp_args in meson.cross to include these vars, and update write_config[vardeps] accordingly. (From OE-Core rev: f435d1b75d3775f6ec0df6027766008b40209fd7) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: compile with --buildtype plainMartin Kelly2018-01-191-0/+1
| | | | | | | | | | | | | | | OE manages all the compile flags, so we don't want meson to inject its own flags. Currently, it's injecting -O0 and causing build breaks when security flags are enabled (because _FORTIFY_SOURCE requires an optimized build and meson defaults to a debug -O0 build). Add --buildtype plain so meson will not add its own optimization flags. (From OE-Core rev: 73ff85986d82c8da601d7c7cf9a02961f2f66a09) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: use HOST_CC_ARCH, not TARGET_CC_ARCHChristopher Larson2018-01-131-1/+1
| | | | | | | | | | Using TARGET_CC_ARCH is inconsistent with CC, which uses HOST_CC_ARCH, and the rest of meson.bbclass, which uses HOST_PREFIX, HOST_OS, etc. (From OE-Core rev: 8a61e0c0c53275ebc623296f46676d920b11eb3b) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: export native env only for native buildMartin Kelly2018-01-051-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the meson crossfile should take care of setting the right cross environment for a target build, meson slurps any set CFLAGS, CXXFLAGS, LDFLAGS, and CPPFLAGS from the environment and injects them into the build (see mesonbuild/environment.py:get_args_from_envvars for details). This means that we are seeing native CFLAGS, CXXFLAGS, LDFLAGS, and CPPFLAGS in the target build, which is wrong and causes build failures when target and native have libraries in common (the linker gets confused and bails). That said, we *do* need to set certain vars for all builds so that meson can find the right build tools. Without this, meson will fail during its sanity checking step because it will determine the build tools to be unrunnable since they output target instead of native artifacts. The solution to all of this is to set CC, CXX, LD, and AR globally to the native tools while setting the other native vars *only* for the native build. For target builds, these vars will get overridden by the cross file as we expect. (From OE-Core rev: de7ae028c65a978969b2e06fdc1a2d08bc141a5b) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson: add a recipe and class from meta-oeAlexander Kanavin2018-01-051-0/+108
The original recipe has been provided and improved by: Ross Burton <ross.burton@intel.com> Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Adam C. Foltzer <acfoltzer@galois.com> Peter Kjellerstedt <peter.kjellerstedt@axis.com> Linus Svensson <linussn@axis.com> I have added patches to fix up gtk-doc and gobject-introspection in cross-compilation environments, and also change the order of linker arguments to replicate autotools more closely (and fix linking errors in some corner cases). (From OE-Core rev: 1f8dea686cdfd6d360ba4a97f62d274c39eaeb8e) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>