Build scripts for SVN-20140519
merge upstream changes