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 | |
| 13 | # |
| 14 | # Update PACKAGE_ARCH and PACKAGE_ARCHS |
| 15 | # |
| 16 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" |
| 17 | PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" |
| 18 | |
| 19 | # |
| 20 | # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit |
| 21 | # binaries |
| 22 | # |
| 23 | DEPENDS_append = " chrpath-replacement-native" |
| 24 | EXTRANATIVEPATH += "chrpath-native" |
| 25 | |
| 26 | STAGING_DIR_HOST = "${STAGING_DIR}/${MULTIMACH_HOST_SYS}" |
| 27 | STAGING_DIR_TARGET = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}" |
| 28 | PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata" |
| 29 | |
| 30 | HOST_ARCH = "${SDK_ARCH}" |
| 31 | HOST_VENDOR = "${SDK_VENDOR}" |
| 32 | HOST_OS = "${SDK_OS}" |
| 33 | HOST_PREFIX = "${SDK_PREFIX}" |
| 34 | HOST_CC_ARCH = "${SDK_CC_ARCH}" |
| 35 | HOST_LD_ARCH = "${SDK_LD_ARCH}" |
| 36 | HOST_AS_ARCH = "${SDK_AS_ARCH}" |
| 37 | #HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}" |
| 38 | |
| 39 | TARGET_ARCH = "${SDK_ARCH}" |
| 40 | TARGET_VENDOR = "${SDK_VENDOR}" |
| 41 | TARGET_OS = "${SDK_OS}" |
| 42 | TARGET_PREFIX = "${SDK_PREFIX}" |
| 43 | TARGET_CC_ARCH = "${SDK_CC_ARCH}" |
| 44 | TARGET_LD_ARCH = "${SDK_LD_ARCH}" |
| 45 | TARGET_AS_ARCH = "${SDK_AS_ARCH}" |
| 46 | TARGET_FPU = "" |
| 47 | EXTRA_OECONF_GCC_FLOAT = "" |
| 48 | |
| 49 | CPPFLAGS = "${BUILDSDK_CPPFLAGS}" |
| 50 | CFLAGS = "${BUILDSDK_CFLAGS}" |
| 51 | CXXFLAGS = "${BUILDSDK_CFLAGS}" |
| 52 | LDFLAGS = "${BUILDSDK_LDFLAGS}" |
| 53 | |
| 54 | # Change to place files in SDKPATH |
| 55 | base_prefix = "${SDKPATHNATIVE}" |
| 56 | prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" |
| 57 | exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" |
| 58 | baselib = "lib" |
| 59 | sbindir = "${bindir}" |
| 60 | |
| 61 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" |
| 62 | export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" |
| 63 | |
| 64 | python nativesdk_virtclass_handler () { |
| 65 | pn = e.data.getVar("PN", True) |
| 66 | if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")): |
| 67 | return |
| 68 | |
| 69 | e.data.setVar("MLPREFIX", "nativesdk-") |
| 70 | e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", "")) |
| 71 | e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk") |
| 72 | } |
| 73 | |
| 74 | python () { |
| 75 | pn = d.getVar("PN", True) |
| 76 | if not pn.startswith("nativesdk-"): |
| 77 | return |
| 78 | |
| 79 | import oe.classextend |
| 80 | |
| 81 | clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d) |
| 82 | clsextend.rename_packages() |
| 83 | clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split()) |
| 84 | |
| 85 | clsextend.map_depends_variable("DEPENDS") |
| 86 | clsextend.map_packagevars() |
| 87 | clsextend.map_variable("PROVIDES") |
| 88 | clsextend.map_regexp_variable("PACKAGES_DYNAMIC") |
| 89 | } |
| 90 | |
| 91 | addhandler nativesdk_virtclass_handler |
| 92 | nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" |
| 93 | |
| 94 | do_populate_sysroot[stamp-extra-info] = "" |
| 95 | do_packagedata[stamp-extra-info] = "" |
| 96 | |
| 97 | USE_NLS = "${SDKUSE_NLS}" |