]> git.proxmox.com Git - mirror_qemu.git/commitdiff
configure: Fix shell syntax to placate OpenBSD's pdksh
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 14 Dec 2015 15:02:36 +0000 (15:02 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 18 Dec 2015 13:32:49 +0000 (13:32 +0000)
Unfortunately the OpenBSD pdksh does not like brackets inside
the right part of a ${variable+word} parameter expansion:

  $ echo "${a+($b)}"
  ksh: ${a+($b)}": bad substitution

though both bash and dash accept them. In any case this line
was causing odd output in the case where nettle is not present:
  nettle    no ()

(because if nettle is not present then $nettle will be "no",
not a null string or unset).

Rewrite it to just use an if.

This bug was originally introduced in becaeb726 and was present
in the 2.4.0 release.

Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
Reported-by: Dmitrij D. Czarkoff
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1450105357-8516-1-git-send-email-peter.maydell@linaro.org

configure

index 375f103a2c52d6cf3749d760e1263046a24339ae..83b40fc906448bef43fe9a6faf5941a08c015b1a 100755 (executable)
--- a/configure
+++ b/configure
@@ -4766,7 +4766,11 @@ echo "GTK GL support    $gtk_gl"
 echo "GNUTLS support    $gnutls"
 echo "GNUTLS hash       $gnutls_hash"
 echo "libgcrypt         $gcrypt"
-echo "nettle            $nettle ${nettle+($nettle_version)}"
+if test "$nettle" = "yes"; then
+    echo "nettle            $nettle ($nettle_version)"
+else
+    echo "nettle            $nettle"
+fi
 echo "libtasn1          $tasn1"
 echo "VTE support       $vte"
 echo "curses support    $curses"