Skip to contentSkip to conversation

configure: define "pkg-config" in addition to "pkgconfig"

PATCH In review Paolo Bonzini 2 participants 2 messages Oct 17, 2023 – Oct 18, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: define "pkg-config" in addition to "pkgconfig"

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

---
 configure | 1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index 8827a29bf4c..b4ea78c77d8 100755
@@ -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
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Paolo Bonzini

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

---
  configure | 1 +
  1 file changed, 1 insertion(+)
configure +0 -0
index 8827a29bf4c..b4ea78c77d8 100755

configure if test "$skip_meson" = no; then · line 1742

Quoted 7 lines
configure +1 -0
@@ -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