From aa28864c5dd7965b0f1c50f4706486a279f37ea9 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 16 Nov 2025 10:47:38 +0200 Subject: [PATCH] MT#55283 Abort make if required package is not found Closes #2027 Change-Id: I609d326fe69c82268f4e58411549cf26afc68409 --- lib/deps.Makefile | 11 +++++++---- utils/gen-common-flags | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/deps.Makefile b/lib/deps.Makefile index d3564146c..e6bca804d 100644 --- a/lib/deps.Makefile +++ b/lib/deps.Makefile @@ -1,12 +1,15 @@ # Define build flags for used dependencies. -$(top_srcdir)/config.mk: - $(top_srcdir)/utils/gen-common-flags >$@ +$(top_srcdir)/config.mk: $(top_srcdir)/utils/gen-common-flags \ + $(top_srcdir)/utils/gen-bcg729-flags \ + $(top_srcdir)/utils/gen-codec-chain-flags + $(top_srcdir)/utils/gen-common-flags >$@.new ifeq (,$(filter pkg.ngcp-rtpengine.nobcg729,${DEB_BUILD_PROFILES})) - $(top_srcdir)/utils/gen-bcg729-flags >>$@ + $(top_srcdir)/utils/gen-bcg729-flags >>$@.new endif ifneq (,$(filter pkg.ngcp-rtpengine.codec-chain,${DEB_BUILD_PROFILES})) - $(top_srcdir)/utils/gen-codec-chain-flags >>$@ + $(top_srcdir)/utils/gen-codec-chain-flags >>$@.new endif + mv $@.new $@ include $(top_srcdir)/config.mk diff --git a/utils/gen-common-flags b/utils/gen-common-flags index 862525442..f9f0531f6 100755 --- a/utils/gen-common-flags +++ b/utils/gen-common-flags @@ -5,6 +5,11 @@ gen-pkgconf-flags() local var="$1" local pc="$2" + if ! pkg-config --exists "${pc}"; then + echo "Error: Required package '${pc}' not found" >&2 + exit 1 + fi + echo "export CFLAGS_${var} LDLIBS_${var}" echo "CFLAGS_${var} := $(pkg-config --cflags "${pc}")" echo "LDLIBS_${var} := $(pkg-config --libs "${pc}")"