Move the main function for the configure script into OCaml.