Reattach the licenses for the compat stuff to the source. Only build/link the compat stuff when it's needed. Rename compat/util.h so it's not confused with util.h. Move all the platform specific defines inside compat/compat.h.