From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q21Lr549027429 for ; Thu, 1 Mar 2012 22:53:05 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAPDuT0/VuiYS/2dsb2JhbABDhGlVrliBB4F9AQEEAQwXVgULCQIaAhgOAgIhHBoGE4gBCa1EihOBL4dshBYCCgYEBwMBBAMFCQ0UBgMChQcINh4YghuBFgSVOgGLG4dY X-IronPort-AV: E=Sophos;i="4.73,513,1325458800"; d="scan'208";a="147049630" Received: from solaria.dimino.org ([213.186.38.18]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 01 Mar 2012 22:52:59 +0100 Received: from locris.home (AToulouse-552-1-147-230.w2-6.abo.wanadoo.fr [2.6.74.230]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by solaria.dimino.org (Postfix) with ESMTPSA id 3F99380081; Thu, 1 Mar 2012 22:52:59 +0100 (CET) Date: Thu, 1 Mar 2012 22:52:58 +0100 From: =?UTF-8?B?SsOpcsOpbWll?= Dimino To: Thomas Gazagnaire Cc: caml-list@inria.fr Message-ID: <20120301225258.3cb2618b@locris.home> In-Reply-To: <066176AC-436B-496D-A472-37973A2791E9@gmail.com> References: <066176AC-436B-496D-A472-37973A2791E9@gmail.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q21Lr549027429 Subject: Re: [Caml-list] compiling static preprocessors Le Thu, 1 Mar 2012 20:58:38 +0100, Thomas Gazagnaire a écrit : > ocamlc dynlink.cma unix.cma \ > -I +camlp4 camlp4lib.cma -linkall \ > Camlp4Parsers/Camlp4OCamlRevisedParser.cmo \ > Camlp4Parsers/Camlp4OCamlParser.cmo \ > Camlp4Parsers/Camlp4OCamlRevisedParserParser.cmo \ > Camlp4Parsers/Camlp4OCamlParserParser.cmo \ > Camlp4Printers/Camlp4AutoPrinter.cmo \ > Camlp4Bin.cmo \ > -I +site-lib/type-conv pa_type_conv.cma \ > -I +site-lib/sexplib pa_sexp_conv.cma \ > -o sexppp > > I've taken the first lines by greping camlp4o.native in > ocaml-3.12.1/_build/_log and I've appended what normally follows > camlp4o when using sexplib. > > The command succeeds at building sexppp, but unfortunately, the > preprocessor doesn't work as expected: "./my_pp foo.ml" gives: "Parse > error: [semi] expected after [str_item] (in [implem])" for any type > followed by "with sexp" in foo.ml. > > I am trying to do something crazy or is there a chance to make it > work? It is because Camlp4Bin.cmo is linked before pa_type_conv.cma and pa_sexp_conv.cma, and so side-effects of theses modules are not yet performed when the camlp4 main function run. Camlp4Bin.cmo must be the last file on the command line. Cheers, -- Jérémie