Add x86_64-darwin build, and fix the platform dependent builds, as the system wasn't passed through properly.