#! /bin/sh
#
# File: compile.cgi

echo 'Content-type: text/html'
echo
echo "<head><title>Compilation results</title></head>"
echo "<body>"
echo "<h1>Compilation results</h1>"

echo "<h2>Environment setup</h2>"

echo "<pre>"
echo Time is `date`
echo PATH is $PATH
PATH=$PATH:/usr/local/bin
export PATH
echo PATH is now $PATH
path=$PATH
export path
echo -n "which gcc: "
ls -l `which gcc`
echo "gcc version: "
gcc -v
arch
echo "</pre>"

echo "<h2>Contents of directory before compilation</h2>"

echo "<pre>"
ls -l
ls -l obj
echo "</pre>"

echo "<h2>Compilation output</h2>"

echo "<pre>"
echo "make -k"
make -k
echo "</pre>"

echo "<h2>Contents of directory after compilation</h2>"

echo "<pre>"
ls -l
ls -l obj
echo "</pre>"

echo
echo "<hr>"
echo "<p><a href=\"compile.html\">Back to compilation form</a>;"
echo "<a href=\"compile.cgi\">Recompile</a>;"
echo "<a href=\"compile1.cgi\">Test another way of compiling</a>;"
echo "or try <a href=\"../select.html\">running</a> the result of this compilation.</p>"
echo "</body>"

# EOF
