123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251# 1 "utils/config.ml"#2 "utils/config.mlp"(**************************************************************************)(* *)(* OCaml *)(* *)(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1996 Institut National de Recherche en Informatique et *)(* en Automatique. *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(* The main OCaml version string has moved to ../VERSION *)(* NOTE(anmonteiro): our lexer reads the compiler version to check whether it
ends in `+BS`. So we add it here. *)letversion=Sys.ocaml_version^"+BS"letstandard_library_default="/usr/local/lib/ocaml"letstandard_library=trySys.getenv"OCAMLLIB"withNot_found->trySys.getenv"CAMLLIB"withNot_found->standard_library_defaultletbs_only=reffalseletunsafe_empty_array=reftrueletsyntax_kind=ref`mlletccomp_type="cc"letc_compiler="clang"letc_output_obj="-o "letc_has_debug_prefix_map=trueletas_has_debug_prefix_map=falseletocamlc_cflags="-O2 -fno-strict-aliasing -fwrapv -Qunused-arguments -pthread "letocamlc_cppflags="-D_FILE_OFFSET_BITS=64 "(* #7678: ocamlopt uses these only to compile .c files, and the behaviour for
the two drivers should be identical. *)letocamlopt_cflags="-O2 -fno-strict-aliasing -fwrapv -Qunused-arguments -pthread "letocamlopt_cppflags="-D_FILE_OFFSET_BITS=64 "letbytecomp_c_libraries="-lm -lpthread"(* bytecomp_c_compiler and native_c_compiler have been supported for a
long time and are retained for backwards compatibility.
For programs that don't need compatibility with older OCaml releases
the recommended approach is to use the constituent variables
c_compiler, ocamlc_cflags, ocamlc_cppflags etc., directly.
*)letbytecomp_c_compiler=c_compiler^" "^ocamlc_cflags^" "^ocamlc_cppflagsletnative_c_compiler=c_compiler^" "^ocamlopt_cflags^" "^ocamlopt_cppflagsletnative_c_libraries="-lm "letnative_pack_linker="ld -r -o "letranlib="ranlib"letdefault_rpath=""letmksharedlibrpath=""letar="ar"letsupports_shared_libraries=trueletmkdll,mkexe,mkmaindll=(* @@DRA Cygwin - but only if shared libraries are enabled, which we
should be able to detect? *)ifSys.win32||Sys.cygwin&&supports_shared_librariesthentryletflexlink=letflexlink=Sys.getenv"OCAML_FLEXLINK"inletfi=letc=flexlink.[i]inifc='/'&&Sys.win32then'\\'elsecin(String.init(String.lengthflexlink)f)^" "inflexlink^"",flexlink^" -exe",flexlink^" -maindll"withNot_found->"clang -shared -flat_namespace -undefined suppress -Wl,-no_compact_unwind","clang -O2 -fno-strict-aliasing -fwrapv -Qunused-arguments -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -Wl,-no_compact_unwind","clang -shared -flat_namespace -undefined suppress -Wl,-no_compact_unwind"else"clang -shared -flat_namespace -undefined suppress -Wl,-no_compact_unwind","clang -O2 -fno-strict-aliasing -fwrapv -Qunused-arguments -pthread -Wall -Wdeclaration-after-statement -Werror -fno-common -Wl,-no_compact_unwind","clang -shared -flat_namespace -undefined suppress -Wl,-no_compact_unwind"letflambda=falseletwith_flambda_invariants=falseletwith_cmm_invariants=falseletsafe_string=trueletdefault_safe_string=trueletwindows_unicode=0!=0letnaked_pointers=trueletflat_float_array=trueletfunction_sections=falseletafl_instrument=falseletexec_magic_number="Caml1999X031"(* exec_magic_number is duplicated in runtime/caml/exec.h *)andcmi_magic_number="Caml1999I031"andcmo_magic_number="Caml1999O031"andcma_magic_number="Caml1999A031"andcmx_magic_number=ifflambdathen"Caml1999y031"else"Caml1999Y031"andcmxa_magic_number=ifflambdathen"Caml1999z031"else"Caml1999Z031"andast_impl_magic_number="Caml1999M031"andast_intf_magic_number="Caml1999N031"andcmxs_magic_number="Caml1999D031"andcmt_magic_number="Caml1999T031"andlinear_magic_number="Caml1999L031"letinterface_suffix=ref".mli"letmax_tag=245(* This is normally the same as in obj.ml, but we have to define it
separately because it can differ when we're in the middle of a
bootstrapping phase. *)letlazy_tag=246letmax_young_wosize=256letstack_threshold=256(* see runtime/caml/config.h *)letstack_safety_margin=60letarchitecture="arm64"letmodel="default"letsystem="macosx"letasm="as"letasm_cfi_supported=trueletwith_frame_pointers=falseletprofinfo=falseletprofinfo_width=0letext_exe=""letext_obj=".o"letext_asm=".s"letext_lib=".a"letext_dll=".so"lethost="aarch64-apple-darwin21.3.0"lettarget="aarch64-apple-darwin21.3.0"letdefault_executable_name=matchSys.os_typewith"Unix"->"a.out"|"Win32"|"Cygwin"->"camlprog.exe"|_->"camlprog"letsysthread_supported=true;;letflexdll_dirs=[];;typeconfiguration_value=|Stringofstring|Intofint|Boolofboolletconfiguration_variables=letpxv=(x,Stringv)inletp_intxv=(x,Intv)inletp_boolxv=(x,Boolv)in[p"version"version;p"standard_library_default"standard_library_default;p"standard_library"standard_library;p"ccomp_type"ccomp_type;p"c_compiler"c_compiler;p"ocamlc_cflags"ocamlc_cflags;p"ocamlc_cppflags"ocamlc_cppflags;p"ocamlopt_cflags"ocamlopt_cflags;p"ocamlopt_cppflags"ocamlopt_cppflags;p"bytecomp_c_compiler"bytecomp_c_compiler;p"native_c_compiler"native_c_compiler;p"bytecomp_c_libraries"bytecomp_c_libraries;p"native_c_libraries"native_c_libraries;p"native_pack_linker"native_pack_linker;p"ranlib"ranlib;p"architecture"architecture;p"model"model;p_int"int_size"Sys.int_size;p_int"word_size"Sys.word_size;p"system"system;p"asm"asm;p_bool"asm_cfi_supported"asm_cfi_supported;p_bool"with_frame_pointers"with_frame_pointers;p"ext_exe"ext_exe;p"ext_obj"ext_obj;p"ext_asm"ext_asm;p"ext_lib"ext_lib;p"ext_dll"ext_dll;p"os_type"Sys.os_type;p"default_executable_name"default_executable_name;p_bool"systhread_supported"systhread_supported;p"host"host;p"target"target;p_bool"flambda"flambda;p_bool"safe_string"safe_string;p_bool"default_safe_string"default_safe_string;p_bool"flat_float_array"flat_float_array;p_bool"function_sections"function_sections;p_bool"afl_instrument"afl_instrument;p_bool"windows_unicode"windows_unicode;p_bool"supports_shared_libraries"supports_shared_libraries;p_bool"naked_pointers"naked_pointers;p"exec_magic_number"exec_magic_number;p"cmi_magic_number"cmi_magic_number;p"cmo_magic_number"cmo_magic_number;p"cma_magic_number"cma_magic_number;p"cmx_magic_number"cmx_magic_number;p"cmxa_magic_number"cmxa_magic_number;p"ast_impl_magic_number"ast_impl_magic_number;p"ast_intf_magic_number"ast_intf_magic_number;p"cmxs_magic_number"cmxs_magic_number;p"cmt_magic_number"cmt_magic_number;p"linear_magic_number"linear_magic_number;]letprint_config_valueoc=function|Strings->Printf.fprintfoc"%s"s|Intn->Printf.fprintfoc"%d"n|Boolp->Printf.fprintfoc"%B"pletprint_configoc=letprint(x,v)=Printf.fprintfoc"%s: %a\n"xprint_config_valuevinList.iterprintconfiguration_variables;flushoc;;;letconfig_varx=matchList.assoc_optxconfiguration_variableswith|None->None|Somev->lets=matchvwith|Strings->s|Intn->Int.to_stringn|Boolb->string_of_boolbinSomesletmerlin=false