#!/bin/sh

ask() {
        echo "$1 [$2]"
        ans=`line` 
        ans=${ans:-$2}
#       echo "$ans"
}


echo "Configure  VICE  emulators"
echo "------=====*****=====------"
echo ""

ask "Change defaults ?" y
if [ $ans = "y" ]; then
	echo "Edit the configuration files..."

	emacs config.h
	emacs Imakefile
	emacs readline/Imakefile

	echo "Done."
fi

echo "Compiling..."
echo ""


xmkmf
cd readline/
xmkmf
make
cd ..

set z=`grep "^#define HAS_ZILOG_Z80" config.h`
case x$z in
  z)
	;;
  z*)
	rm -f 128memory.o
	cd z80
	make
	cd ..
	;;
esac

make all

