diff --git a/Makefile b/Makefile index 10c80d2..0b1b1c6 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader # Start up the system from the distribution compiler coldstart: cd byterun; $(MAKE) all - cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE) + cp byterun/ocamlrun$(EXE) boot/actual.ocamlrun$(EXE) cd yacc; $(MAKE) all cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE) cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all @@ -215,7 +215,7 @@ promote-cross: # Promote the newly compiled system to the rank of bootstrap compiler # (Runs on the new runtime, produces code for the new runtime) promote: promote-cross - cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE) + cp byterun/ocamlrun$(EXE) boot/actual.ocamlrun$(EXE) # Restore the saved bootstrap compiler if a problem arises restore: diff --git a/boot/ocamlrun b/boot/ocamlrun new file mode 100755 index 0000000..fcb291c --- /dev/null +++ b/boot/ocamlrun @@ -0,0 +1,16 @@ +#!/bin/bash + +d=$(dirname $0) + +# Dodge ocamlrun own options by avoiding interfering in that case +case "$1" in + -*) c="$1" ;; + *) c=$(basename $1) ;; +esac + +if test "$c" = ocamlc ; then + shift + $d/actual.ocamlrun $d/ocamlc -use-runtime $d/ocamlrun "$@" +else + $d/actual.ocamlrun "$@" +fi