maven-nar/cpptasks-parallel — pull request #16 by ctrueden (2013-11-26 18:26:55+00:00)
Title: Add support for the clang compiler

Rebased from PRs #14 and #15. Thanks @dscho!

@toonetown writes:
> This came from the diff at http://jogamp.org/git/?p=ant-cpptasks.git;a=commitdiff;h=2cdd1070056c0f7e9dc7f40de19c2bfdfef0432a;hp=2603158cb1a0ff29f5a23de4c0ba2ce759f574cf. It is fairly straightforward, and adds support for specifying either `clang` or `clang++` as a compiler

@ctrueden writes:
> On OS X 10.9 Mavericks, LLVM with clang is now used. This branch adds case logic to the `GppLinker` implementation to handle clang's incompatibilities with gcc, notably the unsupported `-static-libgcc` and `-shared-libgcc` flags.
>
> I am far from a C++ expert, so would appreciate code review here. In particular, I suspect that simply suppressing the `-lstdc++-static` flag is the wrong solution. (10.9 also uses libc++ instead of libstdc++ now; but `-lc++-static` also doesn't work...)
>
> Note that the first three commits are merely to support the new `isClang()` method of `GppLinker`, which needs to call out to `g++ --version` to check that. The `CaptureStreamHandler` previously had an annoying limitation where `CaptureStreamHandler.run` would return only stderr if it was nonempty—and `g++ --version` happens to return a mixture of stderr and stdout. So now the `execute` method provides a way to request stdout specifically, which is what we need here.