added macro to write configuration files.

Works for both in-source and installed cases.