make configure store its command line in config.mak for easy re-run
proper shell quoting and pretty-printing (avoiding ugly gratuitous quoting and bad quoting style) is included.
This commit is contained in:
parent
82fa6b43b3
commit
453f462297
1 changed files with 11 additions and 1 deletions
12
configure
vendored
12
configure
vendored
|
|
@ -45,6 +45,12 @@ exit 0
|
||||||
|
|
||||||
# Helper functions
|
# Helper functions
|
||||||
|
|
||||||
|
quote () {
|
||||||
|
tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
|
||||||
|
$1
|
||||||
|
EOF
|
||||||
|
printf %s\\n "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/;\$s/\$/'/" -e "s/^'\([-[:alnum:]_,./:]*\)=\(.*\)\$/\1='\2/"
|
||||||
|
}
|
||||||
echo () { printf "%s\n" "$*" ; }
|
echo () { printf "%s\n" "$*" ; }
|
||||||
fail () { echo "$*" ; exit 1 ; }
|
fail () { echo "$*" ; exit 1 ; }
|
||||||
fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; }
|
fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; }
|
||||||
|
|
@ -421,11 +427,15 @@ fi
|
||||||
|
|
||||||
printf "creating config.mak... "
|
printf "creating config.mak... "
|
||||||
|
|
||||||
|
cmdline=$(quote "$0")
|
||||||
|
for i ; do cmdline="$cmdline $(quote "$i")" ; done
|
||||||
|
|
||||||
exec 3>&1 1>config.mak
|
exec 3>&1 1>config.mak
|
||||||
|
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
# This version of config.mak was generated by configure
|
# This version of config.mak was generated by:
|
||||||
|
# $cmdline
|
||||||
# Any changes made here will be lost if configure is re-run
|
# Any changes made here will be lost if configure is re-run
|
||||||
ARCH = $ARCH
|
ARCH = $ARCH
|
||||||
SUBARCH = $SUBARCH
|
SUBARCH = $SUBARCH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue