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}")"