Skip to content

Commit

Permalink
tools build: Add test to check if slang.h is in /usr/include/slang/
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
acmel committed Jun 18, 2019
1 parent 1955c8c commit cbefd24
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/build/Makefile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ FEATURE_TESTS_BASIC := \
libpython \
libpython-version \
libslang \
libslang-include-subdir \
libcrypto \
libunwind \
pthread-attr-setaffinity-np \
Expand Down Expand Up @@ -114,7 +115,6 @@ FEATURE_DISPLAY ?= \
numa_num_possible_cpus \
libperl \
libpython \
libslang \
libcrypto \
libunwind \
libdw-dwarf-unwind \
Expand Down
4 changes: 4 additions & 0 deletions tools/build/feature/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ FILES= \
test-libpython.bin \
test-libpython-version.bin \
test-libslang.bin \
test-libslang-include-subdir.bin \
test-libcrypto.bin \
test-libunwind.bin \
test-libunwind-debug-frame.bin \
Expand Down Expand Up @@ -184,6 +185,9 @@ $(OUTPUT)test-libaudit.bin:
$(OUTPUT)test-libslang.bin:
$(BUILD) -lslang

$(OUTPUT)test-libslang-include-subdir.bin:
$(BUILD) -lslang

$(OUTPUT)test-libcrypto.bin:
$(BUILD) -lcrypto

Expand Down
7 changes: 7 additions & 0 deletions tools/build/feature/test-libslang-include-subdir.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <slang/slang.h>

int main(void)
{
return SLsmg_init_smg();
}

0 comments on commit cbefd24

Please sign in to comment.