summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2015-01-15 15:37:59 -0500
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-16 03:31:09 +0000
commit0b789c56fc5ff34309e935bab15f130a386a1140 (patch)
treec3d673d41d736b0691da81286f704dade3c1f6d4
parent75efe872a621a8f865f1a90792ad9ea0932fca2e (diff)
downloadvboot-0b789c56fc5ff34309e935bab15f130a386a1140.tar.gz
integrate support for static builds
Add a STATIC knob to easily get static builds of all binaries. We want this for the signer system. We also need to fix the bmpblk utility to look up its libraries via pkg-config. BUG=chromium:447051 TEST=`make STATIC=1` works now BRANCH=none Change-Id: Icaef1f19f4618b0ce2b934735796749539081a02 Reviewed-on: https://chromium-review.googlesource.com/241041 Trybot-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Bill Richardson <wfrichar@google.com> Commit-Queue: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 77127ded..22034476 100644
--- a/Makefile
+++ b/Makefile
@@ -184,6 +184,12 @@ LD = ${CC}
CXX ?= g++
PKG_CONFIG ?= pkg-config
+# Static?
+ifneq (${STATIC},)
+LDFLAGS += -static
+PKG_CONFIG += --static
+endif
+
# Determine QEMU architecture needed, if any
ifeq (${ARCH},${HOST_ARCH})
# Same architecture; no need for QEMU
@@ -1097,8 +1103,11 @@ ${BUILD}/tests/vb20_common3_tests: LDLIBS += ${CRYPTO_LIBS}
${TEST21_BINS}: LDLIBS += ${CRYPTO_LIBS}
+LZMA_LIBS := $(shell ${PKG_CONFIG} --libs liblzma)
+YAML_LIBS := $(shell ${PKG_CONFIG} --libs yaml-0.1)
+
${BUILD}/utility/bmpblk_utility: LD = ${CXX}
-${BUILD}/utility/bmpblk_utility: LDLIBS = -llzma -lyaml
+${BUILD}/utility/bmpblk_utility: LDLIBS = ${LZMA_LIBS} ${YAML_LIBS}
BMPBLK_UTILITY_DEPS = \
${BUILD}/utility/bmpblk_util.o \