# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/uclibc/functions.in # Copyright (C) 2004 - 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 # --- T2-COPYRIGHT-END --- # $conffiles is a list of patters of the form # ^[XO-] [] # X means enable, O disable, and - removes it # pattern can use '*' as a wildcard for [^ #] # optionaly can set a value different that y apply_conffiles() { local file= rule= local action= prerule= value= x= if [ ! -f $builddir/config.sed ]; then for file in $conffiles $extraconffiles; do if [ -f "$file" ]; then sed -e '/^[ \t]*$/d;' -e '/^[ \t]*#.*/d;' "$file" | while read action prerule value x; do [ "${action:0:1}" = "#" -o "$action" = "" ] && continue rule="$(echo $prerule | sed 's/\*/[^ #]*/')" rule="^\(# \)\?\($rule\)[= ].*\$" if [ -z "$value" ]; then value='y' else value=\"$(eval echo $value)\" fi case "$action" in X) echo "apply_conffiles: rule $prerule=$value." echo "s,$rule,\2=$value,g" >> $builddir/config.sed ;; O) echo "apply_conffiles: rule unset $prerule." echo "s,$rule,# \2 is not set,g" >> $builddir/config.sed ;; -) echo "apply_conffiles: rule remove $prerule." echo "s,$rule,,g" >> $builddir/config.sed ;; *) abort "apply_conffiles: bad rule $action $prerule $value" ;; esac done fi; done fi sed -f $builddir/config.sed .config > $1 } # get default config, and filter considering # levels, because new options can appear and other disappear auto_config() { local j=1 n="${1:-1}" # defconfig eval "$MAKE defconfig $makeopt" cp -v .config .config.$j j=2; for ((i=1; i