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.7 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 257A3BBAF for ; Tue, 22 Sep 2009 16:44:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUBAEOAuEpDww/Nm2dsb2JhbACRQYkyAQEBAQEICQoJE6tKgTGQAAEFAwGEFwWKXw X-IronPort-AV: E=Sophos;i="4.44,431,1249250400"; d="scan'208";a="36596643" Received: from web111513.mail.gq1.yahoo.com ([67.195.15.205]) by mail1-smtp-roc.national.inria.fr with SMTP; 22 Sep 2009 16:44:33 +0200 Received: (qmail 44592 invoked by uid 60001); 22 Sep 2009 14:44:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1253630672; bh=ujBm9yLGkVcD1GNWfBOpTvuPk2Rlg2rSKtI+WCNZ0eM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=DKsaf61FecsgFQoYGAlL8xxrAS7Y35QzjgPfx5f5tA46y1ityOcHXZk28Yp4DpjKhmmSY1tkv2m5/MftSxSpV8S4wsZhkyviHuXNP/BlGS2nfOaXR9uV5/5PF2lYLIZJqzWz4iRXgSUjmKiiA653/1UPVGhmuwK3MUhgrLFnWCo= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ifXW2SiPSKEQO9R9kw7gQ+Bf8igMIqc7xoLoMmWztxzjTyYxDCdIrWj4YXQk7lJAT2x9s8/MjGdbAh8swy5YO9N2YdSv6lmjBs6K3XkWeOWXzfh1TmPxeqWTVz5h3KZJBawzdGB3uDKO/T1JugfqhCPK9y/96znYPoPSFDT49l0=; Message-ID: <589559.44526.qm@web111513.mail.gq1.yahoo.com> X-YMail-OSG: SHxSs.kVM1mrb3nqdNbUh83BVGl5wvWlHwGoXg0uVHc.2WctbGJWrCrWTmVoM2nbZ0ldUPgY9fws9IgAqMKsTakZSDUNfR9k6RkMLrPPASDu8WL9tkKML.VQLyrcAgBOPnKEwsf4.FVMTJct.vWP2Ak3LbFOs2Nd96dT.BAbI06J5lOcnN661OCAhKMvQs0.nCp0dqEtFNCSf67g8NUFqZc9RcKEeUXwlW.YtvLItJWsaBYoFzsQamCbPh8_wieggsTa2u_VCrrtFUNSn3jLNowlkNpdoRsNGUOkvunkLv3GjVeQnJhCtjlAVgXn_vvZCLX2W3lXig-- Received: from [213.205.70.192] by web111513.mail.gq1.yahoo.com via HTTP; Tue, 22 Sep 2009 07:44:32 PDT X-Mailer: YahooMailClassic/7.0.14 YahooMailWebService/0.7.347.2 Date: Tue, 22 Sep 2009 07:44:32 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Ocamlbuild for project with C portion To: caml-list@yquem.inria.fr, Eric Cooper In-Reply-To: <20090921174758.GE2012@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; stubs:01 foo:01 foo:01 ocaml:01 byte:01 -custom:01 ocaml:01 foobar:01 caml-list:01 define:02 linking:02 seems:03 dispatch:03 library:03 let:03 Hi,=0A=0A> The key is to create a file with the extension ".clib" that cont= ains=0A> the list of .o files that should be compiled from your C stubs. Oc= amlbuild=0A> will then build these into a libary (foo.clib will result in f= oo.a).=A0 You=0A> then add rules in myocamlbuild.ml that define tags for de= pending on and=0A> linking with that library, and add these to your _tags f= ile.=0A=0AThanks for your reply. In the end I managed to solve the problem= , though=0Anot using clib (which seems tangential to this problem). All th= at was=0Arequired was the following myocamlbuild.ml:=0A=0Aopen Ocamlbuild_p= lugin=0Aopen Command=0A=0Alet _ =3D dispatch begin function=0A | Aft= er_rules ->=0A flag ["ocaml"; "byte"; "link"] (S[A"-custom"]= );=0A dep ["ocaml"; "link"] ["foobar.o"]=0A | _ -> ()= =0Aend=0A=0A=0AThough it still strikes me as odd that Ocamlbuild's manual w= on't cover=0Asuch basic examples...=0A=0ABest regards,=0ADario Teixeira=0A= =0A=0A=0A