tools: mkeficapsule: use pkg-config for each lib separat
authorHeiko Thiery <heiko.thiery@gmail.com>
Sat, 6 Aug 2022 11:22:53 +0000 (13:22 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 20 Aug 2022 06:38:12 +0000 (08:38 +0200)
Call pkg-config for each library individually.
This improves fallback handling.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Fixes: 31a7688cbe0e ("tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls")
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
tools/Makefile

index 005e736..3626919 100644 (file)
@@ -245,9 +245,13 @@ hostprogs-$(CONFIG_ASN1_COMPILER)  += asn1_compiler
 HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include
 
 HOSTCFLAGS_mkeficapsule.o += \
-       $(shell pkg-config --cflags gnutls uuid 2> /dev/null || echo "")
+       $(shell pkg-config --cflags gnutls 2> /dev/null || echo "")
+HOSTCFLAGS_mkeficapsule.o += \
+       $(shell pkg-config --cflags uuid 2> /dev/null || echo "")
+HOSTLDLIBS_mkeficapsule += \
+       $(shell pkg-config --libs gnutls 2> /dev/null || echo "-lgnutls")
 HOSTLDLIBS_mkeficapsule += \
-       $(shell pkg-config --libs gnutls uuid 2> /dev/null || echo "-lgnutls -luuid")
+       $(shell pkg-config --libs uuid 2> /dev/null || echo "-luuid")
 hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule
 
 # We build some files with extra pedantic flags to try to minimize things