0001-tools-mkeficapsule-use-pkg-config-to-get-luuid-and-l.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. From f3523977e8f5f6b2173708777001332431ebc609 Mon Sep 17 00:00:00 2001
  2. From: Heiko Thiery <heiko.thiery@gmail.com>
  3. Date: Tue, 19 Jul 2022 16:17:09 +0200
  4. Subject: [PATCH 1/2] tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls
  5. Instead of hardcoding -luuid -lgnutls as the flags needed to build
  6. mkeficapsule, use pkg-config when available.
  7. We gracefully fallback on the previous behavior of hardcoding -luuid
  8. -lgnutls if pkg-config is not available or fails with an error.
  9. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
  10. ---
  11. tools/Makefile | 3 ++-
  12. 1 file changed, 2 insertions(+), 1 deletion(-)
  13. diff --git a/tools/Makefile b/tools/Makefile
  14. index 9f2339666a..9f6b282ad8 100644
  15. --- a/tools/Makefile
  16. +++ b/tools/Makefile
  17. @@ -242,7 +242,8 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs
  18. hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler
  19. HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include
  20. -HOSTLDLIBS_mkeficapsule += -lgnutls -luuid
  21. +HOSTLDLIBS_mkeficapsule += \
  22. + $(shell pkg-config --libs gnutls uuid 2> /dev/null || echo "-lgnutls -luuid")
  23. hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule
  24. # We build some files with extra pedantic flags to try to minimize things
  25. --
  26. 2.30.2