summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/populate_sdk_base.bbclass42
-rw-r--r--meta/classes/toolchain-scripts.bbclass16
2 files changed, 48 insertions, 10 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 6508bd96cd..6dc66fbbbe 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -16,6 +16,10 @@ TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}"
16SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" 16SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
17SDK_DEPENDS = "virtual/fakeroot-native sed-native" 17SDK_DEPENDS = "virtual/fakeroot-native sed-native"
18 18
19# We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
20# could be set to the MACHINE_ARCH
21REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
22
19PID = "${@os.getpid()}" 23PID = "${@os.getpid()}"
20 24
21EXCLUDE_FROM_WORLD = "1" 25EXCLUDE_FROM_WORLD = "1"
@@ -27,7 +31,33 @@ python () {
27 runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d) 31 runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d)
28} 32}
29 33
30fakeroot do_populate_sdk() { 34fakeroot python do_populate_sdk() {
35 bb.build.exec_func("populate_sdk_image", d)
36
37 # Handle multilibs in the SDK environment, siteconfig, etc files...
38 localdata = bb.data.createCopy(d)
39
40 # make sure we only use the WORKDIR value from 'd', or it can change
41 localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
42
43 # make sure we only use the SDKTARGETSYSROOT value from 'd'
44 localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True))
45
46 # Process DEFAULTTUNE
47 bb.build.exec_func("create_sdk_files", localdata)
48
49 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
50 for item in variants.split():
51 # Load overrides from 'd' to avoid having to reset the value...
52 overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
53 localdata.setVar("OVERRIDES", overrides)
54 bb.data.update_data(localdata)
55 bb.build.exec_func("create_sdk_files", localdata)
56
57 bb.build.exec_func("tar_sdk", d)
58}
59
60fakeroot populate_sdk_image() {
31 rm -rf ${SDK_OUTPUT} 61 rm -rf ${SDK_OUTPUT}
32 mkdir -p ${SDK_OUTPUT} 62 mkdir -p ${SDK_OUTPUT}
33 63
@@ -54,15 +84,19 @@ fakeroot do_populate_sdk() {
54 84
55 # Link the ld.so.cache file into the hosts filesystem 85 # Link the ld.so.cache file into the hosts filesystem
56 ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache 86 ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
87}
57 88
89fakeroot create_sdk_files() {
58 # Setup site file for external use 90 # Setup site file for external use
59 toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} 91 toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
60 92
61 toolchain_create_sdk_env_script 93 toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
62 94
63 # Add version information 95 # Add version information
64 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} 96 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
97}
65 98
99fakeroot tar_sdk() {
66 # Package it up 100 # Package it up
67 mkdir -p ${SDK_DEPLOY} 101 mkdir -p ${SDK_DEPLOY}
68 cd ${SDK_OUTPUT} 102 cd ${SDK_OUTPUT}
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 2099c4def8..bedcd612fe 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -1,15 +1,19 @@
1inherit siteinfo 1inherit siteinfo
2 2
3# We want to be able to change the value of MULTIMACH_TARGET_SYS, because it
4# doesn't always match our expectations... but we default to the stock value
5REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}"
6
3# This function creates an environment-setup-script for use in a deployable SDK 7# This function creates an environment-setup-script for use in a deployable SDK
4toolchain_create_sdk_env_script () { 8toolchain_create_sdk_env_script () {
5 # Create environment setup script 9 # Create environment setup script
6 script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${MULTIMACH_TARGET_SYS} 10 script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}}
7 rm -f $script 11 rm -f $script
8 touch $script 12 touch $script
9 echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${MULTIMACH_TARGET_SYS}:$PATH' >> $script 13 echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${REAL_MULTIMACH_TARGET_SYS}:$PATH' >> $script
10 echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script 14 echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script
11 echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script 15 echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script
12 echo 'export CONFIG_SITE=${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}' >> $script 16 echo 'export CONFIG_SITE=${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}' >> $script
13 echo 'export CC=${TARGET_PREFIX}gcc' >> $script 17 echo 'export CC=${TARGET_PREFIX}gcc' >> $script
14 echo 'export CXX=${TARGET_PREFIX}g++' >> $script 18 echo 'export CXX=${TARGET_PREFIX}g++' >> $script
15 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script 19 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
@@ -36,7 +40,7 @@ toolchain_create_sdk_env_script () {
36# This function creates an environment-setup-script in the TMPDIR which enables 40# This function creates an environment-setup-script in the TMPDIR which enables
37# a OE-core IDE to integrate with the build tree 41# a OE-core IDE to integrate with the build tree
38toolchain_create_tree_env_script () { 42toolchain_create_tree_env_script () {
39 script=${TMPDIR}/environment-setup-${MULTIMACH_TARGET_SYS} 43 script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
40 rm -f $script 44 rm -f $script
41 touch $script 45 touch $script
42 echo 'export PATH=${PATH}' >> $script 46 echo 'export PATH=${PATH}' >> $script
@@ -103,8 +107,8 @@ toolchain_create_sdk_env_script_for_installer () {
103} 107}
104 108
105#we get the cached site config in the runtime 109#we get the cached site config in the runtime
106TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}" 110TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d, True)}"
107TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d" 111TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
108TOOLCHAIN_NEED_CONFIGSITE_CACHE = "${TCLIBC} ncurses" 112TOOLCHAIN_NEED_CONFIGSITE_CACHE = "${TCLIBC} ncurses"
109 113
110#This function create a site config file 114#This function create a site config file