Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # SDK packages are built either explicitly by the user, |
| 2 | # or indirectly via dependency. No need to be in 'world'. |
| 3 | EXCLUDE_FROM_WORLD = "1" |
| 4 | |
| 5 | STAGING_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 |
| 8 | NATIVESDKLIBC ?= "libc-glibc" |
| 9 | LIBCOVERRIDE = ":${NATIVESDKLIBC}" |
| 10 | CLASSOVERRIDE = "class-nativesdk" |
| 11 | MACHINEOVERRIDES = "" |
| 12 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | MULTILIBS = "" |
| 14 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | # we need consistent staging dir whether or not multilib is enabled |
| 16 | STAGING_DIR_HOST = "${WORKDIR}/recipe-sysroot" |
| 17 | STAGING_DIR_TARGET = "${WORKDIR}/recipe-sysroot" |
| 18 | RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot" |
| 19 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | # |
| 21 | # Update PACKAGE_ARCH and PACKAGE_ARCHS |
| 22 | # |
| 23 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" |
| 24 | PACKAGE_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 | # |
| 30 | DEPENDS_append = " chrpath-replacement-native" |
| 31 | EXTRANATIVEPATH += "chrpath-native" |
| 32 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
| 35 | HOST_ARCH = "${SDK_ARCH}" |
| 36 | HOST_VENDOR = "${SDK_VENDOR}" |
| 37 | HOST_OS = "${SDK_OS}" |
| 38 | HOST_PREFIX = "${SDK_PREFIX}" |
| 39 | HOST_CC_ARCH = "${SDK_CC_ARCH}" |
| 40 | HOST_LD_ARCH = "${SDK_LD_ARCH}" |
| 41 | HOST_AS_ARCH = "${SDK_AS_ARCH}" |
| 42 | #HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}" |
| 43 | |
| 44 | TARGET_ARCH = "${SDK_ARCH}" |
| 45 | TARGET_VENDOR = "${SDK_VENDOR}" |
| 46 | TARGET_OS = "${SDK_OS}" |
| 47 | TARGET_PREFIX = "${SDK_PREFIX}" |
| 48 | TARGET_CC_ARCH = "${SDK_CC_ARCH}" |
| 49 | TARGET_LD_ARCH = "${SDK_LD_ARCH}" |
| 50 | TARGET_AS_ARCH = "${SDK_AS_ARCH}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 51 | TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}" |
| 52 | TARGET_CFLAGS = "${BUILDSDK_CFLAGS}" |
| 53 | TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}" |
| 54 | TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | TARGET_FPU = "" |
| 56 | EXTRA_OECONF_GCC_FLOAT = "" |
| 57 | |
| 58 | CPPFLAGS = "${BUILDSDK_CPPFLAGS}" |
| 59 | CFLAGS = "${BUILDSDK_CFLAGS}" |
| 60 | CXXFLAGS = "${BUILDSDK_CFLAGS}" |
| 61 | LDFLAGS = "${BUILDSDK_LDFLAGS}" |
| 62 | |
| 63 | # Change to place files in SDKPATH |
| 64 | base_prefix = "${SDKPATHNATIVE}" |
| 65 | prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" |
| 66 | exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" |
| 67 | baselib = "lib" |
| 68 | sbindir = "${bindir}" |
| 69 | |
| 70 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" |
| 71 | export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" |
| 72 | |
| 73 | python nativesdk_virtclass_handler () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 74 | pn = e.data.getVar("PN") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")): |
| 76 | return |
| 77 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 78 | # 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 84 | e.data.setVar("MLPREFIX", "nativesdk-") |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 85 | e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", "")) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | python () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 89 | pn = d.getVar("PN") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 97 | clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split()) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 98 | |
| 99 | clsextend.map_depends_variable("DEPENDS") |
| 100 | clsextend.map_packagevars() |
| 101 | clsextend.map_variable("PROVIDES") |
| 102 | clsextend.map_regexp_variable("PACKAGES_DYNAMIC") |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 103 | d.setVar("LIBCEXTENSION", "") |
| 104 | d.setVar("ABIEXTENSION", "") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | addhandler nativesdk_virtclass_handler |
| 108 | nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" |
| 109 | |
| 110 | do_populate_sysroot[stamp-extra-info] = "" |
| 111 | do_packagedata[stamp-extra-info] = "" |
| 112 | |
| 113 | USE_NLS = "${SDKUSE_NLS}" |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 114 | |
| 115 | OLDEST_KERNEL = "${SDK_OLDEST_KERNEL}" |