EOF
 
# -- Choose if accept it or not.
echo
echo 'If you accept the terms of the license, please type "accept" (without quotes)'
read v
if ([ "X$v" != "Xaccept" ]) then { echo "You didn't accept the license."; exit 1; } fi
 
# Choose install dir
echo
echo
echo Step 2. Choose an installation directory
echo
export ALDOR_DONE=0
while ([ $ALDOR_DONE = 0 ])
do 
echo "Choose a directory. If the chosen directory is called CHOSENDIR, then aldor"
echo "will be installed in CHOSENDIR/aldor"
echo -n "Please type a directory for installation [/usr/local]: "
read instdir
 
if ([ "X$instdir" = "X" ]) then { export instdir="/usr/local"; } fi

echo "Creating $instdir/aldor ..."
mkdir -p $instdir/aldor
if ([ ! -w "$instdir/aldor" ]) then echo "$instdir does not have write permission for the current user."; else export ALDOR_DONE=1; fi
done
echo "The Aldor compiler will be installed in $instdir/aldor"
 
# Installation
echo
echo 
echo Step 3. Installing the Aldor compiler
echo
# -- Last chance to abort
echo "Press Enter to continue, q then Enter to abort."
read whattodo

if ([ "X$whattodo" = "Xq" ]) then { echo "Installation aborted."; exit 1; } fi
 
# -- Here we go
echo "Installing Aldor compiler (this may take several minutes) ..."
