new (preliminary) version of gen_setups.py

Does not work for the moment
Ran 'update-setup-h' and looks like line endings were changed.