Use correct compiler version flag in the autoconf script.
The autoconf script prints used compiler version at the end of the configure script. Solaris native compiler doesn't support --version, and -V has to be used which in turn isn't supported by Gcc/Clang. Detect which version flag has to be used and call $CC with it.
Closes #2873 (closed)
Edited by Ondřej Surý