spidev for arm

I'm trying to cross-compiled py-spidev module for an ARM9 (embedded system). So in a Ubuntu 64 bits VM, I did (in my home directory):

git clone https://github.com/doceme/py-spidev
cd py-spidev
export PATH=$PATH:"Path_to_my_cross_compiler"
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
python setup.py install --prefix=~/

But spidev_module.c is compiled with x86_64-linux-gnu-gcc and not my cross-compiler (arm-poky-linux-gnueabi-gcc).

How can I force python setup.py install to use my cross compiler ?

Thanks


Thanks for all your help...

I found the solution, so I post it for those who have the same problem.

This is what I did :

git clone https://github.com/doceme/py-spidev
cd py-spidev
export ARCH=arm
PLAT=arm-poky-linux-gnueabi-
export CROSS_COMPILE=arm-poky-linux-gnueabi-
export PATH=$PATH:"Path_to_my_cross_compiler"
export CC="${PLAT}gcc -pthread"
export LDSHARED="${CC} -shared"
export CROSSBASE="Path of destination"
export CFLAGS="-I "path to python cross compiled include" -I${CROSSBASE}/usr/include"
export LDFLAGS="-L "path to python cross compiled libs" -L${CROSSBASE}/lib -L${CROSSBASE}/usr/lib"
python setup.py install --prefix=CROSSBASE

Enjoy :)

链接地址: http://www.djcxy.com/p/86938.html

上一篇:

下一篇: spidev for arm