[Qemu-devel] [PATCH] configure: fix sdl detection using sdl2-config

Carlo Marcelo Arenas Belón posted 1 patch 4 years, 9 months ago
Test checkpatch passed
Test s390x passed
Test asan passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190710225528.409-1-carenas@gmail.com
configure | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH] configure: fix sdl detection using sdl2-config
Posted by Carlo Marcelo Arenas Belón 4 years, 9 months ago
If SDL2 is requested but pkg-config doesn't have a module for it
configure should fallback to use sdl*-config, but wasn't able to
because and old variable (from SDL) was being used by mistake.

Correct the variable name and complete other related changes so
there are no more references to the old SDL.

Fixes: 0015ca5cbabe ("ui: remove support for SDL1.2 in favour of SDL2")
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 configure | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 4983c8b533..0f88ba98a6 100755
--- a/configure
+++ b/configure
@@ -3016,15 +3016,15 @@ fi
 ##########################################
 # SDL probe
 
-# Look for sdl configuration program (pkg-config or sdl-config).  Try
-# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
+# Look for sdl configuration program (pkg-config or sdl2-config).  Try
+# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config.
 
 sdl_probe ()
 {
   if $pkg_config sdl2 --exists; then
     sdlconfig="$pkg_config sdl2"
     sdlversion=$($sdlconfig --modversion 2>/dev/null)
-  elif has ${sdl_config}; then
+  elif has "$sdl2_config"; then
     sdlconfig="$sdl2_config"
     sdlversion=$($sdlconfig --version)
   else
@@ -3035,7 +3035,7 @@ sdl_probe ()
     # no need to do the rest
     return
   fi
-  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
+  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then
     echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
   fi
 
@@ -8019,7 +8019,6 @@ preserve_env PKG_CONFIG
 preserve_env PKG_CONFIG_LIBDIR
 preserve_env PKG_CONFIG_PATH
 preserve_env PYTHON
-preserve_env SDL_CONFIG
 preserve_env SDL2_CONFIG
 preserve_env SMBD
 preserve_env STRIP
-- 
2.22.0


Re: [Qemu-devel] [PATCH] configure: fix sdl detection using sdl2-config
Posted by Laurent Vivier 4 years, 8 months ago
Le 11/07/2019 à 00:55, Carlo Marcelo Arenas Belón a écrit :
> If SDL2 is requested but pkg-config doesn't have a module for it
> configure should fallback to use sdl*-config, but wasn't able to
> because and old variable (from SDL) was being used by mistake.
> 
> Correct the variable name and complete other related changes so
> there are no more references to the old SDL.
> 
> Fixes: 0015ca5cbabe ("ui: remove support for SDL1.2 in favour of SDL2")
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  configure | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 4983c8b533..0f88ba98a6 100755
> --- a/configure
> +++ b/configure
> @@ -3016,15 +3016,15 @@ fi
>  ##########################################
>  # SDL probe
>  
> -# Look for sdl configuration program (pkg-config or sdl-config).  Try
> -# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
> +# Look for sdl configuration program (pkg-config or sdl2-config).  Try
> +# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config.
>  
>  sdl_probe ()
>  {
>    if $pkg_config sdl2 --exists; then
>      sdlconfig="$pkg_config sdl2"
>      sdlversion=$($sdlconfig --modversion 2>/dev/null)
> -  elif has ${sdl_config}; then
> +  elif has "$sdl2_config"; then
>      sdlconfig="$sdl2_config"
>      sdlversion=$($sdlconfig --version)
>    else
> @@ -3035,7 +3035,7 @@ sdl_probe ()
>      # no need to do the rest
>      return
>    fi
> -  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
> +  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then
>      echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
>    fi
>  
> @@ -8019,7 +8019,6 @@ preserve_env PKG_CONFIG
>  preserve_env PKG_CONFIG_LIBDIR
>  preserve_env PKG_CONFIG_PATH
>  preserve_env PYTHON
> -preserve_env SDL_CONFIG
>  preserve_env SDL2_CONFIG
>  preserve_env SMBD
>  preserve_env STRIP
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



Re: [Qemu-devel] [PATCH] configure: fix sdl detection using sdl2-config
Posted by Philippe Mathieu-Daudé 4 years, 9 months ago
Cc'ing Gerd

On 7/11/19 12:55 AM, Carlo Marcelo Arenas Belón wrote:
> If SDL2 is requested but pkg-config doesn't have a module for it
> configure should fallback to use sdl*-config, but wasn't able to
> because and old variable (from SDL) was being used by mistake.
> 
> Correct the variable name and complete other related changes so
> there are no more references to the old SDL.
> 
> Fixes: 0015ca5cbabe ("ui: remove support for SDL1.2 in favour of SDL2")
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  configure | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 4983c8b533..0f88ba98a6 100755
> --- a/configure
> +++ b/configure
> @@ -3016,15 +3016,15 @@ fi
>  ##########################################
>  # SDL probe
>  
> -# Look for sdl configuration program (pkg-config or sdl-config).  Try
> -# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
> +# Look for sdl configuration program (pkg-config or sdl2-config).  Try
> +# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config.
>  
>  sdl_probe ()
>  {
>    if $pkg_config sdl2 --exists; then
>      sdlconfig="$pkg_config sdl2"
>      sdlversion=$($sdlconfig --modversion 2>/dev/null)
> -  elif has ${sdl_config}; then
> +  elif has "$sdl2_config"; then
>      sdlconfig="$sdl2_config"
>      sdlversion=$($sdlconfig --version)
>    else
> @@ -3035,7 +3035,7 @@ sdl_probe ()
>      # no need to do the rest
>      return
>    fi
> -  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
> +  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then
>      echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
>    fi
>  
> @@ -8019,7 +8019,6 @@ preserve_env PKG_CONFIG
>  preserve_env PKG_CONFIG_LIBDIR
>  preserve_env PKG_CONFIG_PATH
>  preserve_env PYTHON
> -preserve_env SDL_CONFIG
>  preserve_env SDL2_CONFIG
>  preserve_env SMBD
>  preserve_env STRIP
> 

Re: [Qemu-devel] [PATCH] configure: fix sdl detection using sdl2-config
Posted by Thomas Huth 4 years, 9 months ago
On 11/07/2019 00.55, Carlo Marcelo Arenas Belón wrote:
> If SDL2 is requested but pkg-config doesn't have a module for it
> configure should fallback to use sdl*-config, but wasn't able to
> because and old variable (from SDL) was being used by mistake.
> 
> Correct the variable name and complete other related changes so
> there are no more references to the old SDL.
> 
> Fixes: 0015ca5cbabe ("ui: remove support for SDL1.2 in favour of SDL2")
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  configure | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 4983c8b533..0f88ba98a6 100755
> --- a/configure
> +++ b/configure
> @@ -3016,15 +3016,15 @@ fi
>  ##########################################
>  # SDL probe
>  
> -# Look for sdl configuration program (pkg-config or sdl-config).  Try
> -# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
> +# Look for sdl configuration program (pkg-config or sdl2-config).  Try
> +# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config.
>  
>  sdl_probe ()
>  {
>    if $pkg_config sdl2 --exists; then
>      sdlconfig="$pkg_config sdl2"
>      sdlversion=$($sdlconfig --modversion 2>/dev/null)
> -  elif has ${sdl_config}; then
> +  elif has "$sdl2_config"; then
>      sdlconfig="$sdl2_config"
>      sdlversion=$($sdlconfig --version)
>    else
> @@ -3035,7 +3035,7 @@ sdl_probe ()
>      # no need to do the rest
>      return
>    fi
> -  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
> +  if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then
>      echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
>    fi
>  
> @@ -8019,7 +8019,6 @@ preserve_env PKG_CONFIG
>  preserve_env PKG_CONFIG_LIBDIR
>  preserve_env PKG_CONFIG_PATH
>  preserve_env PYTHON
> -preserve_env SDL_CONFIG
>  preserve_env SDL2_CONFIG
>  preserve_env SMBD
>  preserve_env STRIP
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>