From ff63106decc6ee78dacea8598dc048a6a4495832 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Fri, 29 Sep 2023 17:35:22 +0000 Subject: util/amdfwtool: Check for pkg-config presence Check for pkg-config presence and fail out with actionable message. BUG=b:302521446 TEST=Build successfully with working pkg-config and failed build with no pkg-config Change-Id: I5d604145c919e7f71680d1e095dc68cb21868319 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/78191 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- util/amdfwtool/Makefile | 5 ++++- util/amdfwtool/Makefile.inc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9bc1ab761e7..9392f02fed07 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -14,7 +14,7 @@ TOOL_OBJ = $(TOOL_SRC:%.c=%.o) HEADER=amdfwtool.h TARGETS = amdfwread amdfwtool WERROR=-Werror -CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} +CFLAGS :=-O2 -Wall -Wextra -Wshadow ${WERROR} CFLAGS += -I $(top)/src/commonlib/bsd/include CFLAGS += -D_GNU_SOURCE # memmem() from string.h @@ -24,6 +24,9 @@ else HOSTPKGCONFIG ?= pkg-config endif CFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto) +ifneq ($(.SHELLSTATUS),0) +$(error "Ensure that pkg-config is installed.") +endif LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto) all: $(TARGETS) diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc index 067a137090b3..6a83cb926552 100644 --- a/util/amdfwtool/Makefile.inc +++ b/util/amdfwtool/Makefile.inc @@ -3,13 +3,16 @@ amdfwtoolobj = amdfwtool.o data_parse.o signed_psp.o handle_file.o amdfwreadobj = amdfwread.o -AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow -Werror +AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow -Werror AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include AMDFWTOOLCFLAGS += -D_GNU_SOURCE # memmem() from string.h HOSTPKGCONFIG ?= pkg-config AMDFWTOOLCFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto) +ifneq ($(.SHELLSTATUS),0) +$(error "Ensure that pkg-config is installed.") +endif LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto) $(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) -- cgit v1.2.3