?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: Finish.U,v $
?RCS: Revision 3.0.1.6  1995/02/15  14:09:30  ram
?RCS: patch51: now clearer about how to edit config.sh at the prompt (WED)
?RCS:
?RCS: Revision 3.0.1.5  1994/10/29  15:53:14  ram
?RCS: patch36: added ?F: line for metalint file checking
?RCS:
?RCS: Revision 3.0.1.4  1994/05/06  14:19:37  ram
?RCS: patch23: added blank lines around 'End of Configure'
?RCS:
?RCS: Revision 3.0.1.3  1993/10/16  13:46:09  ram
?RCS: patch12: replaced Config_h by Magic_h in the dependency line
?RCS:
?RCS: Revision 3.0.1.2  1993/09/13  15:45:26  ram
?RCS: patch10: fixed shell evaluation w/o shell escape while in silent mode
?RCS:
?RCS: Revision 3.0.1.1  1993/08/30  08:55:59  ram
?RCS: patch8: prevents myread from blocking on empty answers, exceptionally
?RCS:
?RCS: Revision 3.0  1993/08/18  12:04:55  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?X:
?X: This unit is the very last one in the Configure script.  It runs all the
?X: SH files, which among other things produce config.h and (usually) Makefile.
?X: It offers to do a make depend if the Makefile contains that target.
?X:
?MAKE:Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \
	test package make
?MAKE:	-pick add $@ %<
?F:!config.sh
?T:pwd
: Finish up by extracting the .SH files
case "$alldone" in
exit)
?X: They supplied the -E switch
	echo "Stopping at your request, leaving temporary files around."
	exit 0
	;;
cont)
	;;
'')
	dflt=''
	nostick=true
	$cat <<EOM

If you'd like to make any changes to the config.sh file before I begin
to configure things, do it as a shell escape now (e.g. !vi config.sh).

EOM
	rp="Press return or use a shell escape to edit config.sh:"
	. UU/myread
	nostick=''
	case "$ans" in
	'') ;;
	*) : in case they cannot read
		sh 1>&4 -c "$ans";;
	esac
	;;
esac

: if this fails, just run all the .SH files by hand
. ./config.sh

?X:
?X: Turn silent mode off from now on (we want a verbose file extraction).
?X: This means we have to explicitly test for '$silent' from now on to
?X: strip off any verbose messages.
?X:
echo " "
exec 1>&4
pwd=`pwd`
. ./UU/extract
cd "$pwd"

if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
	dflt=y
	case "$silent" in
	true) ;;
	*)
		$cat <<EOM

Now you need to generate make dependencies by running "$make depend".
You might prefer to run it in background: "$make depend > makedepend.out &"
It can take a while, so you might not want to run it right now.

EOM
		;;
	esac
	rp="Run $make depend now?"
	. UU/myread
	case "$ans" in
	y*)
		$make depend && echo "Now you must run '$make'."
		;;
	*)
		echo "You must run '$make depend' then '$make'."
		;;
	esac
elif test -f [Mm]akefile; then
	echo " "
	echo "Now you must run a $make."
else
	echo "Configure done."
fi

if $test -f Policy.sh; then
    $cat <<EOM

If you compile $package on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.

EOM
fi
if $test -f UU/config.msg; then
    echo "Hmm.  I also noted the following information while running:"
    echo " "
    $cat UU/config.msg >&4
fi
?X:
?X: kit*isdone files are left over by shell archives built using the makedist
?X: script which comes from dist, while ark*isdone files are left over by
?X: the cshar archive maker.
?X:
$rm -f kit*isdone ark*isdone
$rm -rf UU

: End of Configure

