Skip to content

Commit

Permalink
CONFIGURE: Properly pass disabled features from the awk script
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 6, 2024
1 parent 438532a commit 5b585e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4124,9 +4124,19 @@ append_var MODULES "backends/platform/$_backend"
# Check if specific components are not used by enabled engines and disable them
#
echo "Checking for unused components..."
rm -f engines.awk.out
awk -f "$_srcdir/engines.awk" -v _pass=pass1 < /dev/null
echo "...check complete"

eval "`. engines.awk.out`"

for f in $_features_disabled; do
echo $f # XXXX
set_var $(get_var _feature_${f}_settings) "no"
done

rm -f engines.awk.out

#
# Check for pkg-config
#
Expand Down
6 changes: 4 additions & 2 deletions engines.awk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function have_feature(feature) {
function disable_feature(feature) {
ENVIRON["_feature_" feature "_settings"] = "no"

ENVIRON["_features_disabled"] = ENVIRON["_features_disabled"] feature " "
_features_disabled = _features_disabled feature " "
}

#
Expand Down Expand Up @@ -374,12 +374,14 @@ END {
if (have_feature(components[c])) {
if (get_feature_state(components[c]) == "yes") {
disable_feature(components[c])
print(" Feature '" components[c] "' is disabled as unused")
print(" Feature '" components[c] "' is disabled as unused by enabled engines")
}
}
}
}

print("#!/bin/sh\necho _features_disabled='" _features_disabled "'") >> "engines.awk.out"

exit 0
}

Expand Down

0 comments on commit 5b585e8

Please sign in to comment.