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,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 5A8BCBBC1 for ; Fri, 7 Mar 2008 15:46:58 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkAABXk0EfOvjGxoWdsb2JhbACQeAEBAQEBAQUEBgkIAReBDZl2 X-IronPort-AV: E=Sophos;i="4.25,463,1199660400"; d="scan'208";a="8124146" Received: from web54607.mail.re2.yahoo.com ([206.190.49.177]) by mail2-smtp-roc.national.inria.fr with SMTP; 07 Mar 2008 15:46:57 +0100 Received: (qmail 34389 invoked by uid 60001); 7 Mar 2008 14:46:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=BGQOiYTYTEPHCPFsRBrq44mA2YJf0EPDyJmDHSgbORuKCK4AK7cHADpbTfW0frD2+iU5RsWSwYcjkQ51rQZpIHXsQ907gb/nhJjXYeTM3HDr756Db3EsX+JVVOZaUoqkVS1RrnW0Df2+aJtZmO9I52vkx8ZklLh639UXOmxzPKM=; X-YMail-OSG: kA1uXQkVM1mZioOkBQLhv1ql8Uvz.2g59uOUTUJ.kn.qo1IAtkWkYyKaIT5me5FcUhvZ5vVX0nKVSLhrrKuevkKYHudE028cfF.A4JlIjc2qxcOhKNZtdxaARtt5E1JLuErDViMuJ0TTizhOjF6rknZYQg-- Received: from [82.155.123.169] by web54607.mail.re2.yahoo.com via HTTP; Fri, 07 Mar 2008 14:46:56 GMT Date: Fri, 7 Mar 2008 14:46:56 +0000 (GMT) From: Dario Teixeira Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4 To: Romain Bardou Cc: caml-list@yquem.inria.fr In-Reply-To: <47D10A4B.7000904@lri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <904598.33624.qm@web54607.mail.re2.yahoo.com> X-Spam: no; 0.00; findlib:01 camlp:01 findlib:01 -package:01 -package:01 foobar:01 syntax:01 foobar:01 statically:01 camlp:01 unix:01 unix:01 dynamically:01 caml-list:01 nums:01 Hi, Thanks for your help. I think we're getting closer to creating a generic Ocamlbuild plugin that adds support for Findlib. However, I'm also beginning to suspect that actually getting there -- creating a true generic solution -- might not be at all possible with the current Ocamlbuild. > * The "pkg_nums", "pkg_str", and "pkg_unix" tags (simply add packages to > the "packages" list if you need other packages) which add the "-package > nums", "-package str" and "-package unix" options respectively. Tag your > source files with the -package options they should use when compiling, > and your output files with the -package options they should use when > linking. Your idea can be extended to create a plugin that supports any of the packages available through Findlib. Just query Findlib for a list of packages: let packages = Findlib.init (); Fl_package_base.list_packages () While in theory this should work, it's still a brute force approach. Mind you, my initial idea was that when finding a tag of the form "pkg_foobar" (the actual syntax could be "pkg(foobar)" or something like that), Ocamlbuild would dynamically add a new rule for that package. Your solution statically adds all possible rules at the time the plugin is compiled (and the patch I suggest above is even more extreme in this regard). Now, if you ask what's so bad about explicitly listing all packages in myocamlbuild.ml, the answer is that it forces users to write a plugin if they want to use findlib. Personally, I think that findlib support is so essential that one shouldn't be forced to write plugins in order to use it. > * It does nothing to handle camlp4, but you should be able to add the > correct options yourself. > > Please tell me if it is what you needed or not :) I'm finding that adding camlp4 support is where things get messy: Ocamlbuild's default rules conflict with findlib's. I am yet to find a solution that manages to integrate the three successfully. Kind regards, Dario Teixeira __________________________________________________________ Sent from Yahoo! Mail. The World's Favourite Email http://uk.docs.yahoo.com/nowyoucan.html