improve build script
Merge pull request #382 from haiwen/improve_build_script

improve build script