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 p5ND5PqR013168 for ; Thu, 23 Jun 2011 15:05:25 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgcIAO04A05APrys/2dsb2JhbABSmEWOWXepJJ9Lhi0EhyaPMR2LKg X-IronPort-AV: E=Sophos;i="4.65,413,1304287200"; d="scan'208";a="111781486" Received: from elehack.net ([64.62.188.172]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Jun 2011 15:05:19 +0200 Received: from [192.168.42.102] (unknown [68.168.162.166]) by elehack.net (Postfix) with ESMTPSA id A2E93EF1A0 for ; Thu, 23 Jun 2011 08:06:00 -0500 (CDT) Message-ID: <4E033A0D.5010300@elehack.net> Date: Thu, 23 Jun 2011 08:05:17 -0500 From: Michael Ekstrand User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: caml-list@inria.fr X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Caml-list] ocamlbuild: build-only dependencies on syntax extensions In my source tree, I build a few syntax extensions which are then used to compile other modules. I do this as follows: flag_and_dep ["ocaml"; "ocamldep"; "use_lll"] & S[A"-ppopt"; P"pa_lll.cma"]; flag_and_dep ["ocaml"; "compile"; "use_lll"] & S[A"-ppopt"; P"pa_lll.cma"]; Now, when I try to build the bytecode version of the program, it tries to link the syntax extension into the final program. When I use the syntax extensions as '.cma' files, the linker doesn't actually include anything from them since their modules are not depended on by anything. However, if I use them as '.cmo' files, it does fail because the linker attempts to unconditionally include them. Ideally, the linker would not even try to include them because they are only a compile-time dependency, not a runtime dependency. Is there something I can do in my ocamlbuild plugin to exclude the syntax extensions from being link-time dependencies, short of building them out-of-tree and using ocamlfind to bring them back in? Is this a bug (or missing feature) in ocamlbuild? I've played with non_dependency a bit, but if it's what I need I haven't found the magic incantation it requires to accomplish the purpose. Thanks, - Michael