Further work to get build working correctly on *BSD.