summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNam T. Nguyen <namnguyen@chromium.org>2015-02-17 13:26:44 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-23 22:41:59 +0000
commit8b439147184118298df49d80f679a56b5b8ffa69 (patch)
treebf3abb4ba72f0efc8ef676ab2425ef97b83c1e24
parentc60015682dfd1dc339a19b8f8630eeda0749cb92 (diff)
downloadvboot-8b439147184118298df49d80f679a56b5b8ffa69.tar.gz
vboot_reference: Install vboot_host.pc file
Since we are going to pull in libmtdutils, it would be nice to let downstream packages automatically query for appropriate linking flags. BUG=chromium:459338 BRANCH=None CQ-DEPEND=CL:250836 TEST=See the depending CL. Change-Id: I9ff8046b95e1d7e909a483fe87a69d460777e192 Reviewed-on: https://chromium-review.googlesource.com/250530 Commit-Queue: Nam Nguyen <namnguyen@chromium.org> Trybot-Ready: Nam Nguyen <namnguyen@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org> Reviewed-by: Nam Nguyen <namnguyen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/252214 Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--Makefile23
-rw-r--r--vboot_host.pc.in10
2 files changed, 32 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 12a27c7f..574e9616 100644
--- a/Makefile
+++ b/Makefile
@@ -44,22 +44,26 @@ export BUILD
# Stuff for 'make install'
INSTALL = install
DESTDIR = /usr/local
+LIBDIR ?= lib
# Default values
DEV_DEBUG_FORCE=
# Where exactly do the pieces go?
# UB_DIR = utility binary directory
+# ULP_DIR = pkgconfig directory, usually /usr/lib/pkgconfig
# DF_DIR = utility defaults directory
# VB_DIR = vboot binary directory for dev-mode-only scripts
ifeq (${MINIMAL},)
# Host install just puts everything where it's told
UB_DIR=${DESTDIR}/bin
+ULP_DIR=${DESTDIR}/${LIBDIR}/pkgconfig
DF_DIR=${DESTDIR}/default
VB_DIR=${DESTDIR}/bin
else
# Target install puts things into different places
UB_DIR=${DESTDIR}/usr/bin
+ULP_DIR=${DESTDIR}/usr/${LIBDIR}/pkgconfig
DF_DIR=${DESTDIR}/etc/default
VB_DIR=${DESTDIR}/usr/share/vboot/bin
endif
@@ -160,6 +164,10 @@ ifneq (${PD_SYNC},)
CFLAGS += -DPD_SYNC
endif
+# NOTE: We don't use these files but they are useful for other packages to
+# query about required compiling/linking flags.
+PC_IN_FILES = vboot_host.pc.in
+
# Create / use dependency files
CFLAGS += -MMD -MF $@.d
@@ -754,7 +762,8 @@ clean:
${Q}/bin/rm -rf ${BUILD}
.PHONY: install
-install: cgpt_install utils_install signing_install futil_install
+install: cgpt_install utils_install signing_install futil_install \
+ pc_files_install
.PHONY: install_mtd
install_mtd: install cgpt_wrapper_install
@@ -1403,3 +1412,15 @@ tags TAGS xrefs: ${BUILD}/cscope.files
${Q}\rm -f ${BUILD}/tags ${BUILD}/TAGS
${Q}$(call run_if_prog,etags,${cmd_etags})
${Q}$(call run_if_prog,ctags,${cmd_ctags})
+
+PC_FILES = ${PC_IN_FILES:%.pc.in=%.pc}
+${PC_FILES}: ${PC_IN_FILES}
+ ${Q}sed \
+ -e 's:@LDLIBS@:${LDLIBS}:' \
+ -e 's:@LIBDIR@:${LIBDIR}:' \
+ $< > $@
+
+.PHONY: pc_files_install
+pc_files_install: ${PC_FILES}
+ ${Q}mkdir -p ${ULP_DIR}
+ ${Q}${INSTALL} -D -m 0644 $< ${ULP_DIR}/$<
diff --git a/vboot_host.pc.in b/vboot_host.pc.in
new file mode 100644
index 00000000..46243db7
--- /dev/null
+++ b/vboot_host.pc.in
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${prefix}/@LIBDIR@
+
+Name: libvboot_host
+Version: 2
+Description: Static library of functions related to vboot and cgpt.
+Cflags: -I${includedir}
+Libs: -L${libdir} -lvboot_host @LDLIBS@