From: Stephane Glondu Date: Wed, 4 Aug 2010 01:52:21 +0000 (-0400) Subject: Imported Upstream version 3.12.0 X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~63^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=55080e38cbd768e9866e105933dc2cbe8a8bba30;p=ocaml.git Imported Upstream version 3.12.0 --- diff --git a/INSTALL b/INSTALL index dbc9ac73..dd479b41 100644 --- a/INSTALL +++ b/INSTALL @@ -222,14 +222,6 @@ An alternative, and faster approach to steps 2 to 5 is The result is equivalent to "make world opt opt.opt", but this may fail if anything goes wrong in native-code generation. -Another alternative, is to use the experimental build system that use -ocamlbuild instead of make (it replaces steps 2 to 5): - - ./build/fastworld.sh - -If it doesn't work, just use one of the make-based procedures described -above. - 6- You can now install the Objective Caml system. This will create the following commands (in the binary directory selected during autoconfiguration): diff --git a/README.win32 b/README.win32 index ac1edc50..82b4cba5 100644 --- a/README.win32 +++ b/README.win32 @@ -44,23 +44,23 @@ The remainder of this document gives more information on each port. ------------------------------------------------------------------------------ - The native Win32 port built with Microsoft Visual C - --------------------------------------------------- + The native Win32 port built with Microsoft Windows SDK + ------------------------------------------------------ REQUIREMENTS: -This port runs under MS Windows 7, Vista, XP, and 2000. +This port runs under MS Windows 7 (32 and 64 bits), Vista, XP, and 2000. The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...) runs without any additional tools. The native-code compiler (ocamlopt) requires the Microsoft Windows SDK -(item [1]) and the flexdll tool (item [3]). +(item [1]) and the flexdll tool (item [2]). Statically linking Caml bytecode with C code (ocamlc -custom) also requires -items [1] and [3]. +items [1] and [2]. -The LablTk GUI requires Tcl/Tk 8.5 (item [2]). +The LablTk GUI requires Tcl/Tk 8.5 (item [3]). INSTALLATION: @@ -85,12 +85,12 @@ THIRD-PARTY SOFTWARE: http://www.microsoft.com/downloads/en/default.aspx under the name "Microsoft Windows 7 SDK". -[2] TCL/TK version 8.5. Windows binaries are available as part of the - ActiveTCL distribution at http://www.activestate.com/products/ActiveTcl/ - -[3] flexdll version 0.23 or later. +[2] flexdll version 0.23 or later. Can be downloaded from http://alain.frisch.fr/flexdll.html +[3] TCL/TK version 8.5. Windows binaries are available as part of the + ActiveTCL distribution at http://www.activestate.com/products/ActiveTcl/ + RECOMPILATION FROM THE SOURCES: @@ -99,8 +99,10 @@ distribution (ocaml-X.YY.Z.tar.gz), which also contains the files modified for Windows. You will need the following software components to perform the recompilation: -- Windows NT, 2000, XP, Vista, or 7. +- Windows NT, 2000, XP, Vista, or 7 (32 or 64 bits). - Items [1], [2] and [3] from the list of recommended software above. + Make sure to install the 32-bit version of TCL/TK, even if you are + compiling on a 64-bit Windows. - The Cygwin port of GNU tools, available from http://www.cygwin.com/ Install at least the following packages: diffutils, make, ncurses. @@ -109,21 +111,27 @@ tools. The following assumes that you have installed [1], [2], and [3] in their default directories. If this is not the case, you will need to adjust the paths accordingly. - Open a Windows Command Prompt and enter the following commands: - cd "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin" + Open a Windows Command Prompt and enter the following command: + set PFPATH=C:\Program Files + If you are compiling on the 64-bit version of Windows 7, enter the + following instead: + set PFPATH=C:\Program Files (x86) + + Then enter the following commands: + cd "%PFPATH%\Microsoft Visual Studio 9.0\VC\bin" vcvars32 echo VCPATH="`cygpath -p '%Path%'`" >C:\cygwin\tmp\msenv echo LIB="%LIB%;C:\Tcl\lib" >>C:\cygwin\tmp\msenv echo LIBPATH="%LIBPATH%" >>C:\cygwin\tmp\msenv echo INCLUDE="%INCLUDE%;C:\Tcl\include" >>C:\cygwin\tmp\msenv - echo FLPATH="`cygpath 'C:\Program Files\flexdll'`" >>C:\cygwin\tmp\msenv + echo FLPATH="`cygpath '%PFPATH%\flexdll'`" >>C:\cygwin\tmp\msenv echo PATH="${VCPATH}:$PATH:${FLPATH}" >>C:\cygwin\tmp\msenv echo export PATH LIB LIBPATH INCLUDE >>C:\cygwin\tmp\msenv echo export OCAMLBUILD_FIND=/usr/bin/find >>C:\cygwin\tmp\msenv Open a Cygwin shell and enter the following commands: - tr -d '\r' .msenv - echo '. $HOME/.msenv' >>.bashrc + tr -d '\r' .msenv32 + echo '. $HOME/.msenv32' >>.bashrc Now, close the Command Prompt and the shell and you're set up for using the MS tools under Cygwin. @@ -190,7 +198,7 @@ and the flexdll tool, available at http://alain.frisch.fr/flexdll.html You will need to install at least the following Cygwin packages (use the Setup tool from Cygwin): -binutils, gcc-core, gcc-mingw-core, mingw-runtime, w32-api. +binutils, gcc-core, gcc-mingw-core, mingw-runtime, w32api. Do *not* install the Mingw/MSYS development tools from www.mingw.org: these are not compatible with this Caml port (@responsefile not @@ -199,6 +207,8 @@ recognized on the command line). The LablTk GUI requires Tcl/Tk 8.5. Windows binaries are available as part of the ActiveTCL distribution at http://www.activestate.com/products/ActiveTcl/ +Note that you will need to install the 32-bit version of ActiveTCL, +even if you are on a 64-bit version of Windows. INSTALLATION: @@ -296,12 +306,13 @@ The replay debugger is supported. ------------------------------------------------------------------------------ - The native Win64 port built with the Microsoft Platform SDK compilers - --------------------------------------------------------------------- + The native Win64 port built with Microsoft Windows SDK + ------------------------------------------------------ REQUIREMENTS: -This port runs under MS Windows XP 64 and Server 64 on Intel64/AMD64 machines. +This port runs under MS Windows XP 64, Windows Server 64, and +Windows 7 64 on Intel64/AMD64 machines. The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...) runs without any additional tools. @@ -313,6 +324,7 @@ Microsoft Platform SDK compiler (item [1] in the section The native-code compiler (ocamlopt) requires the Microsoft compiler and the Microsoft assembler MASM64 (item [1]) and the flexdll tool (item [2]). +The LablTk GUI is not available in this version. INSTALLATION: @@ -322,20 +334,15 @@ described below. THIRD-PARTY SOFTWARE: -[1] Microsoft Windows Server 2003 R2 Platform SDK for AMD64 (PSDK-amd64.exe). - Can be downloaded for free from http://www.microsoft.com/. - Includes all we need, namely a C compiler, the masm64 assembler, - Windows libraries and include files. - - Alternatively, the more recent SDK: - Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1 - can be used. +[1] Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1. + Can be downloaded for free from + http://www.microsoft.com/downloads/en/default.aspx + under the name "Microsoft Windows 7 SDK". -[2] flexdll. +[2] flexdll version 0.23 or later. Can be downloaded from http://alain.frisch.fr/flexdll.html - RECOMPILATION FROM THE SOURCES: The command-line tools can be recompiled from the Unix source @@ -343,13 +350,38 @@ distribution (ocaml-X.YZ.tar.gz), which also contains the files modified for Windows. You will need the following software components to perform the recompilation: -- Windows XP 64 or Server 64. -- The Platform SDK (item [1] from the list of recommended software above). +- Windows XP 64, Windows Server 64, or Windows 7 64. +- Items [1] and [2] from the list of recommended software above. - The Cygwin port of GNU tools, available from http://www.cygwin.com/ Install at least the following packages: diffutils, make, ncurses. -- The flexdll tool (see above). -To recompile, start a Cygwin shell and change to the top-level +First, you need to set up your cygwin environment for using the MS +tools. The following assumes that you have installed [1] and [2] +in their default directories. If this is not the case, you will need +to adjust the paths accordingly. + + Open a Windows Command Prompt and enter the following commands: + set PFPATH=C:\Program Files (x86) + cd "%PFPATH%\Microsoft Visual Studio 9.0\VC\bin" + vcvars64 + echo VCPATH="`cygpath -p '%Path%'`" >C:\cygwin\tmp\msenv + echo LIB="%LIB%;C:\Tcl\lib" >>C:\cygwin\tmp\msenv + echo LIBPATH="%LIBPATH%" >>C:\cygwin\tmp\msenv + echo INCLUDE="%INCLUDE%;C:\Tcl\include" >>C:\cygwin\tmp\msenv + echo FLPATH="`cygpath '%PFPATH%\flexdll'`" >>C:\cygwin\tmp\msenv + echo PATH="${VCPATH}:$PATH:${FLPATH}" >>C:\cygwin\tmp\msenv + echo export PATH LIB LIBPATH INCLUDE >>C:\cygwin\tmp\msenv + echo export OCAMLBUILD_FIND=/usr/bin/find >>C:\cygwin\tmp\msenv + + Open a Cygwin shell and enter the following commands: + tr -d '\r' .msenv64 + echo '. $HOME/.msenv64' >>.bashrc + +Now, close the Command Prompt and the shell and you're set up for +using the MS tools under Cygwin. + + +To recompile OCaml, start a new Cygwin shell and change to the top-level directory of the OCaml distribution. Then, do cp config/m-nt.h config/m.h @@ -360,12 +392,6 @@ Then, edit config/Makefile as needed, following the comments in this file. Normally, the only variable that need to be changed is PREFIX where to install everything -If, for whatever reason, you want to use the Microsoft Visual C++ 2005 -compiler for AMD64 instead of the Platform SDK compiler, replace the line - EXTRALIBS=bufferoverflowu.lib -by - EXTRALIBS= - Finally, use "make -f Makefile.nt" to build the system, e.g. make -f Makefile.nt world diff --git a/VERSION b/VERSION index ac5d6051..100cc0d7 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ -3.12.0+rc1 +3.12.0 # The version string is the first line of this file. # It must be in the format described in stdlib/sys.mli -# $Id: VERSION 10630 2010-07-23 15:31:56Z doligez $ +# $Id: VERSION 10641 2010-08-02 13:10:35Z doligez $ diff --git a/boot/ocamlc b/boot/ocamlc index d1ead70c..0e7e1811 100755 Binary files a/boot/ocamlc and b/boot/ocamlc differ diff --git a/boot/ocamldep b/boot/ocamldep index c89ede7c..59d44704 100755 Binary files a/boot/ocamldep and b/boot/ocamldep differ diff --git a/boot/ocamllex b/boot/ocamllex index c70830f2..1987b5a3 100755 Binary files a/boot/ocamllex and b/boot/ocamllex differ diff --git a/byterun/Makefile b/byterun/Makefile index 081955f1..6d5b547c 100644 --- a/byterun/Makefile +++ b/byterun/Makefile @@ -11,12 +11,12 @@ # # ######################################################################### -# $Id: Makefile 9319 2009-07-20 11:51:50Z doligez $ +# $Id: Makefile 10638 2010-07-28 13:19:44Z doligez $ include Makefile.common CFLAGS=-DCAML_NAME_SPACE -O $(BYTECCCOMPOPTS) $(IFLEXDIR) -DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) +DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) $(IFLEXDIR) OBJS=$(COMMONOBJS) unix.o main.o DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o diff --git a/camlp4/Camlp4/Struct/Grammar/Tools.ml b/camlp4/Camlp4/Struct/Grammar/Tools.ml index 26489d37..4dae7e71 100644 --- a/camlp4/Camlp4/Struct/Grammar/Tools.ml +++ b/camlp4/Camlp4/Struct/Grammar/Tools.ml @@ -16,6 +16,18 @@ * - Daniel de Rauglaudre: initial version * - Nicolas Pouillard: refactoring *) + +(* BEGIN ugly hack. See 15 lines down. FIXME *) + +type prev_locs = { + pl_strm : mutable Obj.t; + pl_locs : mutable list (int * Obj.t) +}; + +value prev_locs = ref ([] : list prev_locs); + +(* END ugly hack FIXME *) + module Make (Structure : Structure.S) = struct open Structure; @@ -26,6 +38,64 @@ module Make (Structure : Structure.S) = struct [ [: ` x; strm :] -> [: ` (f x); stream_map f strm :] | [: :] -> [: :] ]; +(* ******************************************************************* *) +(* Ugly hack to prevent PR#5090. See how to do this properly after + the 3.12.0 release. FIXME. +*) + +value keep_prev_loc strm = + match Stream.peek strm with + [ None -> [: :] + | Some (_, init_loc) -> + let myrecord = { pl_strm = Obj.repr [: :]; + pl_locs = [(0, Obj.repr init_loc)] } + in + let rec go prev_loc = parser + [ [: `(tok, cur_loc); strm :] -> do { + myrecord.pl_locs := myrecord.pl_locs + @ [ (Stream.count strm, Obj.repr cur_loc) ]; + [: `(tok, {prev_loc; cur_loc}); go cur_loc strm :] } + | [: :] -> do { + prev_locs.val := List.filter ((!=) myrecord) prev_locs.val; + [: :] } ] + in + let result = go init_loc strm in + do { + prev_locs.val := [myrecord :: prev_locs.val]; + myrecord.pl_strm := Obj.repr result; + result } ]; + +value drop_prev_loc strm = stream_map (fun (tok,r) -> (tok,r)) strm; + +value get_cur_loc strm = + match Stream.peek strm with + [ Some (_,r) -> r.cur_loc + | None -> Loc.ghost ]; + +value get_prev_loc strm = + let c = Stream.count strm in + let rec drop l = + match l with + [ [] -> [] + | [(i, _) :: ll] -> if i < c then drop ll else l ] + in + let rec find l = + match l with + [ [] -> None + | [h::t] -> if h.pl_strm == Obj.repr strm then Some h else find t ] + in + match find prev_locs.val with + [ None -> Loc.ghost + | Some r -> do { + r.pl_locs := drop r.pl_locs; + match r.pl_locs with + [ [] -> Loc.ghost + | [(i, loc) :: _] -> + if i = c then (Obj.obj loc : Loc.t) else Loc.ghost ] } ]; + +(* ******************************************************************* *) +(* END of ugly hack. This is the previous code. + value keep_prev_loc strm = match Stream.peek strm with [ None -> [: :] @@ -46,6 +116,8 @@ module Make (Structure : Structure.S) = struct match Stream.peek strm with [ Some (_,r) -> r.prev_loc | None -> Loc.ghost ]; +*) + value is_level_labelled n lev = match lev.lname with diff --git a/configure b/configure index 48b05b7d..66ccda94 100755 --- a/configure +++ b/configure @@ -13,7 +13,7 @@ # # ######################################################################### -# $Id: configure 10626 2010-07-14 10:32:34Z xleroy $ +# $Id: configure 10636 2010-07-28 13:18:22Z doligez $ configure_options="$*" prefix=/usr/local @@ -576,14 +576,11 @@ if test $withsharedlibs = "yes"; then mksharedlibrpath="-rpath " shared_libraries_supported=true;; i[3456]86-*-darwin10.*) - if test $arch64 == true; then - mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress" - bytecccompopts="$dl_defs $bytecccompopts" - dl_needs_underscore=false - shared_libraries_supported=true - else - shared_libraries_supported=false - fi;; + mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress" + bytecccompopts="$dl_defs $bytecccompopts" + dl_needs_underscore=false + shared_libraries_supported=true + ;; i[3456]86-*-darwin*) mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress -read_only_relocs suppress" bytecccompopts="$dl_defs $bytecccompopts" diff --git a/stdlib/map.mli b/stdlib/map.mli index 8778cef1..a8843049 100644 --- a/stdlib/map.mli +++ b/stdlib/map.mli @@ -11,7 +11,7 @@ (* *) (***********************************************************************) -(* $Id: map.mli 10483 2010-05-31 12:48:13Z doligez $ *) +(* $Id: map.mli 10632 2010-07-24 14:16:58Z garrigue $ *) (** Association tables over ordered types. @@ -147,7 +147,7 @@ module type S = *) val max_binding: 'a t -> (key * 'a) - (** Same as {!Map.S.max_binding}, but returns the largest binding + (** Same as {!Map.S.min_binding}, but returns the largest binding of the given map. @since 3.12.0 *)