diff options
author | Ross Burton <ross.burton@intel.com> | 2019-01-04 00:13:56 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-08 11:16:44 +0000 |
commit | 3bda6b8e0aa2656818e36a95e32252dc0e434105 (patch) | |
tree | 22b4ba76526d710b7ed47c515702de958763a16f /meta | |
parent | 3085647e0cff533aa9d03b2184b8b4bf25ce9002 (diff) | |
download | poky-3bda6b8e0aa2656818e36a95e32252dc0e434105.tar.gz |
meson: use a sensible default for libdir when cross-compiling
If --libdir isn't passed to Meson a default is used, but as this default value
changes depending on the host (whether it is Debian-like, or has /usr/lib64)
this isn't appropriate for cross builds.
(From OE-Core rev: fdb5a8b3d437537aee53380091dabe6258667a49)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/meson/meson.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/meson/meson/cross-libdir.patch | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc index ef8c5aefa5..d37afc3b0d 100644 --- a/meta/recipes-devtools/meson/meson.inc +++ b/meta/recipes-devtools/meson/meson.inc | |||
@@ -11,6 +11,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P | |||
11 | file://0003-native_bindir.patch \ | 11 | file://0003-native_bindir.patch \ |
12 | file://0001-python-module-do-not-manipulate-the-environment-when.patch \ | 12 | file://0001-python-module-do-not-manipulate-the-environment-when.patch \ |
13 | file://disable-rpath-handling.patch \ | 13 | file://disable-rpath-handling.patch \ |
14 | file://cross-libdir.patch \ | ||
14 | " | 15 | " |
15 | SRC_URI[sha256sum] = "fb0395c4ac208eab381cd1a20571584bdbba176eb562a7efa9cb17cace0e1551" | 16 | SRC_URI[sha256sum] = "fb0395c4ac208eab381cd1a20571584bdbba176eb562a7efa9cb17cace0e1551" |
16 | SRC_URI[md5sum] = "3c35b91e8040901034809576d54007c6" | 17 | SRC_URI[md5sum] = "3c35b91e8040901034809576d54007c6" |
diff --git a/meta/recipes-devtools/meson/meson/cross-libdir.patch b/meta/recipes-devtools/meson/meson/cross-libdir.patch new file mode 100644 index 0000000000..2bd4fb3f9e --- /dev/null +++ b/meta/recipes-devtools/meson/meson/cross-libdir.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
3 | |||
4 | From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001 | ||
5 | From: Jussi Pakkanen <jpakkane@gmail.com> | ||
6 | Date: Thu, 27 Dec 2018 23:43:35 +0200 | ||
7 | Subject: [PATCH] Default libdir is "lib" when cross compiling. Closes #2535. | ||
8 | |||
9 | --- | ||
10 | docs/markdown/snippets/crosslib.md | 7 +++++++ | ||
11 | mesonbuild/coredata.py | 8 ++++++++ | ||
12 | run_unittests.py | 13 +++++++++++++ | ||
13 | 3 files changed, 28 insertions(+) | ||
14 | create mode 100644 docs/markdown/snippets/crosslib.md | ||
15 | |||
16 | diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py | ||
17 | index d70c23038c..4e2f3e008c 100644 | ||
18 | --- a/mesonbuild/coredata.py | ||
19 | +++ b/mesonbuild/coredata.py | ||
20 | @@ -299,6 +299,7 @@ def __init__(self, options): | ||
21 | # Only to print a warning if it changes between Meson invocations. | ||
22 | self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '') | ||
23 | self.config_files = self.__load_config_files(options.native_file) | ||
24 | + self.libdir_cross_fixup() | ||
25 | |||
26 | @staticmethod | ||
27 | def __load_config_files(filenames): | ||
28 | @@ -348,6 +349,13 @@ def __load_cross_file(filename): | ||
29 | |||
30 | raise MesonException('Cannot find specified cross file: ' + filename) | ||
31 | |||
32 | + def libdir_cross_fixup(self): | ||
33 | + # By default set libdir to "lib" when cross compiling since | ||
34 | + # getting the "system default" is always wrong on multiarch | ||
35 | + # platforms as it gets a value like lib/x86_64-linux-gnu. | ||
36 | + if self.cross_file is not None: | ||
37 | + self.builtins['libdir'].value = 'lib' | ||
38 | + | ||
39 | def sanitize_prefix(self, prefix): | ||
40 | if not os.path.isabs(prefix): | ||
41 | raise MesonException('prefix value {!r} must be an absolute path' | ||