From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 14A107EC41 for ; Thu, 25 Oct 2012 22:12:58 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=pra; client-ip=89.16.177.154; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=mailfrom; client-ip=89.16.177.154; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@dark.recoil.org) identity=helo; client-ip=89.16.177.154; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="postmaster@dark.recoil.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiECAA6ciVBZELGagWdsb2JhbABEsCaSNAEBFiYngh4BAQQBbgsFCwslIUUSBhMSh2ADCQoHtDwDiV6KemcFhgdhA4hci0mBUYEXihaIHw X-IronPort-AV: E=Sophos;i="4.80,650,1344204000"; d="scan'208";a="160422688" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail4-smtp-sop.national.inria.fr with SMTP; 25 Oct 2012 22:12:57 +0200 Received: (qmail 14009 invoked by uid 634); 25 Oct 2012 20:12:56 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from c-24-5-76-252.hsd1.ca.comcast.net (HELO [192.168.1.118]) (24.5.76.252) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.84) with ESMTPA; Thu, 25 Oct 2012 21:12:55 +0100 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) From: Anil Madhavapeddy In-Reply-To: <1351173429.15638.YahooMailNeo@web111503.mail.gq1.yahoo.com> Date: Thu, 25 Oct 2012 13:12:52 -0700 Cc: OCaml Mailing List , pgocaml-general Content-Transfer-Encoding: quoted-printable Message-Id: <58E915E9-0BD4-4F0B-9581-B446C93A4EB8@recoil.org> References: <1351173429.15638.YahooMailNeo@web111503.mail.gq1.yahoo.com> To: Dario Teixeira X-Mailer: Apple Mail (2.1498) X-Virus-Checked: Checked by ClamAV on dark.recoil.org Subject: Re: [Caml-list] Conditional BuildDepends in OASIS The Cohttp library generates sub-libraries which can be conditional based on a flag (which has a portable functorised core, and then an Async, Mirage or Lwt instance depending on what's available) https://github.com/avsm/ocaml-cohttp/blob/master/_oasis However, your use case seems a little different, as I presume the external interface of pgocaml doesn't vary by your choice of Extlib or Batteries? Despite this, it might be easier just to define a "pgocaml.batteries" and "pgocaml.extlib" and leave the choice with the user as to which one they would like to select. You can make the dependency optional at compile time so the package doesn't generated; e.g. Library cohttp_lwt_unix Build$: flag(lwt) Install$: flag(lwt) Path: lwt Findlibname: lwt FindlibParent: cohttp BuildDepends: lwt.unix, uri, cohttp, lwt.ssl, lwt.syntax Modules: Cohttp_lwt_unix, (etc...) -anil On 25 Oct 2012, at 06:57, Dario Teixeira wrote: > Hi, >=20 > I'm in the process of oasifying PG'OCaml, and I've hit a snag. > By default PG'OCaml depends on ExtLib, but it's possible to > use Batteries instead. Below is a fragment of my (na=EFve) first > attempt at telling OASIS about this configuration option: >=20 >=20 > Flag "use_batteries" > Description: Use Batteries instead of ExtLib > Default: false >=20 > Library "pgocaml" > Path: src > Modules: PGOCaml > BuildTools: ocamlbuild, camlp4 > BuildDepends: calendar > if flag(use_batteries) > BuildDepends+: batteries > ByteOpt+: -ppopt -DUSE_BATTERIES > NativeOpt+: -ppopt -DUSE_BATTERIES > else > BuildDepends+: extlib >=20 > The problem is that OASIS complains about BuildDepends being >=20 > placed inside a conditional. Is this an oversight, or are there good > reasons (and hopefully a standard workaround) for this limitation? >=20 > Thanks in advance! > Cheers, > Dario Teixeira >=20 >=20 > --=20 > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs