blob: de6debda93cf1ba0d94c333d618867c602e41983 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7# SDK packages are built either explicitly by the user,
8# or indirectly via dependency. No need to be in 'world'.
9EXCLUDE_FROM_WORLD = "1"
10
11STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
12
13# libc for the SDK can be different to that of the target
14NATIVESDKLIBC ?= "libc-glibc"
15LIBCOVERRIDE = ":${NATIVESDKLIBC}"
16CLASSOVERRIDE = "class-nativesdk"
17MACHINEOVERRIDES = ""
Patrick Williams169d7bc2024-01-05 11:33:25 -060018
19MACHINE_FEATURES = "${SDK_MACHINE_FEATURES}"
20DISTRO_FEATURES_BACKFILL = ""
21MACHINE_FEATURES_BACKFILL = ""
Patrick Williams92b42cb2022-09-03 06:53:57 -050022
23MULTILIBS = ""
24
25# we need consistent staging dir whether or not multilib is enabled
26STAGING_DIR_HOST = "${WORKDIR}/recipe-sysroot"
27STAGING_DIR_TARGET = "${WORKDIR}/recipe-sysroot"
28RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
29
30#
31# Update PACKAGE_ARCH and PACKAGE_ARCHS
32#
33PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
34PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
35
36#
37# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
38# binaries
39#
40DEPENDS:append = " chrpath-replacement-native"
41EXTRANATIVEPATH += "chrpath-native"
42
43PKGDATA_DIR = "${PKGDATA_DIR_SDK}"
44
45HOST_ARCH = "${SDK_ARCH}"
46HOST_VENDOR = "${SDK_VENDOR}"
47HOST_OS = "${SDK_OS}"
48HOST_PREFIX = "${SDK_PREFIX}"
49HOST_CC_ARCH = "${SDK_CC_ARCH}"
50HOST_LD_ARCH = "${SDK_LD_ARCH}"
51HOST_AS_ARCH = "${SDK_AS_ARCH}"
52#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
53
54TARGET_ARCH = "${SDK_ARCH}"
55TARGET_VENDOR = "${SDK_VENDOR}"
56TARGET_OS = "${SDK_OS}"
57TARGET_PREFIX = "${SDK_PREFIX}"
58TARGET_CC_ARCH = "${SDK_CC_ARCH}"
59TARGET_LD_ARCH = "${SDK_LD_ARCH}"
60TARGET_AS_ARCH = "${SDK_AS_ARCH}"
61TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
62TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
63TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
64TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
65TARGET_FPU = ""
66EXTRA_OECONF_GCC_FLOAT = ""
67TUNE_FEATURES = ""
68
69CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
70CFLAGS = "${BUILDSDK_CFLAGS}"
71CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
72LDFLAGS = "${BUILDSDK_LDFLAGS}"
73
74# Change to place files in SDKPATH
75base_prefix = "${SDKPATHNATIVE}"
76prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
77exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
78baselib = "lib"
79sbindir = "${bindir}"
80
81export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
82export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
83
84python nativesdk_virtclass_handler () {
85 pn = e.data.getVar("PN")
86 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
87 return
88
89 # Set features here to prevent appends and distro features backfill
90 # from modifying nativesdk distro features
91 features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
92 filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
93 d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
94
95 e.data.setVar("MLPREFIX", "nativesdk-")
96 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
97}
98
99python () {
100 pn = d.getVar("PN")
101 if not pn.startswith("nativesdk-"):
102 return
103
104 import oe.classextend
105
106 clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
107 clsextend.rename_packages()
108 clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
109
110 clsextend.map_depends_variable("DEPENDS")
111 clsextend.map_packagevars()
112 clsextend.map_variable("PROVIDES")
113 clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
114 d.setVar("LIBCEXTENSION", "")
115 d.setVar("ABIEXTENSION", "")
116}
117
118addhandler nativesdk_virtclass_handler
119nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
120
121do_packagedata[stamp-extra-info] = ""
122
123USE_NLS = "${SDKUSE_NLS}"
124
125OLDEST_KERNEL = "${SDK_OLDEST_KERNEL}"
126
127PATH:prepend = "${COREBASE}/scripts/nativesdk-intercept:"