Re: [Caml-list] Conditional compilation

2009-08-21 Thread Pietro Abate
On Mon, Aug 17, 2009 at 11:26:52PM -0300, Andre Nathan wrote: > On Mon, 2009-08-17 at 22:00 -0400, Edgar Friendly wrote: > > Is there a better way to do this? The path I'm following is looking > > very byzantine compared to C's [-DFOO] + [#ifdef FOO]. > In ospec I use In my projects I sometimes u

Re: [Caml-list] Conditional compilation

2009-08-18 Thread Richard Jones
On Mon, Aug 17, 2009 at 10:00:28PM -0400, Edgar Friendly wrote: > Is there a better way to do this? The path I'm following is looking > very byzantine compared to C's [-DFOO] + [#ifdef FOO]. You can just use autoconf's ordinary features: eg: AC_ARG_ENABLE([foo], [AS_HELP_STRING([--e

Re: [Caml-list] Conditional compilation

2009-08-18 Thread Olivier Andrieu
On Tue, Aug 18, 2009 at 04:37, Edgar Friendly wrote: > I'm starting to think that optcomp is just a mismatch for what I'm > trying to do, and I'm trying to use the wrong tool for the job.  That > said, I don't think it's the best solution (especially with already long > compile times for the projec

Re: [Caml-list] Conditional compilation

2009-08-17 Thread Edgar Friendly
Andre Nathan wrote: > On Mon, 2009-08-17 at 22:00 -0400, Edgar Friendly wrote: >> Is there a better way to do this? The path I'm following is looking >> very byzantine compared to C's [-DFOO] + [#ifdef FOO]. > > In ospec I use > > -pp "camlp4o Camlp4MacroParser.cmo -D FOO" > > which can then

Re: [Caml-list] Conditional compilation

2009-08-17 Thread Andre Nathan
On Mon, 2009-08-17 at 22:00 -0400, Edgar Friendly wrote: > Is there a better way to do this? The path I'm following is looking > very byzantine compared to C's [-DFOO] + [#ifdef FOO]. In ospec I use -pp "camlp4o Camlp4MacroParser.cmo -D FOO" which can then be tested in the code with IFDEF FO

[Caml-list] Conditional compilation

2009-08-17 Thread Edgar Friendly
I'm working on a project that has significant build infrastructure using autoconf, make and ocamlbuild. I want to have a reasonably simple trigger, such as a command-line argument to autoconf. The result of activating this trigger would be to drastically reduce what gets compiled -- many files wo

Re: [Caml-list] Conditional compilation wrt OCaml version?

2009-01-26 Thread Mikkel Fahnøe Jørgensen
> 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. > >

[Caml-list] Conditional compilation wrt OCaml version?

2009-01-26 Thread David Rajchenbach-Teller
Dear list, 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