perf build: don't hardcode pkg-config path

Message ID e0fc158239e73f22405c78d5b3219c266e3763be.1705506665.git.jan.kundrat@cesnet.cz
State New
Headers
Series perf build: don't hardcode pkg-config path |

Commit Message

Jan Kundrát Jan. 17, 2024, 3:50 p.m. UTC
  On Buildroot and when building for Arm using the Bootlin toolchain, the
actual `pkg-config` is named just `pkg-config`, not
`arm-linux-pkg-config`. This patch allows the external build system
(such as Buildroot) to pass a working path.

This is already done correctly in tools/build/feature/Makefile and
tools/thermal/tmon/Makefile and also fixed in other places many years
ago (9961aa665b70e47d6c80141c4a2482266010f246), but for some reason it
was never fixed in this file.

Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
To: linux-perf-users@vger.kernel.org
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: linux-kernel@vger.kernel.org
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Namhyung Kim Jan. 19, 2024, 5:16 a.m. UTC | #1
Hello,

On Wed, Jan 17, 2024 at 7:58 AM Jan Kundrát <jan.kundrat@cesnet.cz> wrote:
>
> On Buildroot and when building for Arm using the Bootlin toolchain, the
> actual `pkg-config` is named just `pkg-config`, not
> `arm-linux-pkg-config`. This patch allows the external build system
> (such as Buildroot) to pass a working path.
>
> This is already done correctly in tools/build/feature/Makefile and
> tools/thermal/tmon/Makefile and also fixed in other places many years
> ago (9961aa665b70e47d6c80141c4a2482266010f246), but for some reason it
> was never fixed in this file.
>
> Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
> To: linux-perf-users@vger.kernel.org
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: linux-kernel@vger.kernel.org

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/Makefile.perf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 86569f230e60..b69ab2ae77c6 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -188,7 +188,7 @@ HOSTLD  ?= ld
>  HOSTAR  ?= ar
>  CLANG   ?= clang
>
> -PKG_CONFIG = $(CROSS_COMPILE)pkg-config
> +PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
>
>  RM      = rm -f
>  LN      = ln -f
> --
> 2.43.0
>
>
>
  

Patch

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 86569f230e60..b69ab2ae77c6 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -188,7 +188,7 @@  HOSTLD  ?= ld
 HOSTAR  ?= ar
 CLANG   ?= clang
 
-PKG_CONFIG = $(CROSS_COMPILE)pkg-config
+PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
 
 RM      = rm -f
 LN      = ln -f