Manually patching the source in a few places, most of the time it's just adding a header file or two since some of them predate ANSI C and the standardized header files. The other things have to do with adding -DHAS_... to force them to know that opendir and friends are actually present, so that make install will actually work.