summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-10-06 19:48:13 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-10-06 21:34:38 +0200
commit7f33def3b9def03dba293ba9108830459a9383c5 (patch)
treea48cd6408fc3cd57eee0ce9d3407fe69ed6767a4
parentcfd13ea1c47b5797d4ff9cca45092fba65b2c658 (diff)
downloadptxdist-7f33def3b9def03dba293ba9108830459a9383c5.tar.gz
ptxdist-7f33def3b9def03dba293ba9108830459a9383c5.tar.xz
ptxd_lib_dgen: make sure <PKG>_CONFIG is only evaluated once
Packages may define <PKG>_CONFIG with '=' to avoid evaluating a complex shell call if the package is not selected. However, this means the variable is evaluated multiple time if the package _is_ selected. Avoid this by overwriting the variable with itself using ':='. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index f04f16b5d..de5a26b02 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -371,11 +371,14 @@ function write_deps_pkg_active_cfghash(this_PKG, this_pkg) {
print "endif" > DGEN_DEPS_POST;
print "endif" > DGEN_DEPS_POST;
print "endif" > DGEN_DEPS_POST;
+ print this_PKG "_CONFIG := $(" this_PKG "_CONFIG)" > DGEN_DEPS_POST;
print "ifeq ($(PTXDIST_PKGHASH_MAKE),)" > DGEN_DEPS_POST;
print "ifneq ($(filter /%,$(" this_PKG "_CONFIG)),)" > DGEN_DEPS_POST;
print "ifneq ($(wildcard $(" this_PKG "_CONFIG)),)" > DGEN_DEPS_POST;
print "$(file >>" PTXDIST_TEMPDIR "/pkghash.list,CONFIG: " this_PKG " $(" this_PKG "_CONFIG))" > DGEN_DEPS_POST;
print "endif" > DGEN_DEPS_POST;
+ print "else" > DGEN_DEPS_POST;
+ print "undefine " this_PKG "_CONFIG" > DGEN_DEPS_POST;
print "endif" > DGEN_DEPS_POST;
print "endif" > DGEN_DEPS_POST;
}