[oe-commits] Andrea Adami : klcc_cross: move in target sysroot as crossscript

git at git.openembedded.org git at git.openembedded.org
Sun May 4 10:41:52 UTC 2014


Module: meta-openembedded.git
Branch: master
Commit: 55b09e522ca88c0c0b2dd7a36e4861a1cf6ca9c6
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=55b09e522ca88c0c0b2dd7a36e4861a1cf6ca9c6

Author: Andrea Adami <andrea.adami at gmail.com>
Date:   Sat May  3 18:09:49 2014 +0200

klcc_cross: move in target sysroot as crossscript

Klcc-cross is properly a crosscript so avoid to inherit cross.bbclass and stage
it in target sysroot under usr/bin/crossscripts.
Minor adjustment is necessary for INSTALLDIR.

Finally some magic mangling is applied fixing the paths of sstate so that it is
invalidated in case of subsequent builds targeting machines with the same
arch and in case of builds sharing the sstate cache.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Andrea Adami <andrea.adami at gmail.com>

---

 .../recipes-devtools/klibc/klcc-cross_2.0.3.bb     | 40 +++++++++++++---------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.3.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.3.bb
index 7ff9c2e..2f4afce 100644
--- a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.3.bb
+++ b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.3.bb
@@ -7,28 +7,34 @@ FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:"
 
 SRC_URI += "file://use-env-for-perl.patch"
 
-inherit cross
-
 # disable task already run in klibc recipe
 do_configure[noexec] = "1"
+
 do_compile() {
-    oe_runmake 'INSTALLDIR=${STAGING_DIR_TARGET}${target_libdir}/klibc' klcc
+    oe_runmake 'INSTALLDIR=${STAGING_DIR_TARGET}${libdir}/klibc' klcc
 }
-# The linux-libc-headers and klibc custom headers are not machine-specific
-# but are installed into machine sysroot.
-# Klcc wrapper is hardcoding some of these paths thus, to keep the recipe
-# arch-specific, we force the rebuild of klcc-cross for each machine.
-do_compile[vardeps] += "MACHINE"
+
 do_install() {
-    install -d ${D}${bindir}
-    install -m 0755 klcc/klcc ${D}${bindir}/${TARGET_PREFIX}klcc
+    install -d ${D}${bindir_crossscripts}/
+    install -m 0755 klcc/klcc ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc
+    # Insert an unencoded path as a comment to trigger the sstate renaming functions
+    sed -i '2i #${STAGING_DIR_TARGET}' ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc
+}
+
+SYSROOT_PREPROCESS_FUNCS += "klcc_sysroot_preprocess"
+
+klcc_sysroot_preprocess () {
+       sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
 }
 
+deltask do_package
+deltask do_packagedata
+deltask do_package_write_ipk
+deltask do_package_write_rpm
+deltask do_package_write_deb
+deltask do_package_write_tar
 
-# disable unneeded tasks
-do_package[noexec] = "1"
-do_packagedata[noexec] = "1"
-do_package_write_ipk[noexec] = "1"
-do_package_write_rpm[noexec] = "1"
-do_package_write_deb[noexec] = "1"
-do_package_write_tar[noexec] = "1"
+SSTATE_SCAN_FILES = "*"
+EXTRA_STAGING_FIXMES = "MANGLEDSTAGINGDIRTARGET MANGLEDSTAGINGDIR"
+MANGLEDSTAGINGDIR = "${@d.getVar("STAGING_DIR", True).replace("/", "\\\\/").replace("-", "\\\\-")}"
+MANGLEDSTAGINGDIRTARGET = "${@d.getVar("STAGING_DIR_TARGET", True).replace("/", "\\\\/").replace("-", "\\\\-")}"



More information about the Openembedded-commits mailing list