Sorry, this post is nothing that a set of links!
It is not a good idea to compile packages right on Raspberry Pi. That could take hours.
Since, I am currently developing my own VoIP image, I need a tool for fast image creation and deployment.
Here is good introduction:
And more links about cross compilation and QEMU (QEMU for emulation and compilation on "Raspberry Pi" environment):