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

tools build: Add test to check if slang.h is in /usr/include/slang/

A few odd old distros (rhel5, 6, yeah, lots of those out in use, in many
cases we want to use upstream perf on it) have the slang header files in
/usr/include/slang/, so add a test that will be performed only when
test-all.c (the one with the most common sane settings) fails, either
because we're in one of these odd distros with slang/slang.h or because
something else failed (say libelf is not present).

So for the common case nothing changes, no additional test is performed.

Next step is to check in perf the result of these tests.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: 1955c8cf5e26 ("perf tools: Don't hardcode host include path for libslang")
Link: https://lkml.kernel.org/n/tip-2sy7hbwkx68jr6n97qxgg0c6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+12 -1
+1 -1
tools/build/Makefile.feature
··· 53 53 libpython \ 54 54 libpython-version \ 55 55 libslang \ 56 + libslang-include-subdir \ 56 57 libcrypto \ 57 58 libunwind \ 58 59 pthread-attr-setaffinity-np \ ··· 115 114 numa_num_possible_cpus \ 116 115 libperl \ 117 116 libpython \ 118 - libslang \ 119 117 libcrypto \ 120 118 libunwind \ 121 119 libdw-dwarf-unwind \
+4
tools/build/feature/Makefile
··· 31 31 test-libpython.bin \ 32 32 test-libpython-version.bin \ 33 33 test-libslang.bin \ 34 + test-libslang-include-subdir.bin \ 34 35 test-libcrypto.bin \ 35 36 test-libunwind.bin \ 36 37 test-libunwind-debug-frame.bin \ ··· 183 182 $(BUILD) -laudit 184 183 185 184 $(OUTPUT)test-libslang.bin: 185 + $(BUILD) -lslang 186 + 187 + $(OUTPUT)test-libslang-include-subdir.bin: 186 188 $(BUILD) -lslang 187 189 188 190 $(OUTPUT)test-libcrypto.bin:
+7
tools/build/feature/test-libslang-include-subdir.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <slang/slang.h> 3 + 4 + int main(void) 5 + { 6 + return SLsmg_init_smg(); 7 + }