diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2023-09-29 17:35:22 +0000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-10-10 13:41:07 +0000 |
commit | ff63106decc6ee78dacea8598dc048a6a4495832 (patch) | |
tree | 1f5ccbd1a7ccfaa50cc50fee8761a4b85cfd7afb /util | |
parent | e486082dfb1658b0916915bc944c1d3266862423 (diff) |
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 <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78191
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/amdfwtool/Makefile | 5 | ||||
-rw-r--r-- | util/amdfwtool/Makefile.inc | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9bc1ab761..9392f02fed 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 067a137090..6a83cb9265 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) |