. ./redoconf.rc # replace the placeholder for this function with # one that will save help messages for later. HELP="configure.help.new" rm -f "$HELP" echo '# Automatically generated by redoconf/_all.rc.od - do not edit' >"$HELP" helpmsg() { printf '%-11s %s\n' "$1" "$2" >>"$HELP" rc_hook "$1" } # Remember initial set of keys provided by ./configure orig_keys="" rc_hook() { contains_line "$orig_keys" "$1" || orig_keys="$orig_keys$NL$1" } # Include the rest of the necessary .rc files keys="" rc_hook() { contains_line "$new_keys" "$1" || new_keys="$new_keys$NL$1" } allrc= if [ -e "$S/all.rc.od" ]; then allrc=all.rc else allrc= redo-ifcreate "$S/all.rc.od" fi rc_include rc/_init.rc rc/CC.rc rc/zdefs.rc $allrc rc_helpmsg PREFIX "Change installation prefix (usually /usr/local)" IFS="$NL" unused= for d in $orig_keys; do if ! contains_line "$new_keys" "$d"; then unused=1 xecho "Error: '$d' was given to ./configure but not used." >&2 fi done [ -z "$unused" ] || exit 1 rc_save # Now that all the rc files have run, update $S/configure.help with the # newly-generated help text, so it's available to new users. # Even if multiple output dirs are building at once, this replaces the # file atomically, so it should be safe. mv "$HELP" "$S/configure.help"