aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/libucontext/0001-meson-Add-option-to-pass-cpu.patch
blob: 1fdc9f739d95039e00c6d70f06a2c2021c823875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From a530eed9e7e6872e10fe92efaf1e9739471c30ca Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 30 May 2021 08:30:28 -0700
Subject: [PATCH] meson: Add option to pass cpu

This helps with cross compile setups, where host_cpu != target_cpu
therefore detecting it on the fly will end up with wrong cpu to build
for

Upstream-Status: Submitted [https://github.com/kaniini/libucontext/pull/28]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meson.build       | 6 +++++-
 meson_options.txt | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index e863780..2b4bdbd 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,11 @@ project(
   version : run_command('head', files('VERSION')).stdout()
 )
 
-cpu = host_machine.cpu_family()
+cpu = get_option('cpu')
+if cpu == ''
+  cpu = host_machine.cpu_family()
+endif
+
 if cpu == 'sh4'
   cpu = 'sh'
 endif
diff --git a/meson_options.txt b/meson_options.txt
index d4201d1..864d83c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,6 @@
 option('freestanding', type : 'boolean', value : false,
        description: 'Do not use system headers')
 option('export_unprefixed', type : 'boolean', value : true,
-       description: 'Export POSIX 2004 ucontext names as alises')
\ No newline at end of file
+       description: 'Export POSIX 2004 ucontext names as alises')
+option('cpu', type : 'string', value : '',
+       description: 'Target CPU architecture for cross compile')
-- 
2.31.1