blob: 9061cf0b1b5843b93480086d7548848aca520230 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001# Copyright (C) 2019 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "ucontext implementation featuring glibc-compatible ABI"
5HOMEPAGE = "https://github.com/kaniini/libucontext"
6LICENSE = "ISC"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=6eed01fa0e673c76f5a5715438f65b1d"
8SECTION = "libs"
9DEPENDS = ""
10
William A. Kennington IIIac69b482021-06-02 12:28:27 -070011PV = "1.1+${SRCPV}"
12SRCREV = "335ee864ef6f4a5d4b525453fd9dbfb3507cfecc"
Andrew Geissler595f6302022-01-24 19:11:47 +000013SRC_URI = "git://github.com/kaniini/libucontext;branch=master;protocol=https \
William A. Kennington IIIac69b482021-06-02 12:28:27 -070014 file://0001-meson-Add-option-to-pass-cpu.patch \
15 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
17S = "${WORKDIR}/git"
18
19COMPATIBLE_HOST = ".*-musl.*"
20
21valid_archs = " \
22 x86 x86_64 \
23 ppc ppc64 \
24 mips mips64 \
25 arm aarch64 \
26 s390x \
27"
28
29def map_kernel_arch(a, d):
30 import re
31
32 valid_archs = d.getVar('valid_archs').split()
33
34 if a in valid_archs: return a
35 elif re.match('(i.86|athlon)$', a): return 'x86'
36 elif re.match('x86.64$', a): return 'x86_64'
37 elif re.match('armeb$', a): return 'arm'
38 elif re.match('aarch64$', a): return 'aarch64'
39 elif re.match('aarch64_be$', a): return 'aarch64'
40 elif re.match('aarch64_ilp32$', a): return 'aarch64'
41 elif re.match('aarch64_be_ilp32$', a): return 'aarch64'
42 elif re.match('mips(isa|)(32|)(r6|)(el|)$', a): return 'mips'
43 elif re.match('mips(isa|)64(r6|)(el|)$', a): return 'mips64'
Andrew Geissler95ac1b82021-03-31 14:34:31 -050044 elif re.match('p(pc64|owerpc64)(le)', a): return 'ppc64'
Andrew Geissler82c905d2020-04-13 13:39:40 -050045 elif re.match('p(pc|owerpc)', a): return 'ppc'
Andrew Geissler82c905d2020-04-13 13:39:40 -050046 elif re.match('riscv64$', a): return 'riscv64'
Andrew Geisslerc9f78652020-09-18 14:11:35 -050047 elif re.match('riscv32$', a): return 'riscv32'
Andrew Geissler82c905d2020-04-13 13:39:40 -050048 else:
49 if not d.getVar("TARGET_OS").startswith("linux"):
50 return a
51 bb.error("cannot map '%s' to a linux kernel architecture" % a)
52
William A. Kennington IIIac69b482021-06-02 12:28:27 -070053EXTRA_OEMESON = "-Dcpu=${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}"
54inherit meson