In my setup, the needed libraries are not under /lib or /usr/lib, so for "configure" and "rake" I use a wrapper, which looks like:
env LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" ./configure
env LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" rake
Without the proposed patch, some libraries are not found by the configure script. The "CFLAGS --> CXXFLAGS" change is just cosmetics, feel free to omit it, my setup does not depend on it, but i think, that this way is more correct.
Use CPPFLAGS and LDFLAGS when checking libraries, after all, they are…
… also used afterwards for the real compilation and linking.
Use CXXFLAGS instead of CFLAGS when compiling c++.
This pull request passes (merged bce2db8 into 8cf8366).