------------------------------------------------------------------------------
- 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:
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:
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.
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' </tmp/msenv >.msenv
- echo '. $HOME/.msenv' >>.bashrc
+ tr -d '\r' </tmp/msenv >.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.
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
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:
------------------------------------------------------------------------------
- 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.
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:
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
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' </tmp/msenv >.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
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
* - 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;
[ [: ` 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 -> [: :]
match Stream.peek strm with
[ Some (_,r) -> r.prev_loc
| None -> Loc.ghost ];
+*)
+
value is_level_labelled n lev =
match lev.lname with