Merged in bchretien's mods to the build scripts.