summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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@