I think my favorite part of the build process was when we frobnicated libstdc++:
https://github.com/apple/foundationdb/blob/master/Makefile#L...
And then there were the hijinks we went through to build a cross-compiler with modern gcc and ancient libc (plus the steps to make sure no dependency on later glibc symbols snuck in):
https://github.com/apple/foundationdb/blob/master/build/link...
Ahh... now that was a build system.