“iSamepi”

目指せ情強。映画好きの情弱がいろいろ頑張って調べたことをまとめるブログ。

node.js + socket.io on ARM

Do you want to use node.js on ARM devices?
So I do, but how?

ARM is the one of architecture of chips on boards.
The target of this article is ARM 32bit, cortex-A9.

For ARM devices, you have to do "Cross Compile".
We are going to compile node.js on Linux machine for ARM.
So, compiled modules run on ARM devices, not on Linux.

Shortly, for node.js, you can do as follows.
1. you have to prepare compilers for arm
2. set some environments correctly ( Makefile )
3. make clean, make, make install

Most important step is 2.
May be you will set these at least in step 2.
     AR
     CC
     CXX
     LINK

    then ./configure needs few options as follow
     ./configure --without-snapshot --dest-cpu=arm --dest-os=linux

Now, node.js is OK. But how about socket.io?
You already have node.js on Linux, I believe.

Socket.io will be compiled on node.js by npm.
So, it need not to do "Cross Compile".

Concept; 
On Linux:   [ Linux      [ node.js  [ socket.io ]  ]    ]
On ARM:    [ ARM      [ node.js  [ socket.io ]  ]    ]

Then you can just copy socket.io modules to ARM from Linux.
You have to, however, set PATHs manually.
This PATH resettings are quite a lot, but have to do...


Happy ARM life !