Skip to content

Commit cbefd24

Browse files
committed
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: 1955c8c ("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>
1 parent 1955c8c commit cbefd24

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎tools/build/Makefile.feature‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ FEATURE_TESTS_BASIC := \
5353
libpython \
5454
libpython-version \
5555
libslang \
56+
libslang-include-subdir \
5657
libcrypto \
5758
libunwind \
5859
pthread-attr-setaffinity-np \
@@ -114,7 +115,6 @@ FEATURE_DISPLAY ?= \
114115
numa_num_possible_cpus \
115116
libperl \
116117
libpython \
117-
libslang \
118118
libcrypto \
119119
libunwind \
120120
libdw-dwarf-unwind \

‎tools/build/feature/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ FILES= \
3131
test-libpython.bin \
3232
test-libpython-version.bin \
3333
test-libslang.bin \
34+
test-libslang-include-subdir.bin \
3435
test-libcrypto.bin \
3536
test-libunwind.bin \
3637
test-libunwind-debug-frame.bin \
@@ -184,6 +185,9 @@ $(OUTPUT)test-libaudit.bin:
184185
$(OUTPUT)test-libslang.bin:
185186
$(BUILD) -lslang
186187

188+
$(OUTPUT)test-libslang-include-subdir.bin:
189+
$(BUILD) -lslang
190+
187191
$(OUTPUT)test-libcrypto.bin:
188192
$(BUILD) -lcrypto
189193

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <slang/slang.h>
3+
4+
int main(void)
5+
{
6+
return SLsmg_init_smg();
7+
}

0 commit comments

Comments
 (0)