From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA07854; Wed, 29 Jan 2003 22:58:49 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA07935 for ; Wed, 29 Jan 2003 22:58:48 +0100 (MET) Received: from mallaury.noc.nerim.net (smtp-102.noc.nerim.net [62.4.17.102]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0TLwmr24085 for ; Wed, 29 Jan 2003 22:58:48 +0100 (MET) Received: from cobalt.max.fr (zoggy.net1.nerim.net [62.212.116.8]) by mallaury.noc.nerim.net (Postfix) with SMTP id B5F6D62D01 for ; Wed, 29 Jan 2003 22:58:43 +0100 (CET) Date: Wed, 29 Jan 2003 22:54:38 +0100 From: Maxence Guesdon To: caml-list@inria.fr Subject: Re: [Caml-list] question: "autoconfiguration" of Ocaml code (checking for libraries) Message-Id: <20030129225438.67089ae8.maxence.guesdon@inria.fr> In-Reply-To: <15928.13894.193615.945673@hector.lesours> References: <15928.12917.484208.539720@hector.lesours> <20030129140434.A1219@cilantro.cs.wisc.edu> <15928.13894.193615.945673@hector.lesours> Organization: INRIA X-Mailer: Sylpheed version 0.8.9claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > I was seeking for something simpler. I'm not very fond of m4 macros > (even if I did hack several years ago such stuff). > > In my opinion, autoconf was suited for the problem of configuring C > code for lots of Unix variants. This is not what I need (in particular > Ocaml has a unique implementation). You could create a script to launch the ocaml toplevel on a configuration script written in OCaml, like (without caring about the shell syntax) : if `ocaml my_conf_script.ml` then echo Type make to compile else echo Damn, the configure script failed ! Then your my_conf_script.ml file could be something like : let config () = let version = Sys.ocaml_version in if float_of_string version < 3.06 then ( prerr_endline "Your ocaml is too old !" ; exit 1 ) else ( Printf.printf "Using OCaml version %s is ok" version ; print_newline () ); ; (* other tests using Sys.command for example *) let _ = config () If you change your mind and want to use autoconf, you can find configure.in examples on the caml humps. Hope this helps, -- Maxence Guesdon ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners