Patchwork [v2] configure: avoid basename usage message

login
register
mail settings
Submitter Scott Wood
Date April 8, 2011, 7:15 p.m.
Message ID <20110408191550.GA27007@schlenkerla.am.freescale.net>
Download mbox | patch
Permalink /patch/90408/
State New
Headers show

Comments

Scott Wood - April 8, 2011, 7:15 p.m.
basename prints a missing-argument error when sdlconfig is empty
and we're cross-compiling.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v2: quote the input to basename rather than introduce an extra test,
as suggested by Stefan.

 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Stefan Hajnoczi - April 9, 2011, 11:19 a.m.
On Fri, Apr 08, 2011 at 02:15:50PM -0500, Scott Wood wrote:
> basename prints a missing-argument error when sdlconfig is empty
> and we're cross-compiling.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> v2: quote the input to basename rather than introduce an extra test,
> as suggested by Stefan.
> 
>  configure |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

I have merged into the trivial patches tree since $() is POSIX and we
already use it in ./configure:
git://repo.or.cz/qemu/stefanha.git trivial-patches

A pull request will be sent to merge this into qemu.git.  For more
information, see http://wiki.qemu.org/Contribute/TrivialPatches.

Stefan

Patch

diff --git a/configure b/configure
index ae97e11..2bb3faa 100755
--- a/configure
+++ b/configure
@@ -1233,7 +1233,7 @@  else
   fi
   sdl=no
 fi
-if test -n "$cross_prefix" && test "`basename $sdlconfig`" = sdl-config; then
+if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
   echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
 fi