Allow config.site to be read by configure at the appropriate time

Boost M4 macros have been restructured so that a call to
AC_USE_SYSTEM_EXTENSIONS is no longer required, this was preventing config.site
from being read initially by configure, thus some of its definitions were being
lost
Honour C++ compiler; include boost in linking
Further improvements to build config on OS X

Generation of dependency files to use C++ compiler and include CXXFLAGS
Removed duplicate typedef definitions (illegal in C)
Give locale2charset prototype C linkage