mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
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: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
@@ -99,7 +99,8 @@ FEATURE_TESTS_BASIC := \
|
|||||||
libzstd \
|
libzstd \
|
||||||
disassembler-four-args \
|
disassembler-four-args \
|
||||||
disassembler-init-styled \
|
disassembler-init-styled \
|
||||||
file-handle
|
file-handle \
|
||||||
|
libopenssl
|
||||||
|
|
||||||
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
|
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
|
||||||
# of all feature tests
|
# of all feature tests
|
||||||
@@ -147,7 +148,8 @@ FEATURE_DISPLAY ?= \
|
|||||||
lzma \
|
lzma \
|
||||||
bpf \
|
bpf \
|
||||||
libaio \
|
libaio \
|
||||||
libzstd
|
libzstd \
|
||||||
|
libopenssl
|
||||||
|
|
||||||
#
|
#
|
||||||
# Declare group members of a feature to display the logical OR of the detection
|
# Declare group members of a feature to display the logical OR of the detection
|
||||||
|
|||||||
@@ -67,12 +67,13 @@ FILES= \
|
|||||||
test-libopencsd.bin \
|
test-libopencsd.bin \
|
||||||
test-clang.bin \
|
test-clang.bin \
|
||||||
test-llvm.bin \
|
test-llvm.bin \
|
||||||
test-llvm-perf.bin \
|
test-llvm-perf.bin \
|
||||||
test-libaio.bin \
|
test-libaio.bin \
|
||||||
test-libzstd.bin \
|
test-libzstd.bin \
|
||||||
test-clang-bpf-co-re.bin \
|
test-clang-bpf-co-re.bin \
|
||||||
test-file-handle.bin \
|
test-file-handle.bin \
|
||||||
test-libpfm4.bin
|
test-libpfm4.bin \
|
||||||
|
test-libopenssl.bin
|
||||||
|
|
||||||
FILES := $(addprefix $(OUTPUT),$(FILES))
|
FILES := $(addprefix $(OUTPUT),$(FILES))
|
||||||
|
|
||||||
@@ -381,6 +382,9 @@ $(OUTPUT)test-file-handle.bin:
|
|||||||
$(OUTPUT)test-libpfm4.bin:
|
$(OUTPUT)test-libpfm4.bin:
|
||||||
$(BUILD) -lpfm
|
$(BUILD) -lpfm
|
||||||
|
|
||||||
|
$(OUTPUT)test-libopenssl.bin:
|
||||||
|
$(BUILD) -lssl
|
||||||
|
|
||||||
$(OUTPUT)test-bpftool-skeletons.bin:
|
$(OUTPUT)test-bpftool-skeletons.bin:
|
||||||
$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
|
$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
|
||||||
> $(@:.bin=.make.output) 2>&1
|
> $(@:.bin=.make.output) 2>&1
|
||||||
|
|||||||
@@ -142,6 +142,10 @@
|
|||||||
# include "test-libtraceevent.c"
|
# include "test-libtraceevent.c"
|
||||||
#undef main
|
#undef main
|
||||||
|
|
||||||
|
#define main main_test_libopenssl
|
||||||
|
# include "test-libopenssl.c"
|
||||||
|
#undef main
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
main_test_libpython();
|
main_test_libpython();
|
||||||
@@ -173,6 +177,7 @@ int main(int argc, char *argv[])
|
|||||||
main_test_reallocarray();
|
main_test_reallocarray();
|
||||||
main_test_libzstd();
|
main_test_libzstd();
|
||||||
main_test_libtraceevent();
|
main_test_libtraceevent();
|
||||||
|
main_test_libopenssl();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
7
tools/build/feature/test-libopenssl.c
Normal file
7
tools/build/feature/test-libopenssl.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/opensslv.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return SSL_library_init();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user