Support cross compilation.

Also add more utilities to copy and clean stuff.