Use environment variables instead. This repairs 'make distcheck', which was running into trouble when it tried to chmod the generated scripts. Fixes 17148.