diff options
| author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-06-09 14:21:20 +0000 |
|---|---|---|
| committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-06-09 14:21:20 +0000 |
| commit | 3cf96197ba3d1a46081c4c095ba92600f7d9df29 (patch) | |
| tree | 2ee798e62b24edd86def5f75d3fc3c43a62eff41 | |
| parent | f6bfe26317670cc7a3e12e6294232ab0425dd2d0 (diff) | |
| download | ocaml-3cf96197ba3d1a46081c4c095ba92600f7d9df29.tar.gz | |
camlp4: improve the bootstrapping scripts and recipe
git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.12@10553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| -rw-r--r-- | build/camlp4-bootstrap-recipe.txt | 19 | ||||
| -rwxr-xr-x | build/camlp4-bootstrap.sh | 3 | ||||
| -rwxr-xr-x | build/camlp4-mkCamlp4Ast.sh | 24 |
3 files changed, 38 insertions, 8 deletions
diff --git a/build/camlp4-bootstrap-recipe.txt b/build/camlp4-bootstrap-recipe.txt index 5fa5092c63..9f1417a2fa 100644 --- a/build/camlp4-bootstrap-recipe.txt +++ b/build/camlp4-bootstrap-recipe.txt @@ -2,16 +2,11 @@ make clean ./build/distclean.sh ./configure -prefix `pwd`/_install - ./build/world.sh byte + ./build/fastworld.sh # Go to "Bootstrap camlp4" === Install the bootstrapping camlp4 processor === ./build/install.sh - # Either extend your PATH with _install - export PATH=`pwd`/_install:$PATH - # Or copy just the needed files (for better understanding) - cp _build/camlp4/camlp4boot.byte <somewhereinPATH>/bin/camlp4boot - cp _build/camlp4/camlp4o.byte <somewhereinPATH>/bin/camlp4o === Build camlp4 === # This step is not needed right after a "./build/world.sh byte" @@ -20,6 +15,8 @@ === Bootstrap camlp4 === # First "Build camlp4" # Then "Install the bootstrapping camlp4 processor" + # Indeed the following bootstrapping script + # does use the installed version! ./build/camlp4-bootstrap.sh # If the fixpoint not is reached yet # Go to "Bootstrap camlp4" @@ -27,6 +24,12 @@ # Have a look at the changes in # camlp4/boot it may be a good idea to commit them +=== Generate Camlp4Ast.ml === + # First "Install the bootstrapping camlp4 processor" + # Indeed the following bootstrapping script + # does use the installed version! + ./build/camlp4-mkCamlp4Ast.sh + === Case study "let open M in e" === Open the revised parser @@ -89,7 +92,7 @@ (* let open i in e *) | ExOpI of loc and ident and expr - Then build. Bootstrap once and build again. + Then "Generate Camlp4Ast.ml" and build. We get a single warning in Camlp4/Struct/Camlp4Ast2OCamlAst.ml but don't fix it now. @@ -135,7 +138,7 @@ Add new parsing rules for := but keep the old actions for now. (* module i := i *) | WcMoS of loc and ident and ident -3/ Build and bootstrap once. +3/ "Generate Camlp4Ast.ml" and build. 4/ Change the generated camlp4/boot/camlp4boot.ml: Look for ":=" and change occurences of diff --git a/build/camlp4-bootstrap.sh b/build/camlp4-bootstrap.sh index c594c80e26..ef9a93c01b 100755 --- a/build/camlp4-bootstrap.sh +++ b/build/camlp4-bootstrap.sh @@ -5,6 +5,9 @@ set -e cd `dirname $0`/.. +. config/config.sh +export PATH=$BINDIR:$PATH + TMPTARGETS="\ camlp4/boot/Lexer.ml" diff --git a/build/camlp4-mkCamlp4Ast.sh b/build/camlp4-mkCamlp4Ast.sh new file mode 100755 index 0000000000..2a30b9ab22 --- /dev/null +++ b/build/camlp4-mkCamlp4Ast.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# $Id$ +set -e +cd `dirname $0`/.. + +. config/config.sh +export PATH=$BINDIR:$PATH + +CAMLP4AST=camlp4/Camlp4/Struct/Camlp4Ast.ml +BOOTP4AST=camlp4/boot/Camlp4Ast.ml + +[ -f "$BOOTP4AST" ] && mv "$BOOTP4AST" "$BOOTP4AST.old" +rm -f "_build/$BOOTP4AST" +rm -f "_build/$CAMLP4AST" + +if [ -x ./boot/myocamlbuild.native ]; then + OCAMLBUILD=./boot/myocamlbuild.native +else + OCAMLBUILD="./boot/ocamlrun boot/myocamlbuild" +fi +$OCAMLBUILD $CAMLP4AST + +echo promote $CAMLP4AST +cp _build/$CAMLP4AST camlp4/boot/`basename $CAMLP4AST` |
