<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/d02a5fa1397339cee9920edfaaf9696a"
  from="Maxence Guesdon &lt;maxence.guesdon@i...&gt;"
  author="Maxence Guesdon"
  date="2003-01-29T21:58:49"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)"
  prev="2003/01/34950deeb6716e3189ad7b7d3f262b3b"
  next="2003/01/624b5af3263b83ed919ac074b95954f7"
  prev-in-thread="2003/01/f0eba1bf4bfab7f8b233593010ff768d"
  next-in-thread="2003/01/bf3bb736a13f371e560716e2a45cbd65"
  prev-thread="2003/01/92e294ab72bc62127ee9455ff8c411e8"
  next-thread="2003/01/2da5b3338c69f028d2af213b0041adaf"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
<msg 
  url="2003/01/80a5f82f911a3343ba7a52b93ec46ffb"
  from="Basile STARYNKEVITCH &lt;basile@s...&gt;"
  author="Basile STARYNKEVITCH"
  date="2003-01-29T19:58:48"
  subject="[Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
<msg 
  url="2003/01/f4cefd16c76cf6030861a8e6d9d9fa53"
  from="Will Benton &lt;willb@c...&gt;"
  author="Will Benton"
  date="2003-01-29T20:04:39"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
<msg 
  url="2003/01/83479c864bf77b612ff07b73eddb3333"
  from="Basile STARYNKEVITCH &lt;basile@s...&gt;"
  author="Basile STARYNKEVITCH"
  date="2003-01-29T20:15:50"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
<msg 
  url="2003/01/f0eba1bf4bfab7f8b233593010ff768d"
  from="Will Benton &lt;willb@c...&gt;"
  author="Will Benton"
  date="2003-01-29T20:22:57"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
</msg>
<msg 
  url="2003/01/d02a5fa1397339cee9920edfaaf9696a"
  from="Maxence Guesdon &lt;maxence.guesdon@i...&gt;"
  author="Maxence Guesdon"
  date="2003-01-29T21:58:49"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
<msg 
  url="2003/01/bf3bb736a13f371e560716e2a45cbd65"
  from="Jean-Christophe Filliatre &lt;Jean-Christophe.Filliatre@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2003-01-30T10:52:19"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
</msg>
<msg 
  url="2003/01/2269392930c425e8e14e4ee177c59cdd"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-01-30T13:59:15"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/01/34950deeb6716e3189ad7b7d3f262b3b"
  from="Gerd Stolpmann &lt;info@g...&gt;"
  author="Gerd Stolpmann"
  date="2003-01-29T21:43:18"
  subject="Re: [Caml-list] question: &quot;autoconfiguration&quot; of Ocaml code (checking for libraries)">
</msg>
</msg>
</thread>

<contents>
&gt; 
&gt; I was seeking for something simpler. I'm not very fond of m4 macros
&gt; (even if I did hack several years ago such stuff).
&gt; 
&gt; In my opinion, autoconf was suited for the problem of configuring C
&gt; code for lots of Unix variants. This is not what I need (in particular
&gt; 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 &lt; 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

</contents>

</message>

