Updated build scripts

(cherry picked from commit 8256e6f0a35cabb91d66881619e8a4025ab56041)