From: Ondřej Surý Date: Mon, 11 Oct 2021 19:18:49 +0000 (+0200) Subject: Use correct compiler version flag in the autoconf script X-Git-Tag: v9.16.23~16^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=36f97713a181ba7435b1165082f12d492971f096;p=thirdparty%2Fbind9.git 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. (cherry picked from commit 7eb208005fee18735c7ab6b3d05a7e8c2ab516d8) --- diff --git a/configure b/configure index a56ea160c20..b92d3c8bde8 100755 --- a/configure +++ b/configure @@ -26474,7 +26474,17 @@ fi 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:" diff --git a/configure.ac b/configure.ac index e0b4d79a74d..e29f506e478 100644 --- a/configure.ac +++ b/configure.ac @@ -3092,7 +3092,11 @@ report() { 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:"