Re-use previous configuration as defaults
This commit is contained in:
parent
5241d9d091
commit
e0782d63da
1 changed files with 12 additions and 1 deletions
11
configure
vendored
11
configure
vendored
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue