diff -ruN mldonkey-2.5.21-clean/config/configure mldonkey-2.5.21/config/configure
--- mldonkey-2.5.21-clean/config/configure	2004-05-05 15:56:41.000000000 -0500
+++ mldonkey-2.5.21/config/configure	2004-07-23 15:32:04.000000000 -0500
@@ -1296,10 +1296,10 @@
 CURRENT_VERSION=2.5
 CURRENT_RELEASE=21
 
-REQUIRED_OCAML=3.07
-DOWNLOAD_OCAML=3.07pl2
+REQUIRED_OCAML=3.08
+DOWNLOAD_OCAML=3.08.0
 
-REQUIRED_LABLGTK=1.2.6
+REQUIRED_LABLGTK=1.2.7
 
 touch install-sh
 
@@ -3969,6 +3969,7 @@
     "$REQUIRED_OCAML"*) ;;
     3.06*);;
     3.07*);;
+    3.08*);;
     "$REQUIRED_OCAML_REG") ;;
     *) echo "Need build"
        BUILD_OCAML=yes;;
@@ -4186,7 +4187,7 @@
       cd $BUILD_DIR
       rm -rf ocaml-"$REQUIRED_OCAML"
       gzip -cd $PATCH_DIR/ocaml-"$DOWNLOAD_OCAML".tar.gz | tar vxf -
-      cd ocaml-"$REQUIRED_OCAML"
+      cd ocaml-"$DOWNLOAD_OCAML"
       if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
         echo Patching ...
         patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
@@ -9847,8 +9848,8 @@
 ARCH=$arch
 
 case "$OCAMLVERSION" in
-  3.06* | 3.07* ) TYPE_FORMAT="";;
-  *) TYPE_FORMAT="type ('a,'b,'c) ml_format = ('a,'b, 'c,'c) format  type ('a,'b,'c) format = ('a,'b, 'c) ml_format";;
+  3.06* | 3.07* | 3.08* | 3.09* ) TYPE_FORMAT="";;
+  *) TYPE_FORMAT="type ('a,'b,'c) ml_format = ('a,'b, 'c,'c) format4  type ('a,'b,'c) format = ('a,'b, 'c) ml_format";;
 esac
 
 if test "$OS_FILES" = "mingw"; then
@@ -11163,6 +11164,12 @@
    windres -o resfile.o config/mldonkey.rc
 fi
 
+if test "$OS_FILES" = "cygwin"; then
+   echo "compiling win32 resource file"
+   windres -o resfile.o config/mldonkey.rc
+fi
+
+
 echo "Building dependencies"
 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: 'make depend' or 'gmake depend'"
 
diff -ruN mldonkey-2.5.21-clean/config/configure.in mldonkey-2.5.21/config/configure.in
--- mldonkey-2.5.21-clean/config/configure.in	2004-05-05 15:56:41.000000000 -0500
+++ mldonkey-2.5.21/config/configure.in	2004-07-23 15:32:04.000000000 -0500
@@ -776,7 +776,7 @@
 
 case "$OCAMLVERSION" in
   3.06* | 3.07* ) TYPE_FORMAT="";;
-  *) TYPE_FORMAT="type ('a,'b,'c) ml_format = ('a,'b, 'c,'c) format  type ('a,'b,'c) format = ('a,'b, 'c) ml_format";;
+  *) TYPE_FORMAT="type ('a,'b,'c) ml_format = ('a,'b, 'c,'c) format4  type ('a,'b,'c) format = ('a,'b, 'c) ml_format";;
 esac		    
 
 if test "$OS_FILES" = "mingw"; then
diff -ruN mldonkey-2.5.21-clean/distrib/Install.txt mldonkey-2.5.21/distrib/Install.txt
--- mldonkey-2.5.21-clean/distrib/Install.txt	2004-05-05 15:56:42.000000000 -0500
+++ mldonkey-2.5.21/distrib/Install.txt	2004-07-23 15:32:04.000000000 -0500
@@ -61,29 +61,29 @@
 is compiled.
 
 ------------------------------------------------------------------------
-1) Installing required tools: Objective-Caml and LablGTK 1.2.6
-   Recommended version of Objective-Caml for MinGW is 3.06, on Unix 3.07+2.
-   Example configuration for Ocaml 3.06:
+1) Installing required tools: Objective-Caml and LablGTK 1.2.7
+   Recommended version of Objective-Caml for MinGW is 3.06, on Unix 3.08.0
+   Example configuration for Ocaml 3.08.0:
 
- 1.1) Objective-Caml 3.06 (from   http://pauillac.inria.fr/caml)
+ 1.1) Objective-Caml 3.08.0 (from   http://pauillac.inria.fr/caml)
 
-    ~/tmp> tar zxf ocaml-3.06.tar.gz
-    ~/tmp> cd ocaml-3.06
+    ~/tmp> tar zxf ocaml-3.08.0.tar.gz
+    ~/tmp> cd ocaml-3.08.0
 
    If you REALLY want to patch it:
-    ~/tmp/ocaml-3.06> ./configure
-    ~/tmp/ocaml-3.06> make world opt opt.opt
-    ~/tmp/ocaml-3.06> make install
+    ~/tmp/ocaml-3.08.0> ./configure
+    ~/tmp/ocaml-3.08.0> make world opt opt.opt
+    ~/tmp/ocaml-3.08.0> make install
 
- 1.2) LablGTK 1.2.6 (from 
+ 1.2) LablGTK 1.2.7 (from 
             http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html)
 
-    ~/tmp> tar zxf lablgtk-1.2.6.tar.gz
-    ~/tmp> cd lablgtk-1.2.6
-    ~/tmp/lablgtk-1.2.6> make configure
-    ~/tmp/lablgtk-1.2.6> make
-    ~/tmp/lablgtk-1.2.6> make opt
-    ~/tmp/lablgtk-1.2.6> make install
+    ~/tmp> tar zxf lablgtk-1.2.7.tar.gz
+    ~/tmp> cd lablgtk-1.2.7
+    ~/tmp/lablgtk-1.2.7> make configure
+    ~/tmp/lablgtk-1.2.7> make
+    ~/tmp/lablgtk-1.2.7> make opt
+    ~/tmp/lablgtk-1.2.7> make install
 
 2) Compiling mldonkey:
 
diff -ruN mldonkey-2.5.21-clean/donkey mldonkey-2.5.21/donkey
--- mldonkey-2.5.21-clean/donkey	1969-12-31 18:00:00.000000000 -0600
+++ mldonkey-2.5.21/donkey	2004-07-23 15:32:04.000000000 -0500
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Start/Stop script for mldonkey
+
+case "$1" in
+    start)
+        if [ ! -d ~/.mldonkey ]; then
+	        echo "Creating $HOME/.mldonkey"  
+                cd @FINKPREFIX@/share; cp -r mldonkey $HOME/.mldonkey
+        fi
+        echo "Starting mldonkey"
+        cd ~/.mldonkey && exec @FINKPREFIX@/bin/mlnet -daemon
+        ;;
+
+    stop)
+        echo "Stopping mldonkey"
+        killall mlnet
+        ;;
+    
+    *)
+        echo "Start/Stop script for mldonkey"
+        echo "Usage: $0 {start|stop}"
+        exit 1
+        ;;
+
+esac
diff -ruN mldonkey-2.5.21-clean/src/daemon/common/commonOptions.ml mldonkey-2.5.21/src/daemon/common/commonOptions.ml
--- mldonkey-2.5.21-clean/src/daemon/common/commonOptions.ml	2004-05-05 15:56:46.000000000 -0500
+++ mldonkey-2.5.21/src/daemon/common/commonOptions.ml	2004-07-23 15:32:04.000000000 -0500
@@ -778,11 +778,11 @@
   
 let mldonkey_bin = define_expert_option current_section ["mldonkey_bin"]
     "Directory where mldonkey binaries are installed"
-    string_option bin_dir
+    string_option "@FINKPREFIX@/bin"
 
 let mldonkey_gui = define_expert_option current_section ["mldonkey_gui"]
     "Name of GUI to start" string_option 
-    (Filename.concat bin_dir "mlgui")
+    "@FINKPREFIX@/bin/mldonkey_gui"
 
   
   
@@ -1136,7 +1136,7 @@
   set this option, mldonkey will log this info in the file until you use the
 'close_log' command. The log file may become very large. You can
     also enable logging in a file after startup using the 'log_file' command."
-  string_option ""  
+  string_option "./mldonkey.log"  
 
 let verbosity = define_expert_option current_section ["verbosity"] 
   "A space-separated list of keywords. Each keyword triggers
diff -ruN mldonkey-2.5.21-clean/src/networks/donkey/donkeyClient.ml mldonkey-2.5.21/src/networks/donkey/donkeyClient.ml
--- mldonkey-2.5.21-clean/src/networks/donkey/donkeyClient.ml	2004-05-05 15:56:49.000000000 -0500
+++ mldonkey-2.5.21/src/networks/donkey/donkeyClient.ml	2004-07-23 15:32:04.000000000 -0500
@@ -677,7 +677,7 @@
 (* Nice to see some emule devels here... It's always possible to 
 crack a protocol, but let's try to make it as boring as possible... *)
     
-    external hash_param : int -> int -> 'a -> int = "hash_univ_param" "noalloc"
+    external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
 let hash x = hash_param 10 100 x
 
 let shared_of_file file =
@@ -2200,4 +2200,4 @@
             (Printexc2.to_string e)
   )
   
-  
\ No newline at end of file
+  
diff -ruN mldonkey-2.5.21-clean/src/networks/donkey/donkeyInteractive.ml mldonkey-2.5.21/src/networks/donkey/donkeyInteractive.ml
--- mldonkey-2.5.21-clean/src/networks/donkey/donkeyInteractive.ml	2004-05-05 15:56:49.000000000 -0500
+++ mldonkey-2.5.21/src/networks/donkey/donkeyInteractive.ml	2004-07-23 15:32:04.000000000 -0500
@@ -1235,7 +1235,7 @@
           | Some _ ->  ( 
                 let qfiles = c.client_file_queue in
                 let (qfile, qchunks,_) =  List.hd qfiles in
-                if (qfile = (as_file_impl file).impl_file_val) then begin
+                if (qfile == (as_file_impl file).impl_file_val) then begin
                     client_print (as_client c) o;
                     Printf.bprintf buf "\n%14sDown  : %-10s                  Uploaded: %-10s  Ratio: %s%1.1f (%s)\n" ""
                     (Int64.to_string c.client_downloaded) 
@@ -1263,7 +1263,7 @@
           | Some _ ->  ( 
                 let qfiles = c.client_file_queue in
                 let (qfile, qchunks,_) =  List.hd qfiles in
-                if (qfile = (as_file_impl file).impl_file_val) then begin
+                if (qfile == (as_file_impl file).impl_file_val) then begin
                     let i = (client_info (as_client c)) in
                     
                     Printf.bprintf buf " \\<tr onMouseOver=\\\"mOvr(this);\\\" onMouseOut=\\\"mOut(this);\\\" 
diff -ruN mldonkey-2.5.21-clean/src/utils/cdk/printf2.ml mldonkey-2.5.21/src/utils/cdk/printf2.ml
--- mldonkey-2.5.21-clean/src/utils/cdk/printf2.ml	2004-05-05 15:56:50.000000000 -0500
+++ mldonkey-2.5.21/src/utils/cdk/printf2.ml	2004-07-23 15:32:04.000000000 -0500
@@ -21,11 +21,11 @@
 open Autoconf
 
 
-external format_int: string -> int -> string = "format_int"
-external format_int32: string -> int32 -> string = "int32_format"
-external format_nativeint: string -> nativeint -> string = "nativeint_format"
-external format_int64: string -> int64 -> string = "int64_format"
-external format_float: string -> float -> string = "format_float"
+external format_int: string -> int -> string = "caml_format_int"
+external format_int32: string -> int32 -> string = "caml_int32_format"
+external format_nativeint: string -> nativeint -> string = "caml_nativeint_format"
+external format_int64: string -> int64 -> string = "caml_int64_format"
+external format_float: string -> float -> string = "caml_format_float"
 
 let bad_format fmt pos =
   invalid_arg
diff -ruN mldonkey-2.5.21-clean/src/utils/cdk/weak2.ml mldonkey-2.5.21/src/utils/cdk/weak2.ml
--- mldonkey-2.5.21-clean/src/utils/cdk/weak2.ml	2004-05-05 15:56:50.000000000 -0500
+++ mldonkey-2.5.21/src/utils/cdk/weak2.ml	2004-07-23 15:32:04.000000000 -0500
@@ -16,14 +16,14 @@
 
 type 'a t;;
 
-external create: int -> 'a t = "weak_create";;
+external create: int -> 'a t = "caml_weak_create";;
 
 let length x = Obj.size(Obj.repr x) - 1;;
 
-external set : 'a t -> int -> 'a option -> unit = "weak_set";;
-external get: 'a t -> int -> 'a option = "weak_get";;
-external get_copy: 'a t -> int -> 'a option = "weak_get_copy";;
-external check: 'a t -> int -> bool = "weak_check";;
+external set : 'a t -> int -> 'a option -> unit = "caml_weak_set";;
+external get: 'a t -> int -> 'a option = "caml_weak_get";;
+external get_copy: 'a t -> int -> 'a option = "caml_weak_get_copy";;
+external check: 'a t -> int -> bool = "caml_weak_check";;
 
 let fill ar ofs len x =
   if ofs < 0 || len < 0 || ofs + len > length ar
diff -ruN mldonkey-2.5.21-clean/src/utils/lib/options.ml4 mldonkey-2.5.21/src/utils/lib/options.ml4
--- mldonkey-2.5.21-clean/src/utils/lib/options.ml4	2004-05-05 15:56:51.000000000 -0500
+++ mldonkey-2.5.21/src/utils/lib/options.ml4	2004-07-23 15:32:04.000000000 -0500
@@ -302,7 +302,7 @@
 
 
 let unsafe_get = String.unsafe_get
-external is_printable : char -> bool = "is_printable"
+external is_printable : char -> bool = "caml_is_printable"
 let unsafe_set = String.unsafe_set
   
 let escaped s =
@@ -1172,4 +1172,4 @@
 let iter_file f file =
   List.iter (iter_section f) file.file_sections
   
-let strings_of_option o = strings_of_option "" o
\ No newline at end of file
+let strings_of_option o = strings_of_option "" o
diff -ruN mldonkey-2.5.21-clean/src/utils/lib/stubs_c.c mldonkey-2.5.21/src/utils/lib/stubs_c.c
--- mldonkey-2.5.21-clean/src/utils/lib/stubs_c.c	2004-05-05 15:56:51.000000000 -0500
+++ mldonkey-2.5.21/src/utils/lib/stubs_c.c	2004-07-23 15:32:04.000000000 -0500
@@ -739,13 +739,14 @@
   return 1;
 }
 
-extern value alloc_inet_addr(uint32 a);
+
+extern value alloc_inet_addr(struct in_addr * a);
 
 static value alloc_one_addr(char volatile *a)
 {
   struct in_addr addr;
   memmove (&addr, (char*)a, entry_h_length);
-  return alloc_inet_addr(addr.s_addr);
+  return alloc_inet_addr(&addr);
 }
 
 static void store_in_job(value job_v)
diff -ruN mldonkey-2.5.21-clean/src/utils/net/tcpBufferedSocket.ml mldonkey-2.5.21/src/utils/net/tcpBufferedSocket.ml
--- mldonkey-2.5.21-clean/src/utils/net/tcpBufferedSocket.ml	2004-05-05 15:56:51.000000000 -0500
+++ mldonkey-2.5.21/src/utils/net/tcpBufferedSocket.ml	2004-07-23 15:32:04.000000000 -0500
@@ -460,7 +460,7 @@
             forecast_download t 0;
           end;
         close t.sock_in s;
-        if t.sock_in <> t.sock_out then
+        if t.sock_in != t.sock_out then
           close t.sock_out s
         (* (Printf.sprintf "%s after %d/%d" s t.nread t.nwrite) *)
       with e ->
@@ -477,7 +477,7 @@
   *)
   (try 
       BasicSocket.shutdown t.sock_out s;
-      if t.sock_in <> t.sock_out then
+      if t.sock_in != t.sock_out then
         BasicSocket.shutdown t.sock_in s;
       with e ->
        lprintf "exception %s in shutdown\n" (Printexc2.to_string e);
@@ -1766,4 +1766,4 @@
   
   
 let packet_frame_size = ref 250
-  
\ No newline at end of file
+  
diff -ruN mldonkey-2.5.21-clean/tools/zoggy/pa_zog.ml mldonkey-2.5.21/tools/zoggy/pa_zog.ml
--- mldonkey-2.5.21-clean/tools/zoggy/pa_zog.ml	2004-05-05 15:56:51.000000000 -0500
+++ mldonkey-2.5.21/tools/zoggy/pa_zog.ml	2004-07-23 15:32:07.000000000 -0500
@@ -1,13 +1,28 @@
-(***********************************************************************)
-(*                                Zoggy                                *)
-(*                                                                     *)
-(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt      *)
-(*                                                                     *)
-(*  Copyright 2001 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the Q Public License version 1.0.               *)
-(*                                                                     *)
-(***********************************************************************)
+(**************************************************************************)
+(*                   Cameleon                                             *)
+(*                                                                        *)
+(*      Copyright (C) 2002 Institut National de Recherche en Informatique et   *)
+(*      en Automatique. All rights reserved.                              *)
+(*                                                                        *)
+(*      This program is free software; you can redistribute it and/or modify  *)
+(*      it under the terms of the GNU General Public License as published by  *)
+(*      the Free Software Foundation; either version 2 of the License, or  *)
+(*      any later version.                                                *)
+(*                                                                        *)
+(*      This program is distributed in the hope that it will be useful,   *)
+(*      but WITHOUT ANY WARRANTY; without even the implied warranty of    *)
+(*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     *)
+(*      GNU General Public License for more details.                      *)
+(*                                                                        *)
+(*      You should have received a copy of the GNU General Public License  *)
+(*      along with this program; if not, write to the Free Software       *)
+(*      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          *)
+(*      02111-1307  USA                                                   *)
+(*                                                                        *)
+(*      Contact: Maxence.Guesdon@inria.fr                                *)
+(**************************************************************************)
+
+(* $Id: pa_zog.ml,v 1.8 2004/07/14 07:55:11 zoggy Exp $ *)
 
 #load "pa_extend.cmo";;
 #load "q_MLast.cmo";;
@@ -33,21 +48,48 @@
   
 let parse_string loc =
   function
-    "false" -> <:expr< False >>
-  | "true" -> <:expr< True >>
+    "false" -> 
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
+      <:expr< False >>
+  | "true" ->
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
+      <:expr< True >>
+
   | str ->
       try
         let strm = Stream.of_string str in
         let r = Grammar.Entry.parse Pcaml.expr strm in
-        Pcaml.expr_reloc (fun _ -> loc) 0 r
+        Pcaml.expr_reloc
+	  (fun _ -> Lexing.dummy_pos, Lexing.dummy_pos) 
+	  Lexing.dummy_pos 
+	  r
       with
         e ->
           Printf.eprintf "Error in \"%s\"\n" str; flush stderr;
           let (e, loc) =
             match e with
               Stdpp.Exc_located ((bp, ep), e) ->
-                e, (fst loc + bp, fst loc + ep)
-            | e -> (e, loc)
+                e, ({ Lexing.dummy_pos with
+		      Lexing.pos_cnum = fst loc + bp.Lexing.pos_cnum}, 
+		    { Lexing.dummy_pos with
+		      Lexing.pos_cnum = fst loc + ep.Lexing.pos_cnum}
+		   )
+            | e -> (e, ({ Lexing.dummy_pos with
+			  Lexing.pos_cnum = fst loc} ,
+			{ Lexing.dummy_pos with
+			  Lexing.pos_cnum = snd loc}
+		       )
+		   )
           in
           Stdpp.raise_with_loc loc e
 
@@ -65,7 +107,14 @@
     let p = List.find (fun p -> p.prop_kind = kind) props in
     parse_prop_value p
   with
-    Not_found -> <:expr< "" >>
+    Not_found -> 
+      	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
+	<:expr< "" >>
 
 let get_prop_label ele prop =
   match prop.prop_kind with
@@ -193,6 +242,13 @@
       (_, n, _, _) -> n
 
 let ast_of_creation_options_code loc ele f =
+  let loc = 
+    (
+     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+    )	
+  in
+
   let g f prop =
     match prop.prop_kind with
       Function | Tab_label | Expand | Fill | Padding -> f
@@ -202,19 +258,19 @@
     | PPixmap_file ->
 	if must_gen prop then
           let v = parse_prop_value prop in
-            <:expr< $f$ (GDraw.pixmap_from_xpm ~file : $v$ ()) >>
+          <:expr< $f$ (GDraw.pixmap_from_xpm ~file : $v$ ()) >>
 	else
  	  raise (Field_error (field_error_string PPixmap_file))
     | PPixmap_data ->
 	if must_gen prop then
           let v = parse_prop_value prop in
-            <:expr< $f$ (GDraw.pixmap_from_xpm_d ~data : $v$ ()) >>
+          <:expr< $f$ (GDraw.pixmap_from_xpm_d ~data : $v$ ()) >>
 	else
  	  raise (Field_error (field_error_string PPixmap_data))
     | PPixmap_code ->
 	if must_gen prop then
           let v = parse_prop_value prop in
-            <:expr< $f$ $v$ >>
+          <:expr< $f$ $v$ >>
 	else
  	  raise (Field_error (field_error_string PPixmap_code))
     | _ ->
@@ -230,6 +286,12 @@
     match prop.prop_kind with
       Expand | Fill | Padding ->
         if must_gen prop then
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	    )	
+	  in
           let v = parse_prop_value prop in
           <:expr< $f$ ~ $get_prop_label ele prop$ : $v$ >>
         else f
@@ -237,27 +299,57 @@
   in
   List.fold_left g f ele.props
 
-let ast_of_pack_code loc parent ele f =
+let ast_of_pack_code (loc : int * int) parent ele f =
   try
     let pack_met = Zog_types.pack_method_of_ele parent ele in
     match pack_met with
       No_pack -> f
     | Insert_page ->
-        let g = let loc = parent.name_loc in <:expr< $lid:parent.name$ >> in
+        let g = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst parent.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd parent.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:parent.name$ >> 
+	in
+	let loc1 = loc in
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
         <:expr<
           $f$ ~packing:
             (fun w ->
                $g$ # append_page
                  ~tab_label:
                     (GMisc.label
-                        ~text:$ast_of_prop_value loc ele.props Tab_label$ ())
+                        ~text:$ast_of_prop_value loc1 ele.props Tab_label$ ())
                     #coerce w)
         >>
     | _ ->
-        let g = let loc = parent.name_loc in <:expr< $lid:parent.name$ >> in
+        let g = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst parent.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd parent.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:parent.name$ >> 
+	in
+	let loc1 = loc in
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
         let p x = <:expr< $f$ ~packing: $x$ >> in
         match pack_met with
-          Pack -> p (ast_of_pack_options_code loc <:expr< $g$ # pack >> ele)
+          Pack -> p (ast_of_pack_options_code loc1 <:expr< $g$ # pack >> ele)
         | Add -> p <:expr< $g$ # add >>
         | Add1 -> p <:expr< $g$ # add1 >>
         | Add2 -> p <:expr< $g$ # add2 >>
@@ -265,7 +357,15 @@
         | Set_submenu -> p <:expr< $g$ # set_submenu >>
         | Insert_page | No_pack -> f
   with
-    Failure s -> prerr_endline s; <:expr< $f$ failed >>
+    Failure s -> 
+      	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
+	prerr_endline s; 
+	<:expr< $f$ failed >>
 
 let ast_of_custom_pack_code loc parent ele ce =
   try
@@ -274,23 +374,62 @@
       No_pack -> ce
     | Insert_page ->
 
-	let g = let loc = parent.name_loc in <:expr< $lid:parent.name$>> in
-        let n = let loc = ele.name_loc in <:expr< $lid:ele.name$ >> in
+	let g = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst parent.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd parent.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:parent.name$>> 
+	in
+        let n = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst ele.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd ele.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:ele.name$ >> 
+	in
+	let loc1 = loc in
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
+
         <:class_expr<
         let _ = $g$ # append_page
             ~tab_label:
             (GMisc.label
-               ~text:$ast_of_prop_value loc ele.props
+               ~text:$ast_of_prop_value loc1 ele.props
                Tab_label$ ())
             #coerce $n$#coerce in
         $ce$
         >>
     | _ ->
 
-        let g = let loc = parent.name_loc in <:expr< $lid:parent.name$ >> in
+        let g = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst parent.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd parent.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:parent.name$ >> 
+	in
+	let loc1 = loc in
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
         let r =
           match pack_met with
-            Pack -> ast_of_pack_options_code loc <:expr< $g$ # pack >> ele
+            Pack -> ast_of_pack_options_code loc1 <:expr< $g$ # pack >> ele
           | Add -> <:expr< $g$ # add >>
           | Add1 -> <:expr< $g$ # add1 >>
           | Add2 -> <:expr< $g$ # add2 >>
@@ -298,10 +437,26 @@
           | Set_submenu -> <:expr< $g$ # set_submenu >>
           | Insert_page | No_pack -> g
         in
-        let n = let loc = ele.name_loc in <:expr< $lid:ele.name$ >> in
+        let n = 
+	  let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst ele.name_loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd ele.name_loc }
+	    )	
+	  in
+	  <:expr< $lid:ele.name$ >> 
+	in
         <:class_expr< let _ = $r$ $n$ # coerce in $ce$ >>
   with
-    Failure s -> prerr_endline s; <:class_expr< let _ = failed in $ce$ >>
+    Failure s -> 
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+      in
+      prerr_endline s; 
+      <:class_expr< let _ = failed in $ce$ >>
 
 (** The accel_group variable name for the given Menubar ele. *)
 let accel_group_name ele =
@@ -329,22 +484,44 @@
         match
           remove_blanks (Zog_types.get_prop_value ele.props Accel_modifier)
         with
-          "" -> <:expr< [] >>
+          "" -> 
+	    let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	    )	
+	    in
+	    <:expr< [] >>
         | s -> parse_string loc s
       in
       let flags =
         match
           remove_blanks (Zog_types.get_prop_value ele.props Accel_flags)
         with
-          "" -> <:expr< [] >>
+          "" ->
+	    let loc = 
+	    (
+	     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	    )	
+	    in
+	    <:expr< [] >>
         | s -> parse_string loc s
       in
+      let loc1 = loc in
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
       <:class_expr<
         let _ =
           $lid:ele.name$ #add_accelerator ~group: $lid:accel_name$
-             ~modi: $modifier$ ~flags: $flags$ $parse_string loc v$
+             ~modi: $modifier$ ~flags: $flags$ $parse_string loc1 v$
         in
         $ce$ >>
+
 and ast_of_post_menu_creation_code loc accel_name ele ce =
   match ele.classe with
     Menu ->
@@ -352,6 +529,12 @@
         List.fold_right (ast_of_post_menu_item_creation_code loc accel_name)
           ele.children ce
       in
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
       <:class_expr<
          let _ = $lid:ele.name$ #set_accel_group $lid:accel_name$ in $ce$ >>
   | _ -> ce
@@ -370,11 +553,23 @@
 	 match win with
 	   None -> ce
 	 | Some w -> 
+	     let loc = 
+	       (
+		{ Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+		{ Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	       )	
+	     in
 	     <:class_expr<
 	     let _ = $lid:w$#add_accel_group $lid:acc_name$ in $ce$
 	     >>
 	)      
       in
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in      
       <:class_expr<
       let $lid:acc_name$ = GtkData.AccelGroup.create () in 
       $ce2$
@@ -402,6 +597,12 @@
       let f =
         match ele.classe, previous_opt with
           Radio_menu_item, Some e when e.classe = Radio_menu_item ->
+	    let loc = 
+	      (
+	       { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	       { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	      )	
+	    in
             <:expr< $f$ ~group: $lid:e.name$ #group >>
         | _ -> f
       in
@@ -419,41 +620,101 @@
 (* BEGIN CDK *)
   gen_anonynous_name ele;
   if ele.name = "_" then  
-      <:class_expr< let _ = $e$ () in $ce$  >>
+      	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
+	<:class_expr< let _ = $e$ () in $ce$  >>
     else
     (* END CDK *)
-  let n = let loc = ele.name_loc in <:patt< $lid:ele.name$ >> in
+  let n = 
+    let loc = 
+      (
+       { Lexing.dummy_pos with Lexing.pos_cnum = fst ele.name_loc } ,
+       { Lexing.dummy_pos with Lexing.pos_cnum = snd ele.name_loc }
+	  )	
+    in <:patt< $lid:ele.name$ >> 
+  in
+  let loc = 
+    (
+     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+    )	
+  in
   <:class_expr< let $n$ = $e$ () in $ce$ >>
 
-let rec ast_of_ele_methods loc ele =
-  let cil =
-    if ele.classe = Menubar then
-      let accel_name = accel_group_name ele in
-      [<:class_str_item< method $accel_name$ = $lid:accel_name$ >>]
-    else []
-  in
+  let rec ast_of_ele_methods loc ele =
+    let cil =
+      if ele.classe = Menubar then
+	let accel_name = accel_group_name ele in
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+	in
+	[<:class_str_item< method $accel_name$ = $lid:accel_name$ >>]
+      else []
+    in
 (* BEGIN CDK *)
-  gen_anonynous_name ele;
-  let cil = if ele.name.[0] <> '_' then 
-    let n = let loc = ele.name_loc in <:expr< $lid:ele.name$ >> in
-    <:class_str_item< method $ele.name$ = $n$ >> :: cil else cil in
+    gen_anonynous_name ele;
+    let cil = if ele.name.[0] <> '_' then 
+      let n = 
+	let loc = 
+	  (
+	   { Lexing.dummy_pos with Lexing.pos_cnum = fst ele.name_loc } ,
+	   { Lexing.dummy_pos with Lexing.pos_cnum = snd ele.name_loc }
+	  )	
+	in
+	<:expr< $lid:ele.name$ >> 
+      in
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
+      <:class_str_item< method $ele.name$ = $n$ >> :: cil else cil in
 (* END CDK *)  
-  List.fold_left (fun cil ele -> cil @ ast_of_ele_methods loc ele) cil
-    ele.children
+    List.fold_left (fun cil ele -> cil @ ast_of_ele_methods loc ele) cil
+      ele.children
   
 let rec ast_of_ele_vals loc ele =
   let cil =
     if ele.classe = Menubar then
       let accel_name = accel_group_name ele in
+      let loc = 
+	(
+	 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+	 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	)	
+      in
       [<:class_str_item< value $accel_name$ = $lid:accel_name$ >>]
     else []
   in
 (* BEGIN CDK *)
   gen_anonynous_name ele;
-  let n = let loc = ele.name_loc in <:expr< $lid:ele.name$ >> in
+  let n = 
+    let loc = 
+      (
+       { Lexing.dummy_pos with Lexing.pos_cnum = fst ele.name_loc } ,
+       { Lexing.dummy_pos with Lexing.pos_cnum = snd ele.name_loc }
+      )	
+    in
+    <:expr< $lid:ele.name$ >> 
+  in
   let cil = if ele.name.[0] <> '_' then 
+    let loc = 
+      (
+       { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+       { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+      )	
+    in
     <:class_str_item< value $ele.name$ = $n$ >> :: cil  
-   else cil in
+   else cil 
+  in
 (* END CDK *)  
   List.fold_left (fun cil ele -> cil @ ast_of_ele_vals loc ele) cil
     ele.children
@@ -468,10 +729,29 @@
           match e.classe with
             Window -> cil
           | _ ->
-              let n = let loc = e.name_loc in <:expr< $lid:e.name$ >> in
+              let n = 
+		let loc = 
+		  (
+		   { Lexing.dummy_pos with Lexing.pos_cnum = fst e.name_loc } ,
+		   { Lexing.dummy_pos with Lexing.pos_cnum = snd e.name_loc }
+		  )	
+		in <:expr< $lid:e.name$ >> 
+	      in
+	      let loc = 
+		(
+		 { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+		 { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+		)	
+	      in
               let ci = <:class_str_item< method coerce = $n$ # coerce >> in
               cil @ [ci]
     in
+    let loc = 
+      (
+       { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+       { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+      )	
+    in
     <:class_expr< object $None$ $list:cil$ end >>
   in
   let ce =
@@ -485,6 +765,12 @@
 	in
 	ast_of_ele_creations ?win: win_opt loc None None ele ce
   in
+  let loc = 
+    (
+     { Lexing.dummy_pos with Lexing.pos_cnum = fst loc } ,
+     { Lexing.dummy_pos with Lexing.pos_cnum = snd loc }
+	  )	
+  in
   let ce =
     List.fold_right (fun p ce -> <:class_expr< fun $lid:p$ -> $ce$ >>)
       entity.en_params <:class_expr< fun () -> $ce$ >>
@@ -511,7 +797,10 @@
           ">" ->
 	    try
               let entity = {en_name = name; en_params = pl; en_ele = w} in
-		ast_of_entity loc entity, loc
+	      (
+	       let loc = ((fst loc).Lexing.pos_cnum, (snd loc).Lexing.pos_cnum) in
+	       ast_of_entity loc entity
+	      ), loc
             with Field_error m ->
               field_error m;
 	      exit 1
@@ -531,9 +820,11 @@
               List.map
                 (fun (x, v, vloc) ->
                    {prop_kind = Zog_misc.property_kind_of_property_name x;
-                    prop_value = Zog_misc.decode v; prop_value_loc = vloc})
+                    prop_value = Zog_misc.decode v; 
+		     prop_value_loc = ((fst vloc).Lexing.pos_cnum, (snd vloc).Lexing.pos_cnum)})
                 proplist
             in
+	    let nloc = ((fst loc).Lexing.pos_cnum, (snd loc).Lexing.pos_cnum) in
             { name = name; name_loc = nloc;
               classe = Zog_misc.class_of_class_name tag; 
 	      props = proplist;
@@ -548,7 +839,7 @@
       [ [ x = LIDENT; "="; (v, vloc) = string -> x, v, vloc ] ]
     ;
     string:
-      [ [ v = STRING -> v, loc ] ]
+      [ [ v = STRING -> v,  loc ] ]
     ;
     ident:
       [ [ v = LIDENT -> v, loc ] ]
