Use pkgconfig when available to determine LDLIBS
This fixes a compilation failure when fmap is installed as libfmap.so.
This patch was written by Felix Janda <felix.janda@posteo.de> and
submitted to chromium.org by David Hendricks <dhendrix@chromium.org>.
BUG=none
BRANCH=none
TEST=none
Change-Id: I3139335eb53787900573fcb81c4044e49d494328
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373899
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
diff --git a/Makefile b/Makefile
index c4cd006..74cbec3 100644
--- a/Makefile
+++ b/Makefile
@@ -292,8 +292,8 @@
KERNELVERSION = $(CORE).$(MAJOR).$(MINOR)
-FMAP_LINKOPT ?= -lfmap-0.3
-LDLIBS := -luuid $(FMAP_LINKOPT)
+FMAP_LINKOPT ?= $(shell pkg-config --libs fmap 2> /dev/null || -lfmap-0.3)
+LDLIBS := $(shell pkg-config --libs uuid 2> /dev/null || -luuid) $(FMAP_LINKOPT)
#EXTRA_CFLAGS := $(patsubst %,-l%, $(LIBRARIES))