From c0c41663ecad1f10f2acc048fd78532f7003ab0e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 7 Mar 2012 17:08:02 -0500 Subject: convert to SLOT-ed libbase We need to use the .pc file to get the compiling/linking details, so switch over to that. While we're here, fix the hardcoded `ar` to use $(AR) from the env. BUG=chromium-os:16623 TEST=`emerge-x86-alex vboot_reference` builds & links CgptManagerTests against newer libbase Change-Id: I20865138fdfd1725415d737ad5fdbc4c134079a7 Reviewed-on: https://gerrit.chromium.org/gerrit/17533 Commit-Ready: Mike Frysinger Reviewed-by: Mike Frysinger Tested-by: Mike Frysinger Reviewed-by: Kees Cook --- tests/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 32a733b8..fc4041d5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,6 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +PKG_CONFIG ?= pkg-config + +BASE_VER = 85268 +PC_DEPS = libchrome-$(BASE_VER) +PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) +PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) + ifeq ($(FIRMWARE_ARCH),) CFLAGS += -DCHROMEOS_ENVIRONMENT CXXFLAGS += -DCHROMEOS_ENVIRONMENT @@ -12,7 +19,8 @@ INCLUDES += -I./include \ -I$(FWDIR)/lib/cgptlib/include \ -I$(FWDIR)/lib/cryptolib/include \ -I$(FWDIR)/lib/tpm_lite/include \ - -I$(HOSTDIR)/include + -I$(HOSTDIR)/include \ + $(PC_CFLAGS) BUILD_ROOT = ${BUILD}/tests @@ -63,7 +71,7 @@ cgptmanager_tests: $(BUILD_ROOT)/CgptManagerTests ${TEST_LIB}: ${TEST_LIB_OBJS} rm -f $@ - ar qc $@ $^ + $(AR) rc $@ $^ ${BUILD_ROOT}/CgptManagerTests.o: CgptManagerTests.cc @@ -71,7 +79,7 @@ ${BUILD_ROOT}/CgptManagerTests.o: CgptManagerTests.cc ${BUILD_ROOT}/CgptManagerTests: ${BUILD_ROOT}/CgptManagerTests.o $(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) -lgtest -lgflags $^ \ - ${BUILD}/cgpt/libcgpt-cc.a -lbase -lpthread -lrt -o $@ + ${BUILD}/cgpt/libcgpt-cc.a $(PC_LIBS) -o $@ ${BUILD_ROOT}/vboot_audio_for_test.o : $(FWDIR)/lib/vboot_audio.c $(CC) $(CFLAGS) -DCUSTOM_MUSIC $(INCLUDES) \ -- cgit v1.2.1