make local copies of necessary macros, update build system