summaryrefslogtreecommitdiff
path: root/Makefile.toolchain
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-02-14 17:58:51 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-19 22:15:20 -0800
commit65c99bd43cc741996ffeb8cc98c2e50068c160cd (patch)
treeaadf99c72eed3d89f701d2460b801ad11ceea0e9 /Makefile.toolchain
parenta6f8b01d0c7eaa2b19d1ad0611f3afcad47ac061 (diff)
downloadchrome-ec-65c99bd43cc741996ffeb8cc98c2e50068c160cd.tar.gz
Makefile: fix building utils outside chroot
On newer desktop distributions pkg-config queries for libftdi do not include usb-1.0 library specific output any more, so both libraries' compilation and linking flags need to be retrieved explicitly. BRANCH=none BUG=none TEST=verified that make BOARD=host clean; make BOARD=host utils succeed both inside and outside chroot. Change-Id: I659d31fac2d9b9c8c50a13d18ed09e86b913ec74 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1474893 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r--Makefile.toolchain9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index f1b0f64491..18ad2b443d 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -108,8 +108,8 @@ else
LIBFTDI_NAME=ftdi
endif
-LIBFTDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags lib${LIBFTDI_NAME})
-LIBFTDI_LDLIBS:=$(shell $(PKG_CONFIG) --libs lib${LIBFTDI_NAME})
+LIBFTDIUSB_CFLAGS:=$(shell $(PKG_CONFIG) --cflags lib${LIBFTDI_NAME} libusb-1.0)
+LIBFTDIUSB_LDLIBS:=$(shell $(PKG_CONFIG) --libs lib${LIBFTDI_NAME} libusb-1.0)
ifeq ($(TEST_FUZZ),y)
LIBPROTOBUF_CFLAGS:=$(shell $(PKG_CONFIG) --cflags protobuf)
@@ -121,14 +121,15 @@ LIBPROTOBUF_MUTATOR_LDLIBS:=$(shell $(PKG_CONFIG) --libs libprotobuf-mutator) \
${LIBPROTOBUF_LDLIBS}
endif
-BUILD_CFLAGS= $(LIBFTDI_CFLAGS) $(BUILD_CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN)
+BUILD_CFLAGS = $(LIBFTDIUSB_CFLAGS) $(BUILD_CPPFLAGS) -O3 $(CFLAGS_DEBUG)
+BUILD_CFLAGS += $(CFLAGS_WARN)
HOST_CFLAGS=$(HOST_CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN) -DHOST_TOOLS_BUILD
ifneq (${SYSROOT},)
LDFLAGS_EXTRA+=--sysroot=${SYSROOT}
endif
LDFLAGS=-nostdlib -g -Wl,-X -Wl,--gc-sections -Wl,--build-id=none \
$(LDFLAGS_EXTRA) $(CFLAGS_CPU)
-BUILD_LDFLAGS=$(LIBFTDI_LDLIBS)
+BUILD_LDFLAGS=$(LIBFTDIUSB_LDLIBS)
HOST_TEST_LDFLAGS=-Wl,-T core/host/host_exe.lds -lrt -pthread -rdynamic -lm\
-fuse-ld=bfd \
$(if $(TEST_COVERAGE),-fprofile-arcs,) \