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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 574B1BC0B for ; Thu, 16 Nov 2006 17:47:21 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAGGlIHo010445 for ; Thu, 16 Nov 2006 17:47:20 +0100 Received: from ppp39-78.lns2.syd6.internode.on.net (HELO rosella) ([59.167.39.78]) by ipmail02.adl2.internode.on.net with ESMTP; 17 Nov 2006 03:17:16 +1030 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CACQkXEU7pydO/2dsb2JhbAA X-IronPort-AV: i="4.09,430,1157293800"; d="scan'208"; a="47008303:sNHT22846614" Subject: Re: [Caml-list] managing ocaml dependencies From: skaller To: Guillaume Rousse Cc: autoconf@gnu.org, caml-list@yquem.inria.fr In-Reply-To: <455C73BA.1030803@inria.fr> References: <455C73BA.1030803@inria.fr> Content-Type: text/plain Date: Fri, 17 Nov 2006 03:47:12 +1100 Message-Id: <1163695632.20151.34.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 455C9616.002 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 failwith:01 endline:01 ocamldep:01 unix's:01 makefile:01 makefile:01 sourceforge:01 wrote:01 maintainer:01 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. For example: (* file 1 *) let a : int opt = ref None ;; (* file 2 *) let _ = a := Some 99 ;; (* file 3 *) 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. -- John Skaller Felix, successor to C++: http://felix.sf.net