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.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 97C27BC0A for ; Thu, 16 Nov 2006 22:43:58 +0100 (CET) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAGLhvGF018124 for ; Thu, 16 Nov 2006 22:43:58 +0100 Received: by py-out-1112.google.com with SMTP id f47so415777pye for ; Thu, 16 Nov 2006 13:43:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=k6zVhiHNBco9CezXloGxfdZQJ97lQasvFF1pj/krk7Yt4vx2VwqUjlZj+9BYvEvwsXbSSVTBJ10oRiFmou0Ec9fmHb60MAjfQ6DiwIyaU4eXga1u2qVaYq/wbBxUdkL5pWHYn10TkfYk/NeDfHOh6ittRpIEoUZBp25AcsSWJXw= Received: by 10.35.93.1 with SMTP id v1mr1647389pyl.1163713427449; Thu, 16 Nov 2006 13:43:47 -0800 (PST) Received: by 10.35.93.13 with HTTP; Thu, 16 Nov 2006 13:43:47 -0800 (PST) Message-ID: Date: Thu, 16 Nov 2006 22:43:47 +0100 From: "Nicolas Pouillard" Sender: nicolas.pouillard@gmail.com To: skaller Subject: Re: [Caml-list] managing ocaml dependencies Cc: "Guillaume Rousse" , caml-list@yquem.inria.fr, autoconf@gnu.org In-Reply-To: <1163695632.20151.34.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <455C73BA.1030803@inria.fr> <1163695632.20151.34.camel@rosella.wigram> X-Google-Sender-Auth: 444c8be4f372d92d X-Miltered: at discorde with ID 455CDB9D.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 dependencies:01 0100,:01 guillaume:01 autoconf:01 ocaml:01 mli:01 failwith:01 endline:01 ocamldep:01 unix's:01 makefile:01 makefile:01 sourceforge:01 wrote:01 On 11/16/06, skaller wrote: > On Thu, 2006-11-16 at 15:20 +0100, Guillaume Rousse wrote: > > I'm trying to use autoconf for ocaml project, and I have troubles with > > > They are two different strategies here, either generate them on > > maintainer host and ship them in the distribution, either generate them > > on user's host. > > There is no choice: it has to be done by the developer > because sometimes the dependency is semantic, in particular > when order of initialisation matters. When order of initialization matters, just enforce it. > > For example: > > (* file 1 *) > let a : int opt = ref None > ;; > > (* file 2 *) > let _ = a := Some 99 > ;; > > (* file 3 *) Just add something like: open File2;; (* because initialization order matters *) Or if really don't want use open: module File2 = File2;; (* because initialization order matters *) Or if really don't want re-export that module (if you don't have a .mli): let module File2 = File2 in ();; (* because initialization order matters *) > let _ = > match !a with > | None -> failwith "WRONG INIT ORDER" > | Some x -> print_endline (string_of_int x) > ;; > > You must link in the given order. Ocamldep can tell > 2 and 3 depend on 1, but not that 3 depends on 2. > > > The second strategy, however, heavily relies on make implementation. > > Whereas GNU make happily generate .depend file on the fly with previous > > snippet, some other implementations don't, such as Digital Unix's one > > (and potentially others). > > Make: Cannot open ../.depend. Stop. > > This is easy to fix: generate a new_makefile and then use > a rule something like: > > cat new_makefile_prefix .depend > new_makefile > make -f new_makefile > > Since this is a rule, the order of evaluation is strict. > -- Nicolas Pouillard