[darwin] improve build script