You could just look into the Haiku build system: for instance, the raw translator uses libraw.so using the newer ABI, but uses a very old manual dcraw port when using gcc 2.
I’m not sure if libraw.so uses C++ itself, though, but our translator does.
In any case, it would be nice to get rid of these build differences.