[yocto] How to build a native python extension

cddatemp cddatemp at 163.com
Mon Nov 20 06:34:30 PST 2017


在2017年11月20 22时16分, "Burton, Ross"<ross.burton at intel.com>写道:
> There's numerous u-boot recipes out there, including on in oe-core. 
> Ideally customise the u-boot in oe-core instead of writing your own recipe from scratch.
>
> Ross


Thanks for your help, I finally solved this problem as below:


# u-boot_2017.09.bbappend
# base recipe: meta/recipes-bsp/u-boot/u-boot_2017.09.bb
# base branch: rocko
#


inherit pythonnative


DEPENDS += "swig-native"


do_compile_prepend() {
    export STAGING_LIBDIR="${STAGING_LIBDIR_NATIVE}"
    export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}"
}


Then I can build u-boot for allwinner a20.
Maybe this is useful for x86 too according to [1].


[1] u-boot commit e38ffc42674fedc750ca895046be0bd983b56dd5


Best Regards
cddatemp


> On 20 November 2017 at 12:07, cddatemp <cddatemp at 163.com> wrote:
>> At 2017-11-20 19:35:31, "Burton, Ross" <ross.burton at intel.com> wrote:
>>> inherit native to make the recipe native.
>>
>> It really help, when my recipe is just a helloworld python extension.
>> Unfortunately, this recipe is u-boot.
>> It will compile a native python extension named "libfdt", then use it to compile u-boot.
>> So I cannot add "inherit native" to the u-boot recipe.
>>
>>> Ross
>>>
>>> On 20 November 2017 at 11:33, cddatemp <cddatemp at 163.com> wrote:
>>>> Hi,
>>>>
>>>> I add "inherit distutils" in my recipe.
>>>> It will make my recipe depends on "python-native" and "python".
>>>> Finally it use arm-gcc to build the python extension.
>>>> But I want to use x86-gcc to build a native python extension.
>>>> How to do this?
>>>>
>>>> Best Regards
>>>> cddatemp
>>>>
>>>> --
>>>> _______________________________________________
>>>> yocto mailing list
>>>> yocto at yoctoproject.org
>>>> https://lists.yoctoproject.org/listinfo/yocto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171120/734be53d/attachment.html>


More information about the yocto mailing list