Skip to content

Commit c7ed0a5

Browse files
DerDakongregkh
authored andcommitted
scripts: use pkg-config to locate libcrypto
commit 2cea4a7 upstream. 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 <eb@emlix.com> Cc: stable@vger.kernel.org # 5.6.x Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c8e3bcc commit c7ed0a5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
1212

13+
CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
14+
CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
15+
1316
hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
1417
hostprogs-$(CONFIG_KALLSYMS) += kallsyms
1518
hostprogs-$(CONFIG_LOGO) += pnmtologo
@@ -23,8 +26,9 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
2326

2427
HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
2528
HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
26-
HOSTLDLIBS_sign-file = -lcrypto
27-
HOSTLDLIBS_extract-cert = -lcrypto
29+
HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
30+
HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
31+
HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
2832

2933
always := $(hostprogs-y) $(hostprogs-m)
3034

0 commit comments

Comments
 (0)