[PATCH] configure: define "pkg-config" in addition to "pkgconfig"

Paolo Bonzini posted 1 patch 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231017153649.309128-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>
configure | 1 +
1 file changed, 1 insertion(+)
[PATCH] configure: define "pkg-config" in addition to "pkgconfig"
Posted by Paolo Bonzini 7 months ago
Meson used to allow both "pkgconfig" and "pkg-config" entries in machine
files; the former was used for dependency lookup and the latter
was used as return value for "find_program('pkg-config')", which is a less
common use-case and one that QEMU does not need.

This inconsistency is going to be fixed by Meson 1.3, which will deprecate
"pkgconfig" in favor of "pkg-config" (the less common one, but it makes
sense because it matches the name of the binary). For backward
compatibility it is still allowed to define both, so do that in the
configure-generated machine file.

Related: https://github.com/mesonbuild/meson/pull/12385
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 8827a29bf4c..b4ea78c77d8 100755
--- a/configure
+++ b/configure
@@ -1736,6 +1736,7 @@ if test "$skip_meson" = no; then
   echo "ar = [$(meson_quote $ar)]" >> $cross
   echo "nm = [$(meson_quote $nm)]" >> $cross
   echo "pkgconfig = [$(meson_quote $pkg_config)]" >> $cross
+  echo "pkg-config = [$(meson_quote $pkg_config)]" >> $cross
   echo "ranlib = [$(meson_quote $ranlib)]" >> $cross
   if has $sdl2_config; then
     echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross
-- 
2.41.0
Re: [PATCH] configure: define "pkg-config" in addition to "pkgconfig"
Posted by Thomas Huth 7 months ago
On 17/10/2023 17.36, Paolo Bonzini wrote:
> Meson used to allow both "pkgconfig" and "pkg-config" entries in machine
> files; the former was used for dependency lookup and the latter
> was used as return value for "find_program('pkg-config')", which is a less
> common use-case and one that QEMU does not need.
> 
> This inconsistency is going to be fixed by Meson 1.3, which will deprecate
> "pkgconfig" in favor of "pkg-config" (the less common one, but it makes
> sense because it matches the name of the binary). For backward
> compatibility it is still allowed to define both, so do that in the
> configure-generated machine file.
> 
> Related: https://github.com/mesonbuild/meson/pull/12385
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 8827a29bf4c..b4ea78c77d8 100755
> --- a/configure
> +++ b/configure
> @@ -1736,6 +1736,7 @@ if test "$skip_meson" = no; then
>     echo "ar = [$(meson_quote $ar)]" >> $cross
>     echo "nm = [$(meson_quote $nm)]" >> $cross
>     echo "pkgconfig = [$(meson_quote $pkg_config)]" >> $cross
> +  echo "pkg-config = [$(meson_quote $pkg_config)]" >> $cross
>     echo "ranlib = [$(meson_quote $ranlib)]" >> $cross
>     if has $sdl2_config; then
>       echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross

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