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

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>

+22 -4
+4 -2
tools/build/Makefile.feature
··· 99 99 libzstd \ 100 100 disassembler-four-args \ 101 101 disassembler-init-styled \ 102 - file-handle 102 + file-handle \ 103 + libopenssl 103 104 104 105 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list 105 106 # of all feature tests ··· 148 147 lzma \ 149 148 bpf \ 150 149 libaio \ 151 - libzstd 150 + libzstd \ 151 + libopenssl 152 152 153 153 # 154 154 # Declare group members of a feature to display the logical OR of the detection
+6 -2
tools/build/feature/Makefile
··· 67 67 test-libopencsd.bin \ 68 68 test-clang.bin \ 69 69 test-llvm.bin \ 70 - test-llvm-perf.bin \ 70 + test-llvm-perf.bin \ 71 71 test-libaio.bin \ 72 72 test-libzstd.bin \ 73 73 test-clang-bpf-co-re.bin \ 74 74 test-file-handle.bin \ 75 - test-libpfm4.bin 75 + test-libpfm4.bin \ 76 + test-libopenssl.bin 76 77 77 78 FILES := $(addprefix $(OUTPUT),$(FILES)) 78 79 ··· 381 380 382 381 $(OUTPUT)test-libpfm4.bin: 383 382 $(BUILD) -lpfm 383 + 384 + $(OUTPUT)test-libopenssl.bin: 385 + $(BUILD) -lssl 384 386 385 387 $(OUTPUT)test-bpftool-skeletons.bin: 386 388 $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
+5
tools/build/feature/test-all.c
··· 142 142 # include "test-libtraceevent.c" 143 143 #undef main 144 144 145 + #define main main_test_libopenssl 146 + # include "test-libopenssl.c" 147 + #undef main 148 + 145 149 int main(int argc, char *argv[]) 146 150 { 147 151 main_test_libpython(); ··· 177 173 main_test_reallocarray(); 178 174 main_test_libzstd(); 179 175 main_test_libtraceevent(); 176 + main_test_libopenssl(); 180 177 181 178 return 0; 182 179 }
+7
tools/build/feature/test-libopenssl.c
··· 1 + #include <openssl/ssl.h> 2 + #include <openssl/opensslv.h> 3 + 4 + int main(void) 5 + { 6 + return SSL_library_init(); 7 + }