Commit 76785231 authored by Namhyung Kim's avatar Namhyung Kim
Browse files

tools/build: Add a feature test for libopenssl



It's used by bpftool and the kernel build.  Let's add a feature test so
that perf can decide what to do based on the availability.

Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 8f0b4cce
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -99,7 +99,8 @@ FEATURE_TESTS_BASIC := \
        libzstd				\
        disassembler-four-args		\
        disassembler-init-styled	\
        file-handle
        file-handle			\
        libopenssl

# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
# of all feature tests
@@ -147,7 +148,8 @@ FEATURE_DISPLAY ?= \
         lzma                   \
         bpf			\
         libaio			\
         libzstd
         libzstd		\
         libopenssl

#
# Declare group members of a feature to display the logical OR of the detection
+6 −2
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@ FILES= \
         test-libzstd.bin			\
         test-clang-bpf-co-re.bin		\
         test-file-handle.bin			\
         test-libpfm4.bin
         test-libpfm4.bin			\
         test-libopenssl.bin

FILES := $(addprefix $(OUTPUT),$(FILES))

@@ -381,6 +382,9 @@ $(OUTPUT)test-file-handle.bin:
$(OUTPUT)test-libpfm4.bin:
	$(BUILD) -lpfm

$(OUTPUT)test-libopenssl.bin:
	$(BUILD) -lssl

$(OUTPUT)test-bpftool-skeletons.bin:
	$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
		> $(@:.bin=.make.output) 2>&1
+5 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@
# include "test-libtraceevent.c"
#undef main

#define main main_test_libopenssl
# include "test-libopenssl.c"
#undef main

int main(int argc, char *argv[])
{
	main_test_libpython();
@@ -173,6 +177,7 @@ int main(int argc, char *argv[])
	main_test_reallocarray();
	main_test_libzstd();
	main_test_libtraceevent();
	main_test_libopenssl();

	return 0;
}
+7 −0
Original line number Diff line number Diff line
#include <openssl/ssl.h>
#include <openssl/opensslv.h>

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