From 07d9043da43ddce10406f56a040fb5a240747282 Mon Sep 17 00:00:00 2001 From: "Nam T. Nguyen" Date: Tue, 17 Feb 2015 13:26:44 -0800 Subject: 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 Trybot-Ready: Nam Nguyen Tested-by: Nam Nguyen Reviewed-by: Nam Nguyen --- Makefile | 23 ++++++++++++++++++++++- vboot_host.pc.in | 10 ++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 vboot_host.pc.in 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@ -- cgit v1.2.3