Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/build: Add libcpupower dependency detection

Add the ability to detect the presence of libcpupower on a system to
the Makefiles in tools/build.

Link: https://lore.kernel.org/20241017140914.3200454-2-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Tomas Glozar and committed by
Steven Rostedt (Google)
0f59a6c9 76b31021

+13
+1
tools/build/Makefile.feature
··· 53 53 libslang-include-subdir \ 54 54 libtraceevent \ 55 55 libtracefs \ 56 + libcpupower \ 56 57 libcrypto \ 57 58 libunwind \ 58 59 pthread-attr-setaffinity-np \
+4
tools/build/feature/Makefile
··· 38 38 test-libslang.bin \ 39 39 test-libslang-include-subdir.bin \ 40 40 test-libtraceevent.bin \ 41 + test-libcpupower.bin \ 41 42 test-libtracefs.bin \ 42 43 test-libcrypto.bin \ 43 44 test-libunwind.bin \ ··· 245 244 246 245 $(OUTPUT)test-libtraceevent.bin: 247 246 $(BUILD) -ltraceevent 247 + 248 + $(OUTPUT)test-libcpupower.bin: 249 + $(BUILD) -lcpupower 248 250 249 251 $(OUTPUT)test-libtracefs.bin: 250 252 $(BUILD) $(shell $(PKG_CONFIG) --cflags libtracefs 2>/dev/null) -ltracefs
+8
tools/build/feature/test-libcpupower.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <cpuidle.h> 3 + 4 + int main(void) 5 + { 6 + int rv = cpuidle_state_count(0); 7 + return rv; 8 + }