From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6KD6dFH014231 for ; Wed, 20 Jul 2011 15:06:39 +0200 X-IronPort-AV: E=Sophos;i="4.67,235,1309730400"; d="scan'208";a="98888332" Received: from mp-57040.rocqadm.inria.fr ([128.93.57.40]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 20 Jul 2011 15:06:34 +0200 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: xclerc In-Reply-To: <20110720124800.GA21796@guillaume-laptop> Date: Wed, 20 Jul 2011 15:06:34 +0200 Cc: xclerc Clerc Message-Id: References: <20110720124800.GA21796@guillaume-laptop> To: caml users X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p6KD6dFH014231 Subject: Re: [Caml-list] ocamlbuild and cflags Le 20 juil. 2011 à 14:48, Guillaume Hennequin a écrit : > Hello, > > I came across two ocamlbuild issues today: > > 1) how can one give a cflag that requires an argument, like > ocamlbuild -cflag -inline 2 target.native > Backtrace: > - failed to build the target 2 To overcome this problem you can execute either ocamlbuild -cflag -inline -cflag 2 target.native or ocamlbuild -cflags -inline,2 target.native > 2) I don't understand why ocamlbuild target.cmx would need to compile > target.cmo on the way... this actually prevents me from using any of the > ocamlopt-specific flags: > ocamlbuild -cflag -S target.cmx > (ocamlc itself complains it doesn't have a -S option) > > any way around that? This is a reported bug [1]; in your case, a workaround is to write the following "myocamlbuild.ml" file: open Ocamlbuild_plugin let () = dispatch begin function | After_rules -> tag_file "target.ml" ["myoption"]; flag ["ocaml"; "compile"; "native"; "myoption"] (A"-S"); | _ -> () end Hope this helps, Xavier Clerc [1] http://caml.inria.fr/mantis/view.php?id=5282