[yocto] How to write a recipe whose source code will generate host and target output at the same build?

Qiang Yu yuq825 at gmail.com
Sun Feb 8 21:07:04 PST 2015


I can finally solve the problem with the following method. If this method
have some problem (like sstate), or missing some work, please point out,
thanks.

The origin output file flow is
do_populate_sysroot: ${D} --> ${SYSROOT_DESTDIR} --> ${STAGING_DIR_TARGET}
do_package: ${D} --> ${PKGD} --> split then pack to ipk

My idea is copy both target and host files to ${SYSROOT_DESTDIR}, then to
${STAGING_DIR}, copy only target files to ${PKGD}.

Simplified code:
do_install() {
    #install host to ${D}${STAGING_DIR_NATIVE}
    #install target to ${D}${STAGING_DIR_TARGET}
}

# change do_populate_sysroot output dir from ${STAGING_DIR_TARGET} to
${STAGING_DIR}
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}"

sysroot_stage_dirs_append() {
    cp -ra ${D}${STAGING_DIR}/* ${SYSROOT_DESTDIR}
}

python perform_packagecopy_append () {
    #copy target files at ${PKGD}/${STAGING_DIR_TARGET} to ${PKGD}
    #remove host files at ${PKGD}/${STAGING_DIR_NATIVE}
}



On Sun, Feb 8, 2015 at 11:21 AM, Qiang Yu <yuq825 at gmail.com> wrote:

> Hi all,
>
> I'm writing a recipe for QT5 which will generate both host tools and
> target lib at the same build. How can I handle this situation? It doesn't
> fix either target or native class.
>
> Can cross class solve this problem? Can cross generate target lib package
> and populate both target and host sysroot all at once?
>
> Or I notice a tmp/work-shared dir which can be shared by multi recipes. So
> maybe I can write two recipes, one for target lib, one for host tool, which
> share the same work dir at tmp/work-shared. Only one build is needed. If
> this is possible, how can I use the tmp/work-shared, inherit some special
> class?
>
> Regards,
> Qiang
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150209/679061a4/attachment.html>


More information about the yocto mailing list