Your patch won't work because you failed to change the calls to "chop_suffix". Also, this would change the requirements on configure from "find a C compiler" to "find something that can indifferently compile C and C++". I'm not sure if that is a big deal or not, but it has to be considered.

This patch is not enough because it won't link the C++ standard library. The only remotely portable way to do so is to remember whether C++ files were used during compiling and invoke g++ (or equivalent) instead of gcc (or equivalent) during linking.

Alternatively you could try detecting how the standard library is named (nontrivial; current OS X has two) and putting it in cma's autolink flags, but I'm not sure if that's a simpler choice.