<div dir="ltr">Darcy,<br><br><div class="gmail_extra">Thank you for this post, it just saved me more hours of headache. I was struggling to understand the purpose of `EXTRANATIVEPATH`, and `pythonnative.bbclass` with `perlnative.bbclass`. Well, there are a few other things when grep `EXTRANATIVEPATH` for, but I think I am happy to hear the reason for this to exist, which your post and Richard Purdie's commit message [1] are starting to explain.</div><div class="gmail_extra"><br></div><div class="gmail_extra">[1]: <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=5157c85776bb8bd7315ef42e6e622aae27ebc79e">http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=5157c85776bb8bd7315ef42e6e622aae27ebc79e</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">If anyone has more to say on the motivation for these things to exist, please do let us know. To me this seemed like a terrible hack of sorts at first, now I can (sort of) see the some reason for it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,<br clear="all"><div><div class="gmail_signature">— <br>Ilya Dmitrichenko </div></div>
<br><div class="gmail_quote">On 6 March 2014 at 23:42, Darcy Watkins <span dir="ltr"><<a href="mailto:darcy.watkins@inmotiontechnology.com" target="_blank">darcy.watkins@inmotiontechnology.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
This is followup to...<br>
<br>
<a href="https://lists.yoctoproject.org/pipermail/yocto/2014-February/018209.html" target="_blank">https://lists.yoctoproject.org/pipermail/yocto/2014-February/018209.html</a><br>
<br>
...for others dealing with 'cross-python' like issues.<br>
<br>
This is the python equivalent to cross compiling.  I found a number of<br>
resources related to python cross-compiling and even a pycon talk where<br>
the presenter covers the hurdles involved to get distutil to â€œcross”<br>
build as well.<br>
<br>
<a href="http://stackoverflow.com/questions/19120938/cross-compiling-python-2-7-4" target="_blank">http://stackoverflow.com/questions/19120938/cross-compiling-python-2-7-4</a><br>
<a href="http://www.droboports.com/app-repository/python-2-7-5" target="_blank">http://www.droboports.com/app-repository/python-2-7-5</a><br>
<a href="http://www.youtube.com/watch?v=nhr-YErfW8k" target="_blank">http://www.youtube.com/watch?v=nhr-YErfW8k</a><br>
<a href="http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html" target="_blank">http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html</a><br>
<br>
Fortunately the Yocto/OpenEmbedded folk have these sorted out - you just<br>
have to look in the right place.<br>
<br>
My resolution was to ensure that the correct native python is used.<br>
There is the host's native python that is used to run the tools of the<br>
build system (including 'bitbake' itself).<br>
<br>
Then there is a python-native that gets symlinked as 'nativepython' into<br>
the native sysroot.  This 'nativepython' is setup sort of as a<br>
crosscompiler python if you want to compile .py to .pyo/.pyc and put the<br>
compiled files on your target.<br>
<br>
Finally, there is the python that runs on the target system.<br>
<br>
---<br>
<br>
My headache was due to using the host's native python (actually ADT<br>
bundled python on CentOS) when I needed to use 'nativepython'.  With a<br>
small amount of shoehorn work, I was readily able to get make rules and<br>
recipes to swig wrap some libraries as python extensions and to build<br>
using nativepython.<br>
<br>
There are a couple of variables you have to ensure get passed/exported<br>
through your make to be available to 'nativepython' to point it to the<br>
right sysroot locations of your target.<br>
<br>
BUILD_SYS=${BUILD_SYS}<br>
HOST_SYS=${HOST_SYS}<br>
STAGING_LIBDIR=${STAGING_LIBDIR}<br>
STAGING_INCDIR=${STAGING_INCDIR}<br>
<br>
If you are using swig-native, you also need to use "-I" to get your<br>
target sysroot include directories to it as well.<br>
<br>
<br>
--<br>
<br>
Regards,<br>
<br>
Darcy<br>
<br>
---<br>
<br>
Darcy Watkins<br>
Senior Software Developer<br>
In Motion Technology, Inc.<br>
350-625 Agnes St. New Westminster, BC<br>
Canada, V3M 5Y4<br>
[P1]<br>
<br>
_______________________________________________<br>
yocto mailing list<br>
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/yocto" target="_blank">https://lists.yoctoproject.org/listinfo/yocto</a><br>
</blockquote></div><br></div></div>