I have taken Daniel Espinosa's patch and improved it so that it fixes all the test failures.
Reuben, thank you very much for dealing with everything, and thanks to Daniel for the original work. make check && make distcheck are working for me now. I have pushed the changes (with fingers crossed) and am closing this bug. -k