Skip to contentSkip to conversation

configure: do not quote $PKG_CONFIG

PATCH Superseded Mike Frysinger 5 participants 12 messages Jul 15, 2012 – Jun 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: do not quote $PKG_CONFIG

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

---
 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 83fa1ca..bd12ed3 100755
@@ -245,7 +245,7 @@ strip="${STRIP-${cross_prefix}strip}"
 windres="${WINDRES-${cross_prefix}windres}"
 pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
 query_pkg_config() {
-    "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+    ${pkg_config_exe} ${QEMU_PKG_CONFIG_FLAGS} "$@"
 }
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
@@ -1511,7 +1511,7 @@ fi
 ##########################################
 # pkg-config probe
 
-if ! has "$pkg_config_exe"; then
+if ! has $pkg_config_exe; then
   echo "Error: pkg-config binary '$pkg_config_exe' not found"
   exit 1
 fi
Signature · 1 line
1.7.9.7
#1 lore raw

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 8 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

What about passing custom flags with QEMU_PKG_CONFIG_FLAGS?

Removing the quotes will not allow paths containing spaces, so that's not a good idea.

Regards,

Stefan Weil

Quoted 28 lines
---
  configure |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 83fa1ca..bd12ed3 100755
@@ -245,7 +245,7 @@ strip="${STRIP-${cross_prefix}strip}"
  windres="${WINDRES-${cross_prefix}windres}"
  pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
  query_pkg_config() {
-    "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+    ${pkg_config_exe} ${QEMU_PKG_CONFIG_FLAGS} "$@"
  }
  pkg_config=query_pkg_config
  sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
@@ -1511,7 +1511,7 @@ fi
  ##########################################
  # pkg-config probe
 
-if ! has "$pkg_config_exe"; then
+if ! has $pkg_config_exe; then
    echo "Error: pkg-config binary '$pkg_config_exe' not found"
    exit 1
  fi
#2 lore raw
Quoted 6 lines · On Sunday 15 July 2012 15:54:51 Stefan Weil wrote:

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 5 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Quoted 8 lines
Quoted 3 lines

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

What about passing custom flags with QEMU_PKG_CONFIG_FLAGS?

Removing the quotes will not allow paths containing spaces, so that's not a good idea.

except that doesn't work with other build variables (like CC/etc...), nor does it work with the standard pkg-config build environments. making qemu deviate from the standard to support non-existent setups makes no sense. -mike

#3 lore raw
In reply to Stefan Weil
Quoted 11 lines · Stefan Weil

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 8 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

Quoted 4 lines

What about passing custom flags with QEMU_PKG_CONFIG_FLAGS?

Removing the quotes will not allow paths containing spaces, so that's not a good idea.

Actually, it IS a good idea. The de facto standard build environment requires that pkg-config is not allowed to live in a path containing spaces, precisely so that you can override the variable to pass options to your preferred location of pkg-config; and if your build setup is truly so messed up as to have pkg-config installed in a canonical location with spaces, then you can also tweak your unusual environment to provide a symlink to pkg-config that does not contain spaces as the workaround.

Signature · 2 lines
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#4 lore raw

Am 16.07.2012 17:39, schrieb Eric Blake:

Quoted 17 lines · Stefan Weil
Quoted 11 lines

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 8 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

Quoted 4 lines

What about passing custom flags with QEMU_PKG_CONFIG_FLAGS?

Removing the quotes will not allow paths containing spaces, so that's not a good idea.

Quoted 8 lines

Actually, it IS a good idea. The de facto standard build environment requires that pkg-config is not allowed to live in a path containing spaces, precisely so that you can override the variable to pass options to your preferred location of pkg-config; and if your build setup is truly so messed up as to have pkg-config installed in a canonical location with spaces, then you can also tweak your unusual environment to provide a symlink to pkg-config that does not contain spaces as the workaround.

That sounds reasonable. Then the following patch was at least partially unnecessary:

commit 17884d7b6462b0fe497f08fec6091ffbe04caa8d

Author: Sergei Trofimovich <[email protected]>
Date:   Tue Jan 31 22:03:45 2012 +0300

./configure: request pkg-config to provide private libs when static
linking

Added wrapper around pkg-config to allow:
- safe options injection via ${QEMU_PKG_CONFIG_FLAGS}
- spaces in path to pkg-config

With Mike's new patch, QEMU_PKG_CONFIG_FLAGS is no longer needed because options can be passed using the pkg-config macro. I suggest to remove it.

Regards,

Stefan W.

#5 lore raw
Quoted 40 lines · On Monday 16 July 2012 11:58:55 Stefan Weil wrote:

Am 16.07.2012 17:39, schrieb Eric Blake:

Quoted 16 lines · Stefan Weil
Quoted 6 lines

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 5 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Quoted 8 lines
Quoted 3 lines

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

What about passing custom flags with QEMU_PKG_CONFIG_FLAGS?

Removing the quotes will not allow paths containing spaces, so that's not a good idea.

Quoted 8 lines

Actually, it IS a good idea. The de facto standard build environment requires that pkg-config is not allowed to live in a path containing spaces, precisely so that you can override the variable to pass options to your preferred location of pkg-config; and if your build setup is truly so messed up as to have pkg-config installed in a canonical location with spaces, then you can also tweak your unusual environment to provide a symlink to pkg-config that does not contain spaces as the workaround.

That sounds reasonable. Then the following patch was at least partially unnecessary:

commit 17884d7b6462b0fe497f08fec6091ffbe04caa8d

Author: Sergei Trofimovich <[email protected]>
Date:   Tue Jan 31 22:03:45 2012 +0300

./configure: request pkg-config to provide private libs when static
linking

Added wrapper around pkg-config to allow:
- safe options injection via ${QEMU_PKG_CONFIG_FLAGS}
- spaces in path to pkg-config

Quoted 7 lines

With Mike's new patch, QEMU_PKG_CONFIG_FLAGS is no longer needed because options can be passed using the pkg-config macro. I suggest to remove it.

i'm ambivalent on the additional functionality that qemu provides in its build system -- i'm just concerned with the baseline being the same as all other build systems. some people probably find this handy.
-mike

#6 lore raw
In reply to Stefan Weil
Quoted 9 lines · On Sunday 15 July 2012 15:54:51 Stefan Weil wrote:

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 8 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

ping ...
-mike

#7 lore raw

Am 16.09.2012 21:52, schrieb Mike Frysinger:

Quoted 7 lines · On Sunday 15 July 2012 15:54:51 Stefan Weil wrote:
Quoted 6 lines

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 5 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

ping ...
-mike

The complete discussion is here: http://patchwork.ozlabs.org/patch/171087/.

I suggested using Mike's patch and removing commit 17884d7b6462b0fe497f08fec6091ffbe04caa8d. (./configure: request pkg-config to provide private libs when static linking).

Anthony, Sergei, any comments?

Regards
Stefan

#8 lore raw
Quoted 14 lines · On Sun, 16 Sep 2012 22:21:31 +0200 Stefan Weil <[email protected]> wrote:

Am 16.09.2012 21:52, schrieb Mike Frysinger:

Quoted 7 lines · On Sunday 15 July 2012 15:54:51 Stefan Weil wrote:
Quoted 6 lines

Am 15.07.2012 22:26, schrieb Mike Frysinger:

Quoted 5 lines

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

ping ...
-mike

Quoted 8 lines

The complete discussion is here: http://patchwork.ozlabs.org/patch/171087/.

I suggested using Mike's patch and removing commit 17884d7b6462b0fe497f08fec6091ffbe04caa8d. (./configure: request pkg-config to provide private libs when static linking).

Anthony, Sergei, any comments?

I'm fine with Mke's patch.

Signature · 1 line
  Sergei
#9 lore raw
In reply to Mike Frysinger
Quoted 10 lines · Mike Frysinger

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

This doesn't make any sense to me. What is the command line that
you're trying to execute?

This obviously would introduce a bug if there was a space in the filename of the pkg-config binary.

Regards,

Anthony Liguori

Quoted 28 lines
---
 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 83fa1ca..bd12ed3 100755
@@ -245,7 +245,7 @@ strip="${STRIP-${cross_prefix}strip}"
 windres="${WINDRES-${cross_prefix}windres}"
 pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
 query_pkg_config() {
-    "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+    ${pkg_config_exe} ${QEMU_PKG_CONFIG_FLAGS} "$@"
 }
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
@@ -1511,7 +1511,7 @@ fi
 ##########################################
 # pkg-config probe
 
-if ! has "$pkg_config_exe"; then
+if ! has $pkg_config_exe; then
   echo "Error: pkg-config binary '$pkg_config_exe' not found"
   exit 1
 fi
Signature · 1 line
1.7.9.7
#10 lore raw
Quoted 11 lines · Anthony Liguori
Quoted 9 lines · Mike Frysinger

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

Quoted 7 lines
Quoted 1 line

This doesn't make any sense to me. What is the command line that
you're trying to execute?

This obviously would introduce a bug if there was a space in the filename of the pkg-config binary.

Except that the de facto standard is that the pkg-config binary already is prohibited from having a space in the filename.

https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02015.html

Signature · 2 lines
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#11 lore raw

PATCH v2 1/1 configure: do not quote $PKG_CONFIG

In reply to Mike Frysinger

We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment.

Ultimately, the point is that it breaks passing custom flags directly to pkg-config via the env var where this normally works elsewhere, and it used to work in the past.

---
v2
- rebased onto latest master
- people were happy with this in the previous thread:
http://permalink.gmane.org/gmane.comp.emulators.qemu/160198

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 95dc66b..9c14ab6 100755
@@ -291,7 +291,7 @@ strip="${STRIP-${cross_prefix}strip}"
 windres="${WINDRES-${cross_prefix}windres}"
 pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
 query_pkg_config() {
-    "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+    ${pkg_config_exe} ${QEMU_PKG_CONFIG_FLAGS} "$@"
 }
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
@@ -1424,7 +1424,7 @@ fi
 ##########################################
 # pkg-config probe
 
-if ! has "$pkg_config_exe"; then
+if ! has $pkg_config_exe; then
   error_exit "pkg-config binary '$pkg_config_exe' not found"
 fi
 
Signature · 1 line
1.8.2.1