]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/utils/config.mlbuild
Inital import
[l4.git] / l4 / pkg / ocaml / contrib / utils / config.mlbuild
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 (***********************************************************************)
12
13 (* $Id: config.mlbuild 9266 2009-05-19 14:41:21Z doligez $ *)
14
15 (***********************************************************************)
16 (**                                                                   **)
17 (**               WARNING WARNING WARNING                             **)
18 (**                                                                   **)
19 (** When you change this file, you must make the parallel change      **)
20 (** in config.mlp                                                     **)
21 (**                                                                   **)
22 (***********************************************************************)
23
24
25 (* The main OCaml version string has moved to ../VERSION *)
26 let version = Sys.ocaml_version
27
28 module C = Myocamlbuild_config
29
30 let standard_library_default = C.libdir
31
32 let standard_library =
33   try
34     Sys.getenv "OCAMLLIB"
35   with Not_found ->
36   try
37     Sys.getenv "CAMLLIB"
38   with Not_found ->
39     standard_library_default
40
41 let windows =
42   match Sys.os_type with
43   | "Win32" -> true
44   |    _    -> false
45
46 let sf = Printf.sprintf
47
48 let standard_runtime =
49   if windows then "ocamlrun"
50   else C.bindir^"/ocamlrun"
51 let ccomp_type = C.ccomptype
52 let bytecomp_c_compiler = sf "%s %s %s" C.bytecc C.bytecccompopts C.sharedcccompopts
53 let bytecomp_c_libraries = C.bytecclibs
54 let native_c_compiler = sf "%s %s" C.nativecc C.nativecccompopts
55 let native_c_libraries = C.nativecclibs
56 let native_pack_linker = C.packld
57 let ranlib = C.ranlibcmd
58 let cc_profile = C.cc_profile
59 let mkdll = C.mkdll
60 let mkexe = C.mkexe
61 let mkmaindll = C.mkmaindll
62
63 let exec_magic_number = "Caml1999X008"
64 and cmi_magic_number = "Caml1999I011"
65 and cmo_magic_number = "Caml1999O007"
66 and cma_magic_number = "Caml1999A008"
67 and cmx_magic_number = "Caml1999Y011"
68 and cmxa_magic_number = "Caml1999Z010"
69 and ast_impl_magic_number = "Caml1999M012"
70 and ast_intf_magic_number = "Caml1999N011"
71
72 let load_path = ref ([] : string list)
73
74 let interface_suffix = ref ".mli"
75
76 let max_tag = 245
77 (* This is normally the same as in obj.ml, but we have to define it
78    separately because it can differ when we're in the middle of a
79    bootstrapping phase. *)
80 let lazy_tag = 246
81
82 let max_young_wosize = 256
83 let stack_threshold = 256 (* see byterun/config.h *)
84
85 let architecture = C.arch
86 let model = C.model
87 let system = C.system
88
89 let asm = C.asm
90
91 let ext_obj = C.ext_obj
92 let ext_asm = C.ext_asm
93 let ext_lib = C.ext_lib
94 let ext_dll = C.ext_dll
95
96 let default_executable_name =
97   match Sys.os_type with
98     "Unix" -> "a.out"
99   | "Win32" | "Cygwin" -> "camlprog.exe"
100   | _ -> "camlprog"
101
102 let systhread_supported = C.systhread_support;;
103
104 let print_config oc =
105   let p name valu = Printf.fprintf oc "%s: %s\n" name valu in
106   let p_bool name valu = Printf.fprintf oc "%s: %B\n" name valu in
107   p "version" version;
108   p "standard_library_default" standard_library_default;
109   p "standard_library" standard_library;
110   p "standard_runtime" standard_runtime;
111   p "ccomp_type" ccomp_type;
112   p "bytecomp_c_compiler" bytecomp_c_compiler;
113   p "bytecomp_c_libraries" bytecomp_c_libraries;
114   p "native_c_compiler" native_c_compiler;
115   p "native_c_libraries" native_c_libraries;
116   p "native_pack_linker" native_pack_linker;
117   p "ranlib" ranlib;
118   p "cc_profile" cc_profile;
119   p "architecture" architecture;
120   p "model" model;
121   p "system" system;
122   p "asm" asm;
123   p "ext_obj" ext_obj;
124   p "ext_asm" ext_asm;
125   p "ext_lib" ext_lib;
126   p "ext_dll" ext_dll;
127   p "os_type" Sys.os_type;
128   p "default_executable_name" default_executable_name;
129   p_bool "systhread_supported" systhread_supported;
130   flush oc;
131 ;;