blob: 7b75710726796a84c8c1e3ff53e7237ee1934ea8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# SDK packages are built either explicitly by the user,
2# or indirectly via dependency. No need to be in 'world'.
3EXCLUDE_FROM_WORLD = "1"
4
5STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
6
7# libc for the SDK can be different to that of the target
8NATIVESDKLIBC ?= "libc-glibc"
9LIBCOVERRIDE = ":${NATIVESDKLIBC}"
10CLASSOVERRIDE = "class-nativesdk"
11MACHINEOVERRIDES = ""
12
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013MULTILIBS = ""
14
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015# we need consistent staging dir whether or not multilib is enabled
16STAGING_DIR_HOST = "${WORKDIR}/recipe-sysroot"
17STAGING_DIR_TARGET = "${WORKDIR}/recipe-sysroot"
18RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
19
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020#
21# Update PACKAGE_ARCH and PACKAGE_ARCHS
22#
23PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
24PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
25
26#
27# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
28# binaries
29#
30DEPENDS_append = " chrpath-replacement-native"
31EXTRANATIVEPATH += "chrpath-native"
32
Brad Bishop6e60e8b2018-02-01 10:27:11 -050033PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
35HOST_ARCH = "${SDK_ARCH}"
36HOST_VENDOR = "${SDK_VENDOR}"
37HOST_OS = "${SDK_OS}"
38HOST_PREFIX = "${SDK_PREFIX}"
39HOST_CC_ARCH = "${SDK_CC_ARCH}"
40HOST_LD_ARCH = "${SDK_LD_ARCH}"
41HOST_AS_ARCH = "${SDK_AS_ARCH}"
42#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
43
44TARGET_ARCH = "${SDK_ARCH}"
45TARGET_VENDOR = "${SDK_VENDOR}"
46TARGET_OS = "${SDK_OS}"
47TARGET_PREFIX = "${SDK_PREFIX}"
48TARGET_CC_ARCH = "${SDK_CC_ARCH}"
49TARGET_LD_ARCH = "${SDK_LD_ARCH}"
50TARGET_AS_ARCH = "${SDK_AS_ARCH}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050051TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
52TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
53TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
54TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055TARGET_FPU = ""
56EXTRA_OECONF_GCC_FLOAT = ""
57
58CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
59CFLAGS = "${BUILDSDK_CFLAGS}"
60CXXFLAGS = "${BUILDSDK_CFLAGS}"
61LDFLAGS = "${BUILDSDK_LDFLAGS}"
62
63# Change to place files in SDKPATH
64base_prefix = "${SDKPATHNATIVE}"
65prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
66exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
67baselib = "lib"
68sbindir = "${bindir}"
69
70export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
71export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
72
73python nativesdk_virtclass_handler () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050074 pn = e.data.getVar("PN")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
76 return
77
Brad Bishop6e60e8b2018-02-01 10:27:11 -050078 # Set features here to prevent appends and distro features backfill
79 # from modifying nativesdk distro features
80 features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
81 filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
82 d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
83
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 e.data.setVar("MLPREFIX", "nativesdk-")
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086}
87
88python () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050089 pn = d.getVar("PN")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090 if not pn.startswith("nativesdk-"):
91 return
92
93 import oe.classextend
94
95 clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
96 clsextend.rename_packages()
Brad Bishop6e60e8b2018-02-01 10:27:11 -050097 clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098
99 clsextend.map_depends_variable("DEPENDS")
100 clsextend.map_packagevars()
101 clsextend.map_variable("PROVIDES")
102 clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
Brad Bishopa34c0302019-09-23 22:34:48 -0400103 d.setVar("LIBCEXTENSION", "")
104 d.setVar("ABIEXTENSION", "")
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105}
106
107addhandler nativesdk_virtclass_handler
108nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
109
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110do_packagedata[stamp-extra-info] = ""
111
112USE_NLS = "${SDKUSE_NLS}"
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500113
114OLDEST_KERNEL = "${SDK_OLDEST_KERNEL}"