]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use correct compiler version flag in the autoconf script
authorOndřej Surý <ondrej@sury.org>
Mon, 11 Oct 2021 19:18:49 +0000 (21:18 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 18 Oct 2021 13:27:18 +0000 (15:27 +0200)
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)

configure
configure.ac

index a56ea160c205db2c2a96feb2120682cd7b4103ee..b92d3c8bde8e442677cc1dcbd4e7cd7c08518c8e 100755 (executable)
--- a/configure
+++ b/configure
     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:"
index e0b4d79a74d3b328f6a967c11924a5e98ae2b632..e29f506e4789195b9742dbebb11fb4007bf93800 100644 (file)
@@ -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:"