Use AX_PROG_CXX to search for the clang++ and g++ compilers in this order. Clang shipped with FreeBSD 10 is C++11 compliant while gcc is not.