[cairo] How to cross compile py2cairo

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Wed Jan 18 06:03:50 PST 2012


Hi,

I guess your testing "import _cairo" does not work even under
the self hosting environment in GNU/Linux i386, even if
_cairo.so is correctly built.
I propose to proceed step-by-step manner;

1) build py2cairo for hosting GNU/Linux via waf (as INSTALL tells),
with a python whose version is same with the python running in your
ARM target.

2) install py2cairo via waf, and test what you want to do on ARM
target. Also it is important to check which files are required
to work.

3) build _cairo.so for hosting GNU/Linux by some method you want
to try (e.g. gcc -shared -o _cairo.so *.c ...), replace _cairo.so
in installed directory, and test what you want to do on ARM target.

4) build _cairo.so for target GNU/Linux by some method you want
to try, and copy the required files (checked in step 2) to the
target.

Regards,
mpsuzuki

xsj wrote:
> Hi:
>     I have tried to compile it by myself as follow:
>         cd src
>         arm-gcc -g -shared -o _cairo.so *.c `pkg-config --cflags --libs python cairo`
>         put the _cairo.so into my arm platform
>         start python in the _cairo.so's directory
>         type the " import _cairo " command
>         it  failed " SystemError: dynamic module not initialized properly "
>    So i dbg it , break at the "init_cairo"  function, all the if test were passed and the function 
> returned normally.
>     I know the compile command must have something wrong ,please help me to figure it out.
> I googled ,but know little about cross-compile use waf .
> 
> 
> 
> 
> 
> At 2012-01-18 16:14:12,"suzuki toshiya" <mpsuzuki at hiroshima-u.ac.jp> wrote:
>> Hi,
>>
>> Considering the error message by configure, it looks like
>> as if you executed ./configure directly, instead of "./waf configure".
>> If, if you've executed "./waf configure" but you got same error,
>> please check how Python executed waf script, by setting PYTHONVERBOSE
>> environment. In my case, "env PYTHONVERBOSE=1 ./waf configure"
>> gave attached output.
>>
>> BTW, I'm not sure whether waf supports autoconf-like cross building
>> (rather, I'm not sure whether waf supports cross building itself).
>>
>> # In addition, setting CC for cross-building is looking like a method
>> # advertised by too legacy broken tutorials and that had misguided many
>> # newbies (it works in some cases, but does not work in other cases).
>> # I want to know who taught you it :-)
>>
>> Regards,
>> mpsuzuki
>>
>> xsj wrote:
>>> Hi,
>>>      I want to cross compile py2cairo-1.10,but find that it use waf as the 
>>> build tool,which i did't know well. So, i try to define the CC,PKG_CONFIG_PATH ... enviroment var,and follow the
>>> orders in the INSTALL file,but it use the wrong library 
>>>      I also find that it has the configure script and try to ./configure ,but it complaint : "configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../..""
>>>      Above all, please tell me how to use waf to cross-compile or fix the configure script error.
>>> Thanks
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> --
>>> cairo mailing list
>>> cairo at cairographics.org
>>> http://lists.cairographics.org/mailman/listinfo/cairo
> 



More information about the cairo mailing list