
I hacked up the following M4 macro for Boost a while ago. The version detection might be a bit better in this macro, because it checks the Boost version in the Boost version header (instead of checking the include directory).
Yes I see. In my version I search for the newest boost version and take the version number from that include directory. I should refine my macro, if I find multiple boost installations I could use your approach for the newest directory version. However the fallback alternative with BOOSTROOT looks fine too (CXXFLAGS can be extended by $BOOSTROOT) but how is it possible to determine the linker path (LDFLAGS) in such a case. As long as not installed all the libraries reside in their $BOOSTROOT/bin/boost/libs/<special-dir> ?