Merge commit 'ocaml3102'
[ocaml.git] / utils / clflags.ml
blob516ea8f290bf5362dbc1893678b86eb6692fb2a1
1 (***********************************************************************)
2 (* *)
3 (* Objective Caml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
10 (* *)
11 (***********************************************************************)
13 (* $Id$ *)
15 (* Command-line parameters *)
17 let objfiles = ref ([] : string list) (* .cmo and .cma files *)
18 and ccobjs = ref ([] : string list) (* .o, .a, .so and -cclib -lxxx *)
19 and dllibs = ref ([] : string list) (* .so and -dllib -lxxx *)
21 let compile_only = ref false (* -c *)
22 and output_name = ref (None : string option) (* -o *)
23 and include_dirs = ref ([] : string list)(* -I *)
24 and no_std_include = ref false (* -nostdlib *)
25 and print_types = ref false (* -i *)
26 and make_archive = ref false (* -a *)
27 and debug = ref false (* -g *)
28 and fast = ref false (* -unsafe *)
29 and link_everything = ref false (* -linkall *)
30 and custom_runtime = ref false (* -custom *)
31 and output_c_object = ref false (* -output-obj *)
32 and ccopts = ref ([] : string list) (* -ccopt *)
33 and classic = ref false (* -nolabels *)
34 and nopervasives = ref false (* -nopervasives *)
35 and preprocessor = ref(None : string option) (* -pp *)
36 let save_types = ref false (* -stypes *)
37 and use_threads = ref false (* -thread *)
38 and use_vmthreads = ref false (* -vmthread *)
39 and noassert = ref false (* -noassert *)
40 and verbose = ref false (* -verbose *)
41 and noprompt = ref false (* -noprompt *)
42 and init_file = ref (None : string option) (* -init *)
43 and use_prims = ref "" (* -use-prims ... *)
44 and use_runtime = ref "" (* -use-runtime ... *)
45 and principal = ref false (* -principal *)
46 and recursive_types = ref false (* -rectypes *)
47 and make_runtime = ref false (* -make_runtime *)
48 and gprofile = ref false (* -p *)
49 and c_compiler = ref Config.bytecomp_c_compiler (* -cc *)
50 and c_linker = ref Config.bytecomp_c_linker (* -cc *)
51 and no_auto_link = ref false (* -noautolink *)
52 and dllpaths = ref ([] : string list) (* -dllpath *)
53 and make_package = ref false (* -pack *)
54 and for_package = ref (None: string option) (* -for-pack *)
55 let dump_parsetree = ref false (* -dparsetree *)
56 and dump_rawlambda = ref false (* -drawlambda *)
57 and dump_lambda = ref false (* -dlambda *)
58 and dump_instr = ref false (* -dinstr *)
60 let keep_asm_file = ref false (* -S *)
61 let optimize_for_speed = ref true (* -compact *)
63 and dump_cmm = ref false (* -dcmm *)
64 let dump_selection = ref false (* -dsel *)
65 let dump_live = ref false (* -dlive *)
66 let dump_spill = ref false (* -dspill *)
67 let dump_split = ref false (* -dsplit *)
68 let dump_scheduling = ref false (* -dscheduling *)
69 let dump_interf = ref false (* -dinterf *)
70 let dump_prefer = ref false (* -dprefer *)
71 let dump_regalloc = ref false (* -dalloc *)
72 let dump_reload = ref false (* -dreload *)
73 let dump_scheduling = ref false (* -dscheduling *)
74 let dump_linear = ref false (* -dlinear *)
75 let keep_startup_file = ref false (* -dstartup *)
76 let dump_combine = ref false (* -dcombine *)
78 let native_code = ref false (* set to true under ocamlopt *)
79 let inline_threshold = ref 10
81 let dont_write_files = ref false (* set to true under ocamldoc *)
83 let std_include_flag prefix =
84 if !no_std_include then ""
85 else (prefix ^ (Filename.quote Config.standard_library))
88 let std_include_dir () =
89 if !no_std_include then [] else [Config.standard_library]