Debian Codegraph @

tools/configure/configure.ml

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 [@@@ocaml.warning "+a"]
12
13 (***********************************)
14 (** Configuration script for Rocq *)
15 (***********************************)
16 open Printf
17 open Conf
18 open Util
19 (* cprintf is shadowed here... *)
20 open! CmdArgs
21 open CmdArgs.Prefs
22
23 let (/) = Filename.concat
24
25 let coq_version = "9.2"
26 (* format: "%d%02d%d" major minor patch
27 for pre-release version (eg 9.2+alpha), use the previous minor, and patch = 99 *)
28 let vo_magic = 90299
29 let is_a_released_version = true
30
31 (** Default OCaml binaries *)
32
33 type camlexec = { mutable find : string }
34 let camlexec = { find = "ocamlfind" }
35
36 let reset_caml_find c o = c.find <- o
37
38 (* Query for the architecture *)
39 let arch prefs = arch prefs.arch
40
41 (** NB: [arch_is_win32] is broader than [os_type_win32], cf. cygwin *)
42 let arch_is_win32 arch = arch = "win32"
43
44 let unix arch = os_type_cygwin || not (arch_is_win32 arch)
45
46 (* For cygwin dune doesn't add .exe to the binaries, only under mingw *)
47 let resolve_binary_suffix arch = if unix arch then "" else ".exe"
48
49 (** * Git Precommit Hook *)
50 let install_precommit_hook prefs =
51 let f = ".git/hooks/pre-commit" in
52 if dir_exists ".git/hooks" && not (Sys.file_exists f) then begin
53 cprintf prefs "Creating pre-commit hook in %s" f;
54 let o = open_out f in
55 let pr s = fprintf o s in
56 pr "#!/bin/sh\n";
57 pr "\n";
58 pr "if [ -x dev/tools/pre-commit ]; then\n";
59 pr " exec dev/tools/pre-commit\n";
60 pr "fi\n";
61 close_out o;
62 Unix.chmod f 0o775
63 end
64
65 (** * Browser command *)
66
67 let browser prefs arch =
68 match prefs.browser with
69 | Some b -> b
70 | None when arch_is_win32 arch -> {|start "%s"|}
71 | None when arch = "Darwin" -> {|open "%s"|}
72 | _ -> {|xdg-open "%s"|}
73
74 (** * OCaml programs *)
75 module CamlConf = struct
76 type t =
77 { camlbin : string
78 ; caml_version : string
79 ; camllib : string
80 ; findlib_version : string
81 }
82 end
83
84 let resolve_caml () =
85 let () =
86 try reset_caml_find camlexec (which camlexec.find)
87 with Not_found ->
88 die (sprintf "Error: cannot find '%s' in your path!\n" camlexec.find ^
89 "Please adjust your path or use the -ocamlfind option of ./configure")
90 in
91 if not (is_executable camlexec.find)
92 then die ("Error: cannot find the executable '"^camlexec.find^"'.")
93 else
94 let findlib_version, _ = run camlexec.find ["query"; "findlib"; "-format"; "%v"] in
95 let caml_version, _ = run camlexec.find ["ocamlc";"-version"] in
96 let camllib, _ = run camlexec.find ["printconf";"stdlib"] in
97 let camlbin = (* TODO beurk beurk beurk *)
98 Filename.dirname (Filename.dirname camllib) / "bin/" in
99 { CamlConf.camlbin; caml_version; camllib; findlib_version }
100
101 (** Caml version as a list of ints [4;0;1] *)
102 let caml_version_nums { CamlConf.caml_version; _ } =
103 generic_version_nums ~name:"the OCaml compiler" caml_version
104
105 external native_available : unit -> bool = "rocq_native_available"
106
107 let check_caml_version prefs caml_version caml_version_nums =
108 if prefs.nativecompiler <> NativeNo && not (native_available ()) then
109 let () = cprintf prefs "Your version of OCaml is %s." caml_version in
110 if caml_version_nums >= [5;0;0] then
111 die "You have enabled Rocq's native compiler, however it is not compatible with OCaml >= 5.0.0 on this architecture"
112 else
113 die "You have enabled Rocq's native compiler, however it is not compatible with your OCaml compiler"
114 else if caml_version_nums >= [4;14;0] then
115 cprintf prefs "You have OCaml %s. Good!" caml_version
116 else
117 let () = cprintf prefs "Your version of OCaml is %s." caml_version in
118 die "You need OCaml 4.14.0 or later."
119
120 let check_findlib_version prefs { CamlConf.findlib_version; _ } =
121 let findlib_version_nums = generic_version_nums ~name:"findlib" findlib_version in
122 if findlib_version_nums >= [1;9;1] then
123 cprintf prefs "You have OCamlfind %s. Good!" findlib_version
124 else
125 let () = cprintf prefs "Your version of OCamlfind is %s." findlib_version in
126 die "You need OCamlfind 1.9.1 or later."
127
128 (** Note, these warnings are only used in Rocq Makefile *)
129 (** Explanation of enabled/disabled warnings:
130 4: fragile pattern matching: too common in the code and too annoying to avoid in general
131 9: missing fields in a record pattern: too common in the code and not worth the bother
132 27: innocuous unused variable: innocuous
133 40: constructor or label name used out of scope: gets in the way of putting types in modules
134 41: ambiguous constructor or label: too common
135 42: disambiguated counstructor or label: too common
136 44: "open" shadowing already defined identifier: too common, especially when some are aliases
137 45: "open" shadowing a label or constructor: see 44
138 48: implicit elimination of optional arguments: too common
139 58: "no cmx file was found in path": See https://github.com/ocaml/num/issues/9
140 67: "unused functor parameter" seems totally bogus
141 68: "This pattern depends on mutable state" no idea what it means, dune builds don't display it
142 70: ".ml file without .mli file" bogus warning when used generally
143 *)
144
145 (* Note, we list all warnings to be complete *)
146 let coq_warnings = "-w -a+1..3-4+5..8-9+10..26-27+28..39-40-41-42+43-44-45+46..47-48+49..57-58+59..66-67-68+69-70"
147
148 (* Flags used to compile Rocq and plugins (via coq_makefile) *)
149 let caml_flags =
150 Printf.sprintf "-thread -bin-annot -strict-sequence %s" coq_warnings
151
152 (** * Native compiler *)
153
154 let msg_byteonly =
155 "Only the bytecode version of Rocq will be available."
156
157 let msg_no_ocamlopt () =
158 warn "Cannot find the OCaml native-code compiler.\n%s" msg_byteonly
159
160 let msg_no_dynlink_cmxa prefs =
161 warn "Cannot find native-code dynlink library.\n%s" msg_byteonly;
162 cprintf prefs "For building a native-code Rocq, you may try to first";
163 cprintf prefs "compile and install a dummy dynlink.cmxa (see dev/dynlink.ml)";
164 cprintf prefs "and then run ./configure -natdynlink no"
165
166 let check_native prefs camlenv =
167 let version, _ = tryrun camlexec.find ["opt";"-version"] in
168 if version = "" then let () = msg_no_ocamlopt () in raise Not_found
169 else if fst (tryrun camlexec.find ["query";"dynlink"]) = ""
170 then let () = msg_no_dynlink_cmxa prefs in raise Not_found
171 else
172 let () =
173 let { CamlConf.caml_version; _ } = camlenv in
174 if version <> caml_version then
175 warn "Native and bytecode compilers do not have the same version!"
176 in cprintf prefs "You have native-code compilation. Good!"
177
178 let best_compiler prefs camlenv =
179 try check_native prefs camlenv; "opt" with Not_found -> "byte"
180
181 (** * Native dynlink *)
182
183 let hasnatdynlink prefs best_compiler = prefs.natdynlink && best_compiler = "opt"
184
185 (** * OS dependent libraries *)
186
187 (** Zarith library *)
188
189 let check_for_zarith prefs =
190 let zarith,_ = tryrun camlexec.find ["query";"zarith"] in
191 let zarith_cmai base = Sys.file_exists (base / "z.cmi") && Sys.file_exists (base / "zarith.cma") in
192 let zarith_version, _ = run camlexec.find ["query"; "zarith"; "-format"; "%v"] in
193 match zarith with
194 | "" ->
195 die "Zarith library not installed, required"
196 | _ when not (zarith_cmai zarith) ->
197 die "Zarith library installed but no development files found (try installing the -dev package)"
198 | _ ->
199 let zarith_version_int = generic_version_nums ~name:"Zarith" zarith_version in
200 if zarith_version_int >= [1;11;0] then
201 cprintf prefs "You have the Zarith library %s installed. Good!" zarith_version
202 else
203 die ("Zarith version 1.11 is required, you have " ^ zarith_version)
204
205 (** * Installation directories : bindir, libdir, docdir, etc *)
206
207 (* Source code root *)
208 let coqsrc = Sys.getcwd ()
209
210 (** Variable name, description, ref in prefs, default dir, prefix-relative *)
211
212 type path_style =
213 | Absolute of string (* Should start with a "/" *)
214 | Relative of string (* Should not start with a "/", relative to the prefix *)
215
216 type relocatable_path =
217 | Relocatable of string
218 | NotRelocatable of string
219
220 module InstallDir = struct
221
222 type t =
223 { var : string
224 (** Used as key by [select] (otherwise ignored) *)
225 ; msg : string
226 (** Description of the directory *)
227 ; uservalue : string option
228 (** Value given explictly by the user *)
229 ; selfcontainedlayout : path_style
230 (** Path style when layout is "local" *)
231 ; unixlayout : path_style
232 (** Path style for installation *)
233 }
234
235 let make var msg uservalue selfcontainedlayout unixlayout =
236 { var; msg; uservalue; selfcontainedlayout; unixlayout }
237
238 end
239
240 let install prefs =
241 [ InstallDir.make "COQPREFIX" "Prefix" None (Relative "") (Relative "")
242 ; InstallDir.make "COQLIBINSTALL" "the Rocq library" prefs.libdir (Relative "lib/coq") (Relative "lib/coq")
243 ; InstallDir.make "CONFIGDIR" "the Rocqide configuration files" prefs.configdir (Relative "config") (Absolute "/etc/xdg/coq")
244 ; InstallDir.make "DATADIR" "the Rocqide data files" prefs.datadir (Relative "share/coq") (Relative "share/coq")
245 ; InstallDir.make "DOCDIR" "documentation prefix path for all Rocq packages" prefs.docdir (Relative "share/doc") (Relative "share/doc")
246 ]
247
248 let strip_trailing_slash_if_any p =
249 if p.[String.length p - 1] = '/' then String.sub p 0 (String.length p - 1) else p
250
251 let use_suffix prefix suff =
252 match suff with
253 | Absolute path -> NotRelocatable path
254 | Relative suff ->
255 match prefix with
256 | Prefix prefix -> NotRelocatable (if suff = "" then prefix else prefix ^ "/" ^ suff)
257 | RelocatableInstall -> Relocatable suff
258
259 let relativize = function
260 (* Turn a global layout based on some prefix to a relative layout *)
261 | Relative _ as suffix -> suffix
262 | Absolute path -> Relative (String.sub path 1 (String.length path - 1))
263
264 let find_suffix prefix path = match prefix with
265 | None | Some RelocatableInstall -> Absolute path
266 | Some (Prefix p) ->
267 let p = strip_trailing_slash_if_any p in
268 let lpath = String.length path in
269 let lp = String.length p in
270 if lpath > lp && String.sub path 0 lp = p then
271 Relative (String.sub path (lp+1) (lpath - lp - 1))
272 else
273 Absolute path
274
275 (* This computes the actual effective path for an install directory,
276 based on the given prefix; if prefix is absent, it is assumed that
277 the profile is "local" *)
278 let do_one_instdir ~interactive ~prefix ~arch InstallDir.{var; msg; uservalue; selfcontainedlayout; unixlayout} =
279 (var,msg),
280 match uservalue, prefix with
281 | Some d, p -> NotRelocatable d, find_suffix p d
282 | None, Some p ->
283 let suffix = if (arch_is_win32 arch) then selfcontainedlayout else relativize unixlayout in
284 use_suffix p suffix, suffix
285 | None, None ->
286 let () = if not interactive then die (Printf.sprintf "No installation path given for %s" msg) in
287 let suffix = if (unix arch) then unixlayout else selfcontainedlayout in
288 let base = if (unix arch) then "/usr/local" else "C:/coq" in
289 let dflt = use_suffix (Prefix base) suffix in
290 let ppdflt = match dflt with NotRelocatable v -> v | Relocatable _ -> assert false in
291 let () = printf "Where should I install %s [%s]? " msg ppdflt in
292 let line = read_line () in
293 if line = "" then (dflt,suffix) else (NotRelocatable line,find_suffix prefix line)
294
295 let install_dirs prefs arch =
296 let prefix = prefs.prefix in
297 List.map (do_one_instdir ~interactive:prefs.interactive ~prefix ~arch) (install prefs)
298
299 let select var install_dirs = List.find (fun ((v,_),_) -> v=var) install_dirs |> snd
300
301 module CoqEnv = struct
302 (** Rocq core paths, for libraries, documentation, configuration, and data *)
303 type t =
304 { coqlib : relocatable_path
305 ; coqlibsuffix : path_style
306 ; docdir : relocatable_path
307 ; docdirsuffix : path_style
308 ; configdir : relocatable_path
309 ; configdirsuffix : path_style
310 ; datadir : relocatable_path
311 ; datadirsuffix : path_style }
312 end
313
314 let resolve_coqenv install_dirs =
315 let coqlib, coqlibsuffix = select "COQLIBINSTALL" install_dirs in
316 let docdir, docdirsuffix = select "DOCDIR" install_dirs in
317 let configdir, configdirsuffix = select "CONFIGDIR" install_dirs in
318 let datadir,datadirsuffix = select "DATADIR" install_dirs in
319 { CoqEnv.coqlib; coqlibsuffix; docdir; docdirsuffix
320 ; configdir; configdirsuffix; datadir; datadirsuffix }
321
322 (** * CC runtime flags *)
323
324 (* Note that Rocq's VM requires at least C99-compliant floating-point
325 arithmetic; this should be ensured by OCaml's own C flags, which
326 set a minimum of [--std=gnu99] ; modern compilers by default assume
327 C11 or later, so no explicit [--std=] flags are added by OCaml *)
328 let cflags_dflt = "-Wall -Wno-unused -g -O2"
329
330 let cflags_sse2 = "-msse2 -mfpmath=sse"
331
332 (* cflags, sse2_math = *)
333 let compute_cflags prefs =
334 let cflags = Buffer.create 17 in
335 Buffer.add_string cflags cflags_dflt;
336 let sse2_math =
337 let _, slurp =
338 (* Test SSE2_MATH support <https://stackoverflow.com/a/45667927> *)
339 tryrun camlexec.find
340 ["ocamlc"; "-ccopt"; cflags_dflt ^ " -march=native -dM -E " ^ cflags_sse2;
341 "-c"; coqsrc/"dev/header.c"] in (* any file *)
342 List.exists (fun line -> starts_with line "#define __SSE2_MATH__ 1") slurp in
343 if sse2_math then
344 begin
345 Buffer.add_char cflags ' ';
346 Buffer.add_string cflags cflags_sse2
347 end;
348 if prefs.nativecompiler = NativeNo then
349 Buffer.add_string cflags " -DNO_NATIVE_COMPUTE";
350 (Buffer.contents cflags, sse2_math)
351
352 (** Test at configure time that no harmful double rounding seems to
353 be performed with an intermediate 80-bit representation (x87).
354
355 If this test fails but SSE2_MATH is available, the build can go
356 further as Rocq's primitive floats will use it through a dedicated
357 external C implementation (instead of relying on OCaml operations)
358
359 If this test fails and SSE2_MATH is not available, abort.
360 *)
361 let check_fmath sse2_math =
362 let add = (+.) in
363 let b = ldexp 1. 53 in
364 let s = add 1. (ldexp 1. (-52)) in
365 if (add b s <= b || add b 1. <> b || ldexp 1. (-1074) <= 0.)
366 && not sse2_math then
367 die "Detected non IEEE-754 compliant architecture (or wrong \
368 rounding mode). Use of Float is thus unsafe."
369
370 let esc s = if String.contains s ' ' then "\"" ^ s ^ "\"" else s
371
372 (** * Summary of the configuration *)
373
374 let pr_native = function
375 | NativeYes -> "yes" | NativeNo -> "no" | NativeOndemand -> "ondemand"
376
377 let print_summary prefs arch camlenv install_dirs browser =
378 let { CamlConf.caml_version; camlbin; camllib; _ } = camlenv in
379 let pr s = printf s in
380 let pr_reloc oc = function
381 | NotRelocatable p -> fprintf oc "%s" (esc p)
382 | Relocatable p -> fprintf oc "(relocatable prefix)/%s" (esc p)
383 in
384 pr "\n";
385 pr " Architecture : %s\n" arch;
386 pr " Sys.os_type : %s\n" Sys.os_type;
387 pr " OCaml version : %s\n" caml_version;
388 pr " OCaml binaries in : %s\n" (esc camlbin);
389 pr " OCaml library in : %s\n" (esc camllib);
390 pr " Web browser : %s\n" browser;
391 pr " Rocq web site : %s\n" prefs.coqwebsite;
392 pr " Bytecode VM enabled : %B\n" prefs.bytecodecompiler;
393 pr " Native Compiler enabled : %s\n\n" (pr_native prefs.nativecompiler);
394 (pr " Paths where installation is expected by Rocq Makefile:\n";
395 List.iter
396 (fun ((_,msg),(dir,_)) -> pr " - %s is expected in %a\n" msg pr_reloc dir)
397 install_dirs);
398 pr "\n";
399 pr "If anything is wrong above, please restart './configure'.\n\n";
400 pr "*Warning* To compile the system for a new architecture\n";
401 pr " don't forget to do a 'make clean' before './configure'.\n"
402
403 (** Build the [config/coq_config.ml] file *)
404 let write_coq_config_ml install_prefix camlenv coqenv caml_flags caml_version_nums arch arch_is_win32 hasnatdynlink browser prefs o =
405 let { CoqEnv.coqlib; coqlibsuffix; configdir; configdirsuffix; docdir; docdirsuffix; datadir; datadirsuffix } = coqenv in
406 let { CamlConf.caml_version; _ } = camlenv in
407 let pr s = fprintf o s in
408 let pr_s = pr "let %s = %S\n" in
409 let pr_b = pr "let %s = %B\n" in
410 let pr_i32 = pr "let %s = %dl\n" in
411 let pr_p s o = pr "let %s = %S\n" s
412 (match o with Relative s -> s | Absolute s -> s) in
413 let pr_reloc s = function
414 | NotRelocatable o -> pr "let %s = NotRelocatable %S\n" s o
415 | Relocatable o -> pr "let %s = Relocatable %S\n" s o
416 in
417 let pr_li n l = pr "let %s = [%s]\n" n (String.concat ";" (List.map string_of_int l)) in
418 pr "(* DO NOT EDIT THIS FILE: automatically generated by ../configure *)\n";
419 pr "(* Exact command that generated this file: *)\n";
420 pr "(* %s *)\n\n" (String.concat " " (Array.to_list Sys.argv));
421 pr "let gc_ramp_up f = %s\n"
422 (if caml_version_nums >= [5;4;0] then "fst (Gc.ramp_up f)" else "f ()");
423 pr "type relocatable_path = NotRelocatable of string | Relocatable of string\n";
424 pr_reloc "install_prefix" install_prefix;
425 pr_reloc "coqlib" coqlib;
426 pr_reloc "configdir" configdir;
427 pr_reloc "datadir" datadir;
428 pr_reloc "docdir" docdir;
429 pr_p "coqlibsuffix" coqlibsuffix;
430 pr_p "configdirsuffix" configdirsuffix;
431 pr_p "datadirsuffix" datadirsuffix;
432 pr_p "docdirsuffix" docdirsuffix;
433 pr_s "ocamlfind" camlexec.find;
434 pr_s "caml_flags" caml_flags;
435 pr_s "version" coq_version;
436 pr_s "caml_version" caml_version;
437 pr_li "caml_version_nums" caml_version_nums;
438 pr_s "arch" arch;
439 pr_b "arch_is_win32" arch_is_win32;
440 pr_s "exec_extension" !exe;
441 pr_b "has_natdynlink" hasnatdynlink;
442 pr_i32 "vo_version" vo_magic;
443 pr_s "browser" browser;
444 pr_s "wwwcoq" prefs.coqwebsite;
445 pr_s "wwwbugtracker" (prefs.coqwebsite ^ "bugs/");
446 pr_s "wwwrefman" (prefs.coqwebsite ^ "doc/V" ^ coq_version ^ "/refman/");
447 pr_s "wwwstdlib" (prefs.coqwebsite ^ "doc/V" ^ coq_version ^ "/corelib/");
448 pr_b "bytecode_compiler" prefs.bytecodecompiler;
449 pr "type native_compiler = NativeOff | NativeOn of { ondemand : bool }\n";
450 pr "let native_compiler = %s\n"
451 (match prefs.nativecompiler with
452 | NativeYes -> "NativeOn {ondemand=false}" | NativeNo -> "NativeOff"
453 | NativeOndemand -> "NativeOn {ondemand=true}");
454
455 let core_src_dirs = [ "boot"; "config"; "lib"; "clib"; "kernel"; "library";
456 "engine"; "pretyping"; "interp"; "gramlib"; "parsing"; "proofs";
457 "tactics"; "toplevel"; "printing"; "ide"; "stm"; "vernac" ] in
458
459 let core_src_dirs = List.fold_left (fun acc core_src_subdir -> acc ^ " \"" ^ core_src_subdir ^ "\";\n")
460 ""
461 core_src_dirs in
462
463 pr "\nlet core_src_dirs = [\n%s]\n" core_src_dirs;
464 pr "\nlet plugins_dirs = [\n";
465
466 let plugins = match open_in "config/plugin_list" with
467 | exception Sys_error _ ->
468 let plugins =
469 try Sys.readdir "plugins"
470 with _ -> [||]
471 in
472 Array.sort compare plugins;
473 plugins
474 | ch -> Array.of_list (snd (read_lines_and_close ch))
475 in
476 Array.iter
477 (fun f ->
478 let f' = "plugins/"^f in
479 if Sys.is_directory f' && f.[0] <> '.' then pr " %S;\n" f')
480 plugins;
481 pr "]\n";
482
483 pr "\nlet all_src_dirs = core_src_dirs @ plugins_dirs\n"
484
485 (** Build the config/coq_byte_config.ml file *)
486 let write_coq_byte_config_ml caml_version_nums o =
487 let pr s = fprintf o s in
488 pr "let toploop_use_silently ppf f = %s\n"
489 (if caml_version_nums >= [4;14;0]
490 then "Toploop.use_silently ppf (Toploop.File f)"
491 else "Toploop.use_silently ppf f");
492 pr "let compenv_handle_exit_with_status_0 f = %s\n"
493 (if caml_version_nums >= [4;12;0]
494 then "try f () with Compenv.Exit_with_status(0) -> ()"
495 else "f ()");
496 pr "let toploop_prep_and_loop fmt = %s\n"
497 (if caml_version_nums >= [5;3;0]
498 then "ignore (Toploop.prepare fmt () : bool); Toploop.loop fmt"
499 else "Toploop.loop fmt")
500
501 (** Build the [config/dune.c_flags] file *)
502 let write_dune_c_flags cflags o =
503 let pr s = fprintf o s in
504 pr "(%s)\n" cflags
505
506 (** Build the [config/coq_config.py] file *)
507 let write_coq_config_py o =
508 let pr s = fprintf o s in
509 pr "# DO NOT EDIT THIS FILE: automatically generated by ../configure\n";
510 pr "version = '%s'\n" coq_version;
511 pr "is_a_released_version = %s\n" (if is_a_released_version then "True" else "False")
512
513 (* Main configure routine *)
514 let main () =
515 let prefs = CmdArgs.parse_args () in
516 Util.debug := prefs.debug;
517 let arch = arch prefs in
518 let arch_is_win32 = arch_is_win32 arch in
519 let exe = resolve_binary_suffix arch in
520 Util.exe := exe;
521 install_precommit_hook prefs;
522 let browser = browser prefs arch in
523 let camlenv = resolve_caml () in
524 let caml_version_nums = caml_version_nums camlenv in
525 check_caml_version prefs camlenv.CamlConf.caml_version caml_version_nums;
526 check_findlib_version prefs camlenv;
527 let best_compiler = best_compiler prefs camlenv in
528 let hasnatdynlink = hasnatdynlink prefs best_compiler in
529 check_for_zarith prefs;
530 let install_dirs = install_dirs prefs arch in
531 let install_prefix = select "COQPREFIX" install_dirs |> fst in
532 let coqenv = resolve_coqenv install_dirs in
533 let cflags, sse2_math = compute_cflags prefs in
534 check_fmath sse2_math;
535 if not prefs.quiet then
536 print_summary prefs arch camlenv install_dirs browser;
537 write_config_file ~file:"config/coq_config.ml"
538 (write_coq_config_ml install_prefix camlenv coqenv caml_flags caml_version_nums arch arch_is_win32 hasnatdynlink browser prefs);
539 write_config_file ~file:"config/coq_byte_config.ml" (write_coq_byte_config_ml caml_version_nums);
540 write_config_file ~file:"config/dune.c_flags" (write_dune_c_flags cflags);
541 write_config_file ~file:"config/coq_config.py" write_coq_config_py;
542 ()
543
544 let _ =
545 main ()