So it worked. Good. You have permission to write in /tmp.
I suspect 2 problems. (1) Something went wrong in your download, untar; or (2) Directory you expanded to causes permission problem; or (3) other
Did you even get message:
"Configuring for a i686-pc-linux-gnu ..." ?
If not, then script did not go far at all.
How did you get tar.gz onto server and expand it? Where did you expand it? FWIW, I put in /home/user/ocaml and it worked ok.
Can you edit configure file, put set -x on 2nd line (original blank), re-run ./configure... command; see where it stops?
$1 for me <> All for you