[b2.x.x] backport into 2.x.x the rev 2348 of trunk

flesh out pkgconfig support for optional libs