Re-use previous configuration as defaults

This commit is contained in:
Erik Stambaugh 2024-01-26 16:39:30 -08:00
parent 5241d9d091
commit e0782d63da

11
configure vendored
View file

@ -15,13 +15,24 @@ COMMENT=""
echo -n > $TEMPFILE echo -n > $TEMPFILE
get_default() {
V=$1
if ! [[ -e config.mk ]]; then
return ""
fi
grep "$V = " config.mk | sed -e 's/.* = \+//'
}
while read LINE <&4; do while read LINE <&4; do
if echo "$LINE" | grep -q '^#'; then if echo "$LINE" | grep -q '^#'; then
COMMENT=$(echo "$LINE" | sed -e 's/^#\+ *//') COMMENT=$(echo "$LINE" | sed -e 's/^#\+ *//')
elif echo "$LINE" | grep -q '^[0-9A-Z_]\+ *= *'; then elif echo "$LINE" | grep -q '^[0-9A-Z_]\+ *= *'; then
VARNAME=$(echo "$LINE" | sed -e 's/ *=.*//') VARNAME=$(echo "$LINE" | sed -e 's/ *=.*//')
DEFAULT="$(get_default $VARNAME)"
if [[ -z "$DEFAULT" ]]; then
DEFAULT=$(echo "$LINE" | sed -e 's/^[0-9A-Z_]\+ *= *//') DEFAULT=$(echo "$LINE" | sed -e 's/^[0-9A-Z_]\+ *= *//')
fi
# if there are prefix vars that are false, we need to skip # if there are prefix vars that are false, we need to skip
SKIP=0 SKIP=0