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.
(cherry picked from commit
7eb208005fee18735c7ab6b3d05a7e8c2ab516d8)
echo " localstatedir: $localstatedir"
echo "-------------------------------------------------------------------------------"
echo "Compiler: $CC"
- $CC --version 2>&1 | sed 's/^/ /'
+ if test "$GCC" = "yes"
+then :
+ $CC --version 2>&1 | sed 's/^/ /'
+else $as_nop
+ case $host in #(
+ *-solaris*) :
+ $CC -V 2>&1 | sed 's/^/ /' ;; #(
+ *) :
+ $CC --version 2>&1 | sed 's/^/ /' ;;
+esac
+fi
if test "X$ac_unrecognized_opts" != "X"; then
echo "Unrecognized options:"
echo " localstatedir: $localstatedir"
echo "-------------------------------------------------------------------------------"
echo "Compiler: $CC"
- $CC --version 2>&1 | sed 's/^/ /'
+ AS_IF([test "$GCC" = "yes"],
+ [$CC --version 2>&1 | sed 's/^/ /'],
+ [AS_CASE([$host],
+ [*-solaris*],[$CC -V 2>&1 | sed 's/^/ /'],
+ [$CC --version 2>&1 | sed 's/^/ /'])])
if test "X$ac_unrecognized_opts" != "X"; then
echo "Unrecognized options:"