From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BCE36BC6B for ; Wed, 28 Mar 2007 15:25:48 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2SDPWus032321 for ; Wed, 28 Mar 2007 15:25:48 +0200 Received: by ug-out-1314.google.com with SMTP id k3so235828ugf for ; Wed, 28 Mar 2007 06:25:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Z6rHTMucBVAjGHl91yLxlBH9rhEdjDTuIJj+ZUSjI2lQ8Flwclsf7CFqlITa+qXfDzWD12tQA6hgdsNC+w8/5ODlFesF33UQHLtKUlJDJghbOwU9ATNpJeXo8AVsdmtU7h5/fEnQJN0kOjGIymEKPd51UiyXkKpZ5/Rr1B2KXq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=OBZxSWTfInMT7+Xv5irA5T0rc2M2vU7CxyLq6TTmn4rLccRUTzH8Zjj6IeGVTIlKRjlbFgVNlJ3hgND488K8CtY13zdgOh7o2levhrGBktmqJZHGEGuyofA4F0xLqifOwLjCHZDWulBM1figtn25UvItkmu4YPFR6XsNnARMsKo= Received: by 10.78.193.19 with SMTP id q19mr4244553huf.1175088348204; Wed, 28 Mar 2007 06:25:48 -0700 (PDT) Received: from ?192.168.1.34? ( [88.8.239.112]) by mx.google.com with ESMTP id o9sm26634763nfa.2007.03.28.06.25.46; Wed, 28 Mar 2007 06:25:47 -0700 (PDT) In-Reply-To: References: <026CA3D4-5A8B-4083-B429-DE5AEC418C0A@gmail.com> <02DBCF0E-8CC6-44CC-B59D-31533A58C32A@gmail.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5FF6CDCC-AE05-472F-B721-782D32302EB7@gmail.com> Cc: "Caml List" Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: [Caml-list] Producing a C wrapper with ocamlbuild or OMake Date: Wed, 28 Mar 2007 14:25:43 +0100 To: "Nicolas Pouillard" X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 460A6CCC.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 460A6CCC.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocamlfind:01 ocamlopt:01 -package:01 -output-obj:01 symtab:01 cmx:01 cmx:01 lexer:01 parser:01 parser:01 util:01 exited:01 compilation:01 byte:01 util:01 Nicolas, I think I'm missing one more bit: ocamlbuild main + ocamlfind ocamlopt -package ounit -output-obj morpher.ml -o morphercaml.o No implementations provided for the following modules: Symtab referenced from morpher.cmx Ninja referenced from morpher.cmx Easy_lexer referenced from morpher.cmx Easy_parser referenced from morpher.cmx Ppninja referenced from morpher.cmx Pretty referenced from morpher.cmx Parser_util referenced from morpher.cmx Ninja_morph referenced from morpher.cmx Command exited with code 2. Compilation unsuccessful after building 2 targets (1 cached) in 00:00:00. My complete plugin file is below. I can build my test program just fine using ocamlbuild test.byte but trying to produce the library gives me the above error. What am I missing? How can I have morpher.ml automatically pull in the other modules? I do open modules at the top of morpher.ml like this open Ninja_morph open Parser_util module PP = Ppninja module N = Ninja Thanks, Joel --- open Ocamlbuild_plugin;; open Command;; let cc = A"cc";; let ar = A"ar";; let packages = "ounit" (* "pkg1,pkg2,..." *);; let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];; flag ["ocaml"; "link"] (A"-linkpkg");; dispatch begin function | After_options -> Options.ocamlc := ocamlfind "ocamlc"; Options.ocamlopt := ocamlfind "ocamlopt"; | After_rules -> rule "output C obj" ~dep:"%.ml" ~prod:"%caml.o" begin fun env _ -> let caml_o = env "%caml.o" and ml = env "%.ml" in Cmd(S[!Options.ocamlopt; A"-output-obj"; P ml; A"-o"; Px caml_o]) end; rule "build C lib" ~deps:["%_stubs.o"; "%caml.o"] ~prod:"lib%.a" begin fun env _ -> let wrap_o = env "%wrap.o" and caml_o = env "%caml.o" and libasmrun = ! *Ocamlbuild_pack.Ocaml_utils.stdlib_dir/"libasmrun.a" and lib_a = env "lib%.a" in Seq[cp libasmrun lib_a; Cmd(S[ar; A"r"; Px lib_a; P caml_o; P wrap_o])] end; rule "build morpher" ~deps:["libmorpher.a"; "main.o"] ~prod:"main" begin fun _ _ -> Cmd(S[cc; P"morpher.o"; P"libmorpher.a"; A"-o"; Px"main"]) end; | _ -> () end -- http://wagerlabs.com/