Coccinelle release 0.2.5-rc3
[bpt/coccinelle.git] / commons / features.ml.cpp
1 (* yes sometimes cpp is useful *)
2
3 (* old:
4 note: in addition to Makefile.config, globals/config.ml is also modified
5 by configure
6 features.ml: features.ml.cpp Makefile.config
7 cpp -DFEATURE_GUI=$(FEATURE_GUI) \
8 -DFEATURE_MPI=$(FEATURE_MPI) \
9 -DFEATURE_PCRE=$(FEATURE_PCRE) \
10 features.ml.cpp > features.ml
11
12 clean::
13 rm -f features.ml
14
15 beforedepend:: features.ml
16
17 *)
18
19 #if FEATURE_MPI==1
20
21 module Distribution = struct
22 let under_mpirun () =
23 Distribution.under_mpirun()
24
25 let mpi_main2 ?debug_mpi map_ex reduce_ex fxs =
26 Distribution.mpi_main2 debug_mpi map_ex reduce_ex fxs
27
28 let mpi_adjust_argv argv =
29 Distribution.mpi_adjust_argv argv
30 end
31
32 #else
33
34 module Distribution = struct
35 let under_mpirun () =
36 false
37
38 let mpi_main2 ?debug_mpi map_ex reduce_ex fxs =
39 let res = List.map map_ex (fxs()) in
40 reduce_ex res
41
42 let mpi_adjust_argv argv =
43 argv
44 end
45
46 #endif
47
48
49 #if FEATURE_REGEXP_PCRE==1
50 #else
51 #endif
52
53 #if FEATURE_BACKTRACE==1
54 module Backtrace = struct
55 let print () =
56 Backtrace.print ()
57 end
58 #else
59
60 module Backtrace = struct
61 let print () =
62 print_string "no backtrace support, use configure --with-backtrace\n"
63 end
64
65 #endif