> Working on Batteries, we're faced with a few places where we'd like to > perform conditional compilation depending on the version of OCaml being > used. We could probably do this with Camlp4, cpp, Autoconf hackery, etc. > -- but first, we need to decide on which of these options we'll adopt. > > Any suggestion?
If you are interested in using ocamlbuild you can have a look at ocamlbuild-ctools: http://dvide.com/labs/ocamlbuild-ctools/ I added extensions to ocamlbuild using a syntax like normalfile.o [mytag,myothertag,~notthistag] conditionalfile.o ... this is done in a .cprog file that lists all files to include, but that same could be done with other similar files e.g. .mllib Also, I added multi-variant builds so the same build can handle multiple build targets based on tags - for example debug and release builds. Multivariant builds work by adding tags in the filename: myfile.variant_release,mingw.o Most of this could be integrated into ocamlbuild, but ocamlbuild is not very actively maintained as I understand. Mikkel _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs