Backporting build and profiling script improvements from R1 back to trunk.
Authored by: m0slevin 2014-10-18
Parent: [r185]
Child: [r187]