https://github.com/gvalkov/python-evdev

mkdir -p ~/evdev
cd ~/evdev
git clone https://github.com/gvalkov/python-evdev.git
cd ~/evdev/python-evdev
mkdir -p ~/evdev/python-evdev/build/tmp
mkdir -p ~/evdev/python-evdev/build/lib
source ~/setup.sh
mips-openwrt-linux-uclibc-gcc -pthread -fno-strict-aliasing -DNDEBUG -g \
-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC \
-I/home/sonnyyu/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/python2.7 \
-c evdev/input.c -o build/tmp/input.o -std=c99 -Wno-error=declaration-after-statement
mips-openwrt-linux-uclibc-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/tmp/input.o -o build/lib/_input.so
mips-openwrt-linux-uclibc-gcc -pthread -fno-strict-aliasing -DNDEBUG -g \
-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC \
-I/home/sonnyyu/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/python2.7 \
-c evdev/uinput.c -o build/tmp/uinput.o -std=c99 -Wno-error=declaration-after-statement
mips-openwrt-linux-uclibc-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/tmp/uinput.o -o build/lib/_uinput.so
mips-openwrt-linux-uclibc-gcc -pthread -fno-strict-aliasing -DNDEBUG -g \
-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC \
-I/home/sonnyyu/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/python2.7 \
-c evdev/ecodes.c -o build/tmp/ecodes.o -std=c99 -Wno-error=declaration-after-statement
mips-openwrt-linux-uclibc-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/tmp/ecodes.o -o build/lib/_ecodes.so

copy all the .so and .py file together for Yun use.

Write comment (0 Comments)

mkdir ~/mysql
cd ~/mysql
nano version.c
#include <my_global.h>
#include <mysql.h>
int main(int argc, char **argv)
{
  printf("MySQL client version: %s\n", mysql_get_client_info());
  exit(0);
} 
mips-openwrt-linux-uclibc-gcc version.c -o version  \
-I${CFLAGS}/mysql -DBIG_JOINS=1  -fno-strict-aliasing   -g \
-L${LDFLAGS}/mysql  \
-L${LDFLAGS} -lmysqlclient -lpthread -lz -lm -lrt -ldl \
-Wl,-rpath-link=${LDFLAGS}
mips-openwrt-linux-uclibc-strip version
scp version [email protected]:/mnt/sda1

Arduino Yun:

opkg update
opkg install libmysqlclient
root@Arduino:/# /mnt/sda1/version
MySQL client version: 5.1.53

Write comment (0 Comments)
mkdir ~/hello
cd ~/hello
nano hello.c
//C hello world example
#include <stdio.h>
int main()
{
  printf("Hello world\n");
  return 0;
}
mips-openwrt-linux-uclibc-gcc -Wall hello.c -o hello
mips-openwrt-linux-uclibc-strip hello
scp hello This email address is being protected from spambots. You need JavaScript enabled to view it.:/mnt/sda1

Arduino Yun:

root@Arduino:/# /mnt/sda1/hello
Hello world

Write comment (0 Comments)

Use https://github.com/arduino/openwrt-yun compile OpenWrt-SDK for Yun.

I enclosed pre-compile OpenWrt-SDK for Yun here.

At Debian 32 bits box:

cd ~
wget -O OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2 https://www.dropbox.com/s/a0yc8oy4vcvmf7q/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2?dl=0
md5sum OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
0e5706c72e433c362cf384c462b86f86
tar -vxjf OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
nano ~/setup.sh
#!/bin/bash
BACKPATH=$PATH
export BACKPATH
PWD=~/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2
PWD2=~/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2
PATH=$PWD/bin:$PATH
export PATH
STAGING_DIR=$PWD
export STAGING_DIR
CFLAGS=$PWD2/usr/include
export CFLAGS
LDFLAGS=$PWD2/usr/lib
export LDFLAGS
source ~/setup.sh



Write comment (0 Comments)