mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Khem Raj <raj.khem@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/power/x86/intel-speed-select: Use pkg-config for libnl-3.0 detection
Date: Tue, 30 Dec 2025 04:40:39 -0800	[thread overview]
Message-ID: <45cfb83557849d022b3b70f060c4702334f0ea8c.camel@linux.intel.com> (raw)
In-Reply-To: <20251229204506.720353-1-raj.khem@gmail.com>

On Mon, 2025-12-29 at 12:45 -0800, Khem Raj wrote:
> Replace hardcoded libnl3 include path with pkg-config detection to
> improve portability across different distributions and build
> environments.
> 
> The previous implementation used a fixed path constructed from the
> compiler's sysroot, which could fail on systems with non-standard
> library installations. Now the build system:
> - Attempts to detect libnl-3.0 include paths using pkg-config
> - Falls back to /usr/include/libnl3 if pkg-config is unavailable
> - Maintains backward compatibility with existing build configurations
> 
> This ensures the tool builds correctly on a wider range of systems
> while preserving existing behavior when pkg-config is not present.
> 

Thanks for the patch. Will include as part of next PULL request.

-Srinivas

> Closes:https://bugzilla.kernel.org/show_bug.cgi?id=220819
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  tools/power/x86/intel-speed-select/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/power/x86/intel-speed-select/Makefile
> b/tools/power/x86/intel-speed-select/Makefile
> index 8d3a02a20f3d..6b299aae2ded 100644
> --- a/tools/power/x86/intel-speed-select/Makefile
> +++ b/tools/power/x86/intel-speed-select/Makefile
> @@ -13,7 +13,13 @@ endif
>  # Do not use make's built-in rules
>  # (this improves performance and avoids hard-to-debug behaviour);
>  MAKEFLAGS += -r
> -override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -
> I$(shell $(CC) -print-sysroot)/usr/include/libnl3
> +
> +NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null)
> +ifeq ($(NL3_CFLAGS),)
> +NL3_CFLAGS = -I/usr/include/libnl3
> +endif
> +
> +override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
> $(NL3_CFLAGS)
>  override LDFLAGS += -lnl-genl-3 -lnl-3
>  
>  ALL_TARGETS := intel-speed-select

      reply	other threads:[~2025-12-30 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 20:45 Khem Raj
2025-12-30 12:40 ` srinivas pandruvada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45cfb83557849d022b3b70f060c4702334f0ea8c.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®