Update the build script to make it possible to use basically the same code to compile an extension.