Skip to contentSkip to conversation

pkg-config default search pathes

RFC PATCH Superseded Silvio Fricke 3 participants 6 messages Aug 11, 2014 – Aug 22, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 pkg-config default search pathes

Hi,

please review this patch.
I'm a little bit unsure if this patch is technicaly state-of-the-art because kbuild does it right. The problem is that some cross-toolchains (on my box is yocto installed) change the pkg-config search pathes to do some package-config setups for cross compiling.
But the init of the toolchain manipulates PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH variables that a pkg-config call searches in the wrong place to find the package and gives back the wrong values which we use to test the availability of ncurses installation and this break the [x,g,menu]config.

Some recommendations for this?

Cheers and thx,
Silvio

Silvio Fricke (1):
kconfig: menuconfig: pkg-config should base upon default configuration

 scripts/kconfig/lxdialog/check-lxdialog.sh | 3 +++
 1 file changed, 3 insertions(+)
Signature · 1 line
2.0.3
#1 lore raw

RFC PATCH 1/1 kconfig: menuconfig: pkg-config should base upon default configuration

Since fc9c6e0 "menuconfig: optionally use pkg-config to detect ncurses libs" we use pkg-config, but some cross toolchains (like yocto tc) change the search pathes for pc files with some PKG_CONFIG_* environment variables.

With this patch we ensure that we only get the host config options for ncurses and don't mix with others not relevant settings.

---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 3 +++
 1 file changed, 3 insertions(+)
scripts/kconfig/lxdialog/check-lxdialog.sh +3 -0
index 9d2a4c5..a067d3c 100644
@@ -1,6 +1,9 @@
 #!/bin/sh
 # Check ncurses compatibility
 
+unset PKG_CONFIG_PATH
+unset PKG_CONFIG_SYSROOT_DIR
+
 # What library to link
 ldflags()
 {
Signature · 1 line
2.0.3
#2 lore raw

Re: [RFC] [PATCH] kconfig: menuconfig: pkg-config should base upon default configuration

Dne 11.8.2014 16:22, Silvio Fricke napsal(a):

Quoted 18 lines

Since fc9c6e0 "menuconfig: optionally use pkg-config to detect ncurses libs" we use pkg-config, but some cross toolchains (like yocto tc) change the search pathes for pc files with some PKG_CONFIG_* environment variables.

With this patch we ensure that we only get the host config options for ncurses and don't mix with others not relevant settings.

---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 3 +++
 1 file changed, 3 insertions(+)
scripts/kconfig/lxdialog/check-lxdialog.sh +0 -0
index 9d2a4c5..a067d3c 100644

scripts/kconfig/lxdialog/check-lxdialog.sh line 5

Quoted 5 lines
scripts/kconfig/lxdialog/check-lxdialog.sh +2 -0
@@ -1,6 +1,9 @@
 #!/bin/sh
 # Check ncurses compatibility
 
+unset PKG_CONFIG_PATH
+unset PKG_CONFIG_SYSROOT_DIR

PKG_CONFIG_SYSROOT_DIR is clearly meant for cross-compiling and we are never cross-compiling kconfig. However, PKG_CONFIG_PATH has valid use cases even when not cross-compiling. Which variables exactly does yocto set?

It might also be a good idea for yocto to special case the kernel and do not set the variables, because we are not cross-compiling any userspace programs.

Michal

#3 lore raw
In reply to Silvio Fricke
Quoted 12 lines · Silvio Fricke

Hi,

please review this patch.
I'm a little bit unsure if this patch is technicaly state-of-the-art because kbuild does it right. The problem is that some cross-toolchains (on my box is yocto installed) change the pkg-config search pathes to do some package-config setups for cross compiling.
But the init of the toolchain manipulates PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH variables that a pkg-config call searches in the wrong place to find the package and gives back the wrong values which we use to test the availability of ncurses installation and this break the [x,g,menu]config.

Quoted 3 lines

Some recommendations for this?

Hi Silvio,

What would happen in a real crosscompile case?

Justin

#4 lore raw

Hi Justin,

2014-08-11 19:23 GMT+02:00 justin <[email protected]>:

Quoted 12 lines · Silvio Fricke
Quoted 10 lines

please review this patch.
I'm a little bit unsure if this patch is technicaly state-of-the-art because kbuild does it right. The problem is that some cross-toolchains (on my box is yocto installed) change the pkg-config search pathes to do some package-config setups for cross compiling.
But the init of the toolchain manipulates PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH variables that a pkg-config call searches in the wrong place to find the package and gives back the wrong values which we use to test the availability of ncurses installation and this break the [x,g,menu]config.

Quoted 3 lines
Quoted 1 line

Some recommendations for this?

What would happen in a real crosscompile case?

In a real crosscompile case we don't have a "crosscompile" [x,g,menu]config. This step is ever made with the host-toolchain. Or I miss something here?

Bye,
Silvio

#5 lore raw
Quoted 16 lines · Silvio Fricke

Hi Justin,

2014-08-11 19:23 GMT+02:00 justin <[email protected]>:

Quoted 12 lines · Silvio Fricke
Quoted 10 lines

please review this patch.
I'm a little bit unsure if this patch is technicaly state-of-the-art because kbuild does it right. The problem is that some cross-toolchains (on my box is yocto installed) change the pkg-config search pathes to do some package-config setups for cross compiling.
But the init of the toolchain manipulates PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH variables that a pkg-config call searches in the wrong place to find the package and gives back the wrong values which we use to test the availability of ncurses installation and this break the [x,g,menu]config.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Some recommendations for this?

What would happen in a real crosscompile case?

In a real crosscompile case we don't have a "crosscompile" [x,g,menu]config. This step is ever made with the host-toolchain. Or I miss something here?

You are right, no need for using crosscompile to configure the kernel. Looks good to me.

Justin