Skip to content

Commit 2cea4a7

Browse files
DerDakonmasahir0y
authored andcommitted
scripts: use pkg-config to locate libcrypto
Otherwise build fails if the headers are not in the default location. While at it also ask pkg-config for the libs, with fallback to the existing value. Signed-off-by: Rolf Eike Beer <[email protected]> Cc: [email protected] # 5.6.x Signed-off-by: Masahiro Yamada <[email protected]>
1 parent cf81c3a commit 2cea4a7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# scripts contains sources for various helper programs used throughout
44
# the kernel for the build process.
55

6+
CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
7+
CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
8+
69
hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c
710
hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms
811
hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount
@@ -14,8 +17,9 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
1417

1518
HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
1619
HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
17-
HOSTLDLIBS_sign-file = -lcrypto
18-
HOSTLDLIBS_extract-cert = -lcrypto
20+
HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
21+
HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
22+
HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
1923

2024
ifdef CONFIG_UNWINDER_ORC
2125
ifeq ($(ARCH),x86_64)

0 commit comments

Comments
 (0)