Backport. Build system changes.