I've started work on this. There is more work to be done, but I have got to the stage where I get a clean build out of source (and within it). I've also done the groundwork necessary to get cross build working, but that is not yet complete.
I'll continue to work on that. In the meantime, here are the patches I've done so far. Feel free to commit them or not as you think appropriate, and to discuss any for which you are unsure. Regards, J'