2016-06-29 01:43:00 -07:00
|
|
|
#2 "utils/config.mlp"
|
2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* 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. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1995-08-09 08:06:35 -07:00
|
|
|
|
2007-02-07 06:49:42 -08:00
|
|
|
(* The main OCaml version string has moved to ../VERSION *)
|
2002-02-05 09:11:33 -08:00
|
|
|
let version = Sys.ocaml_version
|
1996-02-15 08:19:09 -08:00
|
|
|
|
2005-05-09 06:39:17 -07:00
|
|
|
let standard_library_default = "%%LIBDIR%%"
|
|
|
|
|
1996-02-15 08:19:09 -08:00
|
|
|
let standard_library =
|
2001-10-30 01:32:32 -08:00
|
|
|
try
|
|
|
|
Sys.getenv "OCAMLLIB"
|
|
|
|
with Not_found ->
|
1996-02-15 08:19:09 -08:00
|
|
|
try
|
|
|
|
Sys.getenv "CAMLLIB"
|
|
|
|
with Not_found ->
|
2005-05-09 06:39:17 -07:00
|
|
|
standard_library_default
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
let ccomp_type = "%%CCOMPTYPE%%"
|
2017-03-16 02:21:00 -07:00
|
|
|
let c_compiler = "%%CC%%"
|
2017-09-15 12:28:59 -07:00
|
|
|
let c_output_obj = "%%OUTPUTOBJ%%"
|
2018-06-27 06:56:29 -07:00
|
|
|
let c_has_debug_prefix_map = %%CC_HAS_DEBUG_PREFIX_MAP%%
|
2018-07-27 03:25:23 -07:00
|
|
|
let as_has_debug_prefix_map = %%AS_HAS_DEBUG_PREFIX_MAP%%
|
2017-03-16 02:21:00 -07:00
|
|
|
let ocamlc_cflags = "%%OCAMLC_CFLAGS%%"
|
|
|
|
let ocamlc_cppflags = "%%OCAMLC_CPPFLAGS%%"
|
2019-04-20 05:00:30 -07:00
|
|
|
(* #7678: ocamlopt uses these only to compile .c files, and the behaviour for
|
|
|
|
the two drivers should be identical. *)
|
|
|
|
let ocamlopt_cflags = "%%OCAMLC_CFLAGS%%"
|
2017-03-16 02:21:00 -07:00
|
|
|
let ocamlopt_cppflags = "%%OCAMLOPT_CPPFLAGS%%"
|
2000-10-27 08:18:24 -07:00
|
|
|
let bytecomp_c_libraries = "%%BYTECCLIBS%%"
|
2017-10-03 07:50:41 -07:00
|
|
|
(* 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.
|
|
|
|
*)
|
|
|
|
let bytecomp_c_compiler =
|
|
|
|
c_compiler ^ " " ^ ocamlc_cflags ^ " " ^ ocamlc_cppflags
|
|
|
|
let native_c_compiler =
|
|
|
|
c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags
|
2000-10-27 08:18:24 -07:00
|
|
|
let native_c_libraries = "%%NATIVECCLIBS%%"
|
2003-07-03 08:13:23 -07:00
|
|
|
let native_pack_linker = "%%PACKLD%%"
|
1996-11-07 03:01:32 -08:00
|
|
|
let ranlib = "%%RANLIBCMD%%"
|
2012-01-16 01:05:37 -08:00
|
|
|
let ar = "%%ARCMD%%"
|
2016-01-02 06:46:41 -08:00
|
|
|
let mkdll, mkexe, mkmaindll =
|
2016-02-10 09:28:38 -08:00
|
|
|
(* @@DRA Cygwin - but only if shared libraries are enabled, which we
|
|
|
|
should be able to detect? *)
|
2016-01-02 06:46:41 -08:00
|
|
|
if Sys.os_type = "Win32" then
|
|
|
|
try
|
|
|
|
let flexlink =
|
|
|
|
let flexlink = Sys.getenv "OCAML_FLEXLINK" in
|
|
|
|
let f i =
|
|
|
|
let c = flexlink.[i] in
|
|
|
|
if c = '/' then '\\' else c in
|
|
|
|
(String.init (String.length flexlink) f) ^ " %%FLEXLINK_FLAGS%%" in
|
|
|
|
flexlink,
|
Unicode support for the Windows runtime (#1200)
* Add support code
* Explicitly reference ANSI Windows APIs
* Adapt Sys.is_directory
* Adapt ocamlrun
* Add Changes entry
* Add testsuite
* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}
* Adapt headernt.c
* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.
* Adapt Sys.file_exists
* Adapt Sys.remove
* Adapt Sys.chdir
* Adapt Sys.getcwd
* Adapt Sys.getenv
* Adapt Sys.command
* Adapt Sys.readdir
* Adapt CPLUGINS
* Remove use of FormatMessageA, CreateFileA
* Adapt Unix.mkdir
* Adapt Unix.openfile
* Adapt Unix.readlink
* Adapt Unix.rename
* Adapt Unix.{LargeFile,}.{l,}stat
* Adapt Unix.system
* Adapt Unix.{open,read}dir
* Adapt Unix.link
* Adapt Unix.symlink
* Adapt Unix.getcwd
* Adapt Unix.rmdir
* Adapt Unix.utimes
* Adapt Unix.unlink
* Adapt Unix.chdir
* Adapt Unix.chmod
* Adapt Unix.{execv,execve,execvp,execvpe}
* Compile with -DUNICODE -D_UNICODE under Windows
* Add configure-time switch, Config.windows_unicode
* Adapt Unix.putenv
* Re-implement Unix.environment using GetEnvironmentStrings()
* Use Unicode-aware flexdll
* Adapt Unix.environment
* AppVeyor: bootstrap flexdll
* Adapt tests/embedded/cmmain.c
* Adapt tests/lib-dynlink-csharp/entry.c
* Remove exec tests
* Fixup
* Pass -municode to MinGW compiler
* Try to fix tests/embedded
* Adapt Sys.rename
* Correct Changes entry
* Makefile.several: use $(O) and $(NATIVECODE_ONLY)
* Display => skipped correctly for tests/win-unicode
* Add missing casts to execv* calls
It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).
* Missing header in systhreads (Win32 only)
* Revert "Pass -municode to MinGW compiler"
This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.
* Revert "Try to fix tests/embedded"
This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.
* Revert "Remove exec tests"
This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.
* Don't pass $(LDFLAGS) when build ocamlc.opt
It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).
* Use wmain on Windows for ocamlrun
* Build Unicode applications on Windows
* Use wmain in headernt.c
* Minor correction to win-unicode Makefile
* Switch submodule to FlexDLL 0.36
* Build ocamlyacc as an ANSI application
* Revert "Fixup"
This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.
* Fix casts for execvp/execve
* Remove tabs from test code
* Fix Changes entry
* shell32.lib is no longer necessary
* Free allocated string
* Changes: signal breaking change
* Disable exec_tests
* Protect with CAML_INTERNALS
2017-09-18 08:41:29 -07:00
|
|
|
flexlink ^ " -exe%%FLEXLINK_LDFLAGS%%",
|
2016-01-02 06:46:41 -08:00
|
|
|
flexlink ^ " -maindll"
|
|
|
|
with Not_found ->
|
|
|
|
"%%MKDLL%%", "%%MKEXE%%", "%%MKMAINDLL%%"
|
|
|
|
else
|
|
|
|
"%%MKDLL%%", "%%MKEXE%%", "%%MKMAINDLL%%"
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2015-12-17 08:35:35 -08:00
|
|
|
let flambda = %%FLAMBDA%%
|
2018-04-06 01:49:57 -07:00
|
|
|
let with_flambda_invariants = %%WITH_FLAMBDA_INVARIANTS%%
|
2017-10-02 04:41:33 -07:00
|
|
|
let safe_string = %%FORCE_SAFE_STRING%%
|
|
|
|
let default_safe_string = %%DEFAULT_SAFE_STRING%%
|
Unicode support for the Windows runtime (#1200)
* Add support code
* Explicitly reference ANSI Windows APIs
* Adapt Sys.is_directory
* Adapt ocamlrun
* Add Changes entry
* Add testsuite
* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}
* Adapt headernt.c
* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.
* Adapt Sys.file_exists
* Adapt Sys.remove
* Adapt Sys.chdir
* Adapt Sys.getcwd
* Adapt Sys.getenv
* Adapt Sys.command
* Adapt Sys.readdir
* Adapt CPLUGINS
* Remove use of FormatMessageA, CreateFileA
* Adapt Unix.mkdir
* Adapt Unix.openfile
* Adapt Unix.readlink
* Adapt Unix.rename
* Adapt Unix.{LargeFile,}.{l,}stat
* Adapt Unix.system
* Adapt Unix.{open,read}dir
* Adapt Unix.link
* Adapt Unix.symlink
* Adapt Unix.getcwd
* Adapt Unix.rmdir
* Adapt Unix.utimes
* Adapt Unix.unlink
* Adapt Unix.chdir
* Adapt Unix.chmod
* Adapt Unix.{execv,execve,execvp,execvpe}
* Compile with -DUNICODE -D_UNICODE under Windows
* Add configure-time switch, Config.windows_unicode
* Adapt Unix.putenv
* Re-implement Unix.environment using GetEnvironmentStrings()
* Use Unicode-aware flexdll
* Adapt Unix.environment
* AppVeyor: bootstrap flexdll
* Adapt tests/embedded/cmmain.c
* Adapt tests/lib-dynlink-csharp/entry.c
* Remove exec tests
* Fixup
* Pass -municode to MinGW compiler
* Try to fix tests/embedded
* Adapt Sys.rename
* Correct Changes entry
* Makefile.several: use $(O) and $(NATIVECODE_ONLY)
* Display => skipped correctly for tests/win-unicode
* Add missing casts to execv* calls
It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).
* Missing header in systhreads (Win32 only)
* Revert "Pass -municode to MinGW compiler"
This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.
* Revert "Try to fix tests/embedded"
This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.
* Revert "Remove exec tests"
This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.
* Don't pass $(LDFLAGS) when build ocamlc.opt
It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).
* Use wmain on Windows for ocamlrun
* Build Unicode applications on Windows
* Use wmain in headernt.c
* Minor correction to win-unicode Makefile
* Switch submodule to FlexDLL 0.36
* Build ocamlyacc as an ANSI application
* Revert "Fixup"
This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.
* Fix casts for execvp/execve
* Remove tabs from test code
* Fix Changes entry
* shell32.lib is no longer necessary
* Free allocated string
* Changes: signal breaking change
* Disable exec_tests
* Protect with CAML_INTERNALS
2017-09-18 08:41:29 -07:00
|
|
|
let windows_unicode = %%WINDOWS_UNICODE%% != 0
|
2018-09-11 05:59:16 -07:00
|
|
|
let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
|
2015-12-17 08:35:35 -08:00
|
|
|
|
2017-08-31 06:25:15 -07:00
|
|
|
let flat_float_array = %%FLAT_FLOAT_ARRAY%%
|
|
|
|
|
2019-02-20 10:46:43 -08:00
|
|
|
let function_sections = %%FUNCTION_SECTIONS%%
|
2016-12-06 08:18:04 -08:00
|
|
|
let afl_instrument = %%AFL_INSTRUMENT%%
|
|
|
|
|
2020-10-19 06:33:26 -07:00
|
|
|
let exec_magic_number = "Caml1999X029"
|
2018-06-20 08:43:29 -07:00
|
|
|
(* exec_magic_number is duplicated in runtime/caml/exec.h *)
|
2020-10-19 06:33:26 -07:00
|
|
|
and cmi_magic_number = "Caml1999I029"
|
|
|
|
and cmo_magic_number = "Caml1999O029"
|
|
|
|
and cma_magic_number = "Caml1999A029"
|
2015-12-17 08:35:35 -08:00
|
|
|
and cmx_magic_number =
|
|
|
|
if flambda then
|
2020-10-19 06:33:26 -07:00
|
|
|
"Caml1999y029"
|
2015-12-17 08:35:35 -08:00
|
|
|
else
|
2020-10-19 06:33:26 -07:00
|
|
|
"Caml1999Y029"
|
2015-12-17 08:35:35 -08:00
|
|
|
and cmxa_magic_number =
|
|
|
|
if flambda then
|
2020-10-19 06:33:26 -07:00
|
|
|
"Caml1999z029"
|
2015-12-17 08:35:35 -08:00
|
|
|
else
|
2020-10-19 06:33:26 -07:00
|
|
|
"Caml1999Z029"
|
|
|
|
and ast_impl_magic_number = "Caml1999M029"
|
|
|
|
and ast_intf_magic_number = "Caml1999N029"
|
|
|
|
and cmxs_magic_number = "Caml1999D029"
|
|
|
|
and cmt_magic_number = "Caml1999T029"
|
|
|
|
and linear_magic_number = "Caml1999L029"
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-05-27 07:10:14 -07:00
|
|
|
let interface_suffix = ref ".mli"
|
|
|
|
|
2002-01-20 09:39:10 -08:00
|
|
|
let max_tag = 245
|
2002-12-19 07:49:53 -08:00
|
|
|
(* 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. *)
|
|
|
|
let lazy_tag = 246
|
|
|
|
|
1995-10-03 07:07:03 -07:00
|
|
|
let max_young_wosize = 256
|
2018-06-20 08:43:29 -07:00
|
|
|
let stack_threshold = 256 (* see runtime/caml/config.h *)
|
2016-03-15 15:03:45 -07:00
|
|
|
let stack_safety_margin = 60
|
1995-08-08 05:17:31 -07:00
|
|
|
|
|
|
|
let architecture = "%%ARCH%%"
|
1996-01-07 09:00:35 -08:00
|
|
|
let model = "%%MODEL%%"
|
1995-08-08 05:17:31 -07:00
|
|
|
let system = "%%SYSTEM%%"
|
1996-02-15 08:19:09 -08:00
|
|
|
|
2007-10-30 05:37:16 -07:00
|
|
|
let asm = "%%ASM%%"
|
2012-02-21 09:41:02 -08:00
|
|
|
let asm_cfi_supported = %%ASM_CFI_SUPPORTED%%
|
2013-06-03 11:03:59 -07:00
|
|
|
let with_frame_pointers = %%WITH_FRAME_POINTERS%%
|
2016-08-02 09:52:07 -07:00
|
|
|
let profinfo = %%WITH_PROFINFO%%
|
2016-07-29 07:07:10 -07:00
|
|
|
let profinfo_width = %%PROFINFO_WIDTH%%
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2017-08-12 13:19:17 -07:00
|
|
|
let ext_exe = "%%EXE%%"
|
1996-02-15 08:19:09 -08:00
|
|
|
let ext_obj = "%%EXT_OBJ%%"
|
|
|
|
let ext_asm = "%%EXT_ASM%%"
|
|
|
|
let ext_lib = "%%EXT_LIB%%"
|
2001-08-28 07:47:48 -07:00
|
|
|
let ext_dll = "%%EXT_DLL%%"
|
2002-06-11 07:15:12 -07:00
|
|
|
|
2013-07-01 14:33:21 -07:00
|
|
|
let host = "%%HOST%%"
|
|
|
|
let target = "%%TARGET%%"
|
|
|
|
|
2002-06-11 07:15:12 -07:00
|
|
|
let default_executable_name =
|
|
|
|
match Sys.os_type with
|
|
|
|
"Unix" -> "a.out"
|
|
|
|
| "Win32" | "Cygwin" -> "camlprog.exe"
|
|
|
|
| _ -> "camlprog"
|
2005-05-09 06:39:17 -07:00
|
|
|
|
|
|
|
let systhread_supported = %%SYSTHREAD_SUPPORT%%;;
|
|
|
|
|
2017-01-27 07:08:41 -08:00
|
|
|
let flexdll_dirs = [%%FLEXDLL_DIR%%];;
|
|
|
|
|
ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
and exit with a failure return value (non-0)
Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.
The following alternative behaviors were considered:
- We could print a newline after the configuration value, which
would let users distinguish empty values from non-existing variables
by counting the lines of output, and would also be more pleasant for
users invoking the option from the command-line. However, the way
bash works on Windows means that $(ocamlc -config-var foo) would keep
a trailing \r in its output, and portable scripts would have to use
$(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
(This issue was pointed out by David Allsopp)
- We could print a message on the error output if the configuration
variable does not exist. This is clearer to a human user, but it is
annoying for scripts if they forget to silence the error output and
get their output mixed with our error messages. The main use of this
new feature is for scripting purposes.
2017-10-14 09:46:58 -07:00
|
|
|
type configuration_value =
|
|
|
|
| String of string
|
|
|
|
| Int of int
|
|
|
|
| Bool of bool
|
|
|
|
|
|
|
|
let configuration_variables =
|
|
|
|
let p x v = (x, String v) in
|
|
|
|
let p_int x v = (x, Int v) in
|
|
|
|
let p_bool x v = (x, Bool v) in
|
|
|
|
[
|
2005-05-09 06:39:17 -07:00
|
|
|
p "version" version;
|
|
|
|
p "standard_library_default" standard_library_default;
|
|
|
|
p "standard_library" standard_library;
|
|
|
|
p "ccomp_type" ccomp_type;
|
2017-03-16 02:21:00 -07:00
|
|
|
p "c_compiler" c_compiler;
|
|
|
|
p "ocamlc_cflags" ocamlc_cflags;
|
2017-10-14 08:54:01 -07:00
|
|
|
p "ocamlc_cppflags" ocamlc_cppflags;
|
2017-03-16 02:21:00 -07:00
|
|
|
p "ocamlopt_cflags" ocamlopt_cflags;
|
2017-10-14 08:54:01 -07:00
|
|
|
p "ocamlopt_cppflags" ocamlopt_cppflags;
|
|
|
|
p "bytecomp_c_compiler" bytecomp_c_compiler;
|
2017-10-03 07:50:41 -07:00
|
|
|
p "native_c_compiler" native_c_compiler;
|
2017-10-14 08:54:01 -07:00
|
|
|
p "bytecomp_c_libraries" bytecomp_c_libraries;
|
2005-05-09 06:39:17 -07:00
|
|
|
p "native_c_libraries" native_c_libraries;
|
2007-11-15 08:09:57 -08:00
|
|
|
p "native_pack_linker" native_pack_linker;
|
2005-05-09 06:39:17 -07:00
|
|
|
p "ranlib" ranlib;
|
|
|
|
p "architecture" architecture;
|
|
|
|
p "model" model;
|
2016-12-14 06:43:19 -08:00
|
|
|
p_int "int_size" Sys.int_size;
|
|
|
|
p_int "word_size" Sys.word_size;
|
2005-05-09 06:39:17 -07:00
|
|
|
p "system" system;
|
2007-10-30 05:37:16 -07:00
|
|
|
p "asm" asm;
|
2012-02-21 09:41:02 -08:00
|
|
|
p_bool "asm_cfi_supported" asm_cfi_supported;
|
2013-06-03 11:03:59 -07:00
|
|
|
p_bool "with_frame_pointers" with_frame_pointers;
|
2016-12-14 06:43:19 -08:00
|
|
|
p "ext_exe" ext_exe;
|
2005-05-09 06:39:17 -07:00
|
|
|
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;
|
2013-07-01 14:33:21 -07:00
|
|
|
p "host" host;
|
|
|
|
p "target" target;
|
2015-12-17 08:35:35 -08:00
|
|
|
p_bool "flambda" flambda;
|
2016-09-20 06:26:15 -07:00
|
|
|
p_bool "safe_string" safe_string;
|
2017-10-02 04:41:33 -07:00
|
|
|
p_bool "default_safe_string" default_safe_string;
|
2017-08-31 06:25:15 -07:00
|
|
|
p_bool "flat_float_array" flat_float_array;
|
2019-02-20 10:46:43 -08:00
|
|
|
p_bool "function_sections" function_sections;
|
2017-10-14 09:50:09 -07:00
|
|
|
p_bool "afl_instrument" afl_instrument;
|
Unicode support for the Windows runtime (#1200)
* Add support code
* Explicitly reference ANSI Windows APIs
* Adapt Sys.is_directory
* Adapt ocamlrun
* Add Changes entry
* Add testsuite
* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}
* Adapt headernt.c
* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.
* Adapt Sys.file_exists
* Adapt Sys.remove
* Adapt Sys.chdir
* Adapt Sys.getcwd
* Adapt Sys.getenv
* Adapt Sys.command
* Adapt Sys.readdir
* Adapt CPLUGINS
* Remove use of FormatMessageA, CreateFileA
* Adapt Unix.mkdir
* Adapt Unix.openfile
* Adapt Unix.readlink
* Adapt Unix.rename
* Adapt Unix.{LargeFile,}.{l,}stat
* Adapt Unix.system
* Adapt Unix.{open,read}dir
* Adapt Unix.link
* Adapt Unix.symlink
* Adapt Unix.getcwd
* Adapt Unix.rmdir
* Adapt Unix.utimes
* Adapt Unix.unlink
* Adapt Unix.chdir
* Adapt Unix.chmod
* Adapt Unix.{execv,execve,execvp,execvpe}
* Compile with -DUNICODE -D_UNICODE under Windows
* Add configure-time switch, Config.windows_unicode
* Adapt Unix.putenv
* Re-implement Unix.environment using GetEnvironmentStrings()
* Use Unicode-aware flexdll
* Adapt Unix.environment
* AppVeyor: bootstrap flexdll
* Adapt tests/embedded/cmmain.c
* Adapt tests/lib-dynlink-csharp/entry.c
* Remove exec tests
* Fixup
* Pass -municode to MinGW compiler
* Try to fix tests/embedded
* Adapt Sys.rename
* Correct Changes entry
* Makefile.several: use $(O) and $(NATIVECODE_ONLY)
* Display => skipped correctly for tests/win-unicode
* Add missing casts to execv* calls
It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).
* Missing header in systhreads (Win32 only)
* Revert "Pass -municode to MinGW compiler"
This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.
* Revert "Try to fix tests/embedded"
This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.
* Revert "Remove exec tests"
This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.
* Don't pass $(LDFLAGS) when build ocamlc.opt
It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).
* Use wmain on Windows for ocamlrun
* Build Unicode applications on Windows
* Use wmain in headernt.c
* Minor correction to win-unicode Makefile
* Switch submodule to FlexDLL 0.36
* Build ocamlyacc as an ANSI application
* Revert "Fixup"
This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.
* Fix casts for execvp/execve
* Remove tabs from test code
* Fix Changes entry
* shell32.lib is no longer necessary
* Free allocated string
* Changes: signal breaking change
* Disable exec_tests
* Protect with CAML_INTERNALS
2017-09-18 08:41:29 -07:00
|
|
|
p_bool "windows_unicode" windows_unicode;
|
2018-09-11 05:59:16 -07:00
|
|
|
p_bool "supports_shared_libraries" supports_shared_libraries;
|
2013-05-28 16:53:45 -07:00
|
|
|
|
|
|
|
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;
|
2020-10-07 03:32:40 -07:00
|
|
|
p "linear_magic_number" linear_magic_number;
|
ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
and exit with a failure return value (non-0)
Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.
The following alternative behaviors were considered:
- We could print a newline after the configuration value, which
would let users distinguish empty values from non-existing variables
by counting the lines of output, and would also be more pleasant for
users invoking the option from the command-line. However, the way
bash works on Windows means that $(ocamlc -config-var foo) would keep
a trailing \r in its output, and portable scripts would have to use
$(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
(This issue was pointed out by David Allsopp)
- We could print a message on the error output if the configuration
variable does not exist. This is clearer to a human user, but it is
annoying for scripts if they forget to silence the error output and
get their output mixed with our error messages. The main use of this
new feature is for scripting purposes.
2017-10-14 09:46:58 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
let print_config_value oc = function
|
|
|
|
| String s ->
|
|
|
|
Printf.fprintf oc "%s" s
|
|
|
|
| Int n ->
|
|
|
|
Printf.fprintf oc "%d" n
|
|
|
|
| Bool p ->
|
|
|
|
Printf.fprintf oc "%B" p
|
2013-09-04 08:12:37 -07:00
|
|
|
|
ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
and exit with a failure return value (non-0)
Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.
The following alternative behaviors were considered:
- We could print a newline after the configuration value, which
would let users distinguish empty values from non-existing variables
by counting the lines of output, and would also be more pleasant for
users invoking the option from the command-line. However, the way
bash works on Windows means that $(ocamlc -config-var foo) would keep
a trailing \r in its output, and portable scripts would have to use
$(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
(This issue was pointed out by David Allsopp)
- We could print a message on the error output if the configuration
variable does not exist. This is clearer to a human user, but it is
annoying for scripts if they forget to silence the error output and
get their output mixed with our error messages. The main use of this
new feature is for scripting purposes.
2017-10-14 09:46:58 -07:00
|
|
|
let print_config oc =
|
|
|
|
let print (x, v) =
|
|
|
|
Printf.fprintf oc "%s: %a\n" x print_config_value v in
|
|
|
|
List.iter print configuration_variables;
|
2005-05-09 06:39:17 -07:00
|
|
|
flush oc;
|
|
|
|
;;
|
ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
and exit with a failure return value (non-0)
Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.
The following alternative behaviors were considered:
- We could print a newline after the configuration value, which
would let users distinguish empty values from non-existing variables
by counting the lines of output, and would also be more pleasant for
users invoking the option from the command-line. However, the way
bash works on Windows means that $(ocamlc -config-var foo) would keep
a trailing \r in its output, and portable scripts would have to use
$(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
(This issue was pointed out by David Allsopp)
- We could print a message on the error output if the configuration
variable does not exist. This is clearer to a human user, but it is
annoying for scripts if they forget to silence the error output and
get their output mixed with our error messages. The main use of this
new feature is for scripting purposes.
2017-10-14 09:46:58 -07:00
|
|
|
|
|
|
|
let config_var x =
|
|
|
|
match List.assoc_opt x configuration_variables with
|
|
|
|
| None -> None
|
|
|
|
| Some v ->
|
|
|
|
let s = match v with
|
|
|
|
| String s -> s
|
2018-08-30 10:15:32 -07:00
|
|
|
| Int n -> Int.to_string n
|
ocamlc -config: new -config-var option to print specific configuration variables
The proposed behavior of `-config-var s` is as follows:
- if `s` is an existing configuration variable, print its value as
a string and exit with a success return value (0)
- if `s` is not an existing configuration variable, print nothing
and exit with a failure return value (non-0)
Note that we do not print a newline after the value of the
configuration variable. In particular, if the value is an empty
string, the output is undistinguishable from the output for
non-existing variables, the return value has to be considered instead.
The following alternative behaviors were considered:
- We could print a newline after the configuration value, which
would let users distinguish empty values from non-existing variables
by counting the lines of output, and would also be more pleasant for
users invoking the option from the command-line. However, the way
bash works on Windows means that $(ocamlc -config-var foo) would keep
a trailing \r in its output, and portable scripts would have to use
$(ocamlc -config-var foo | tr -d '\r') instead, which is a pain.
(This issue was pointed out by David Allsopp)
- We could print a message on the error output if the configuration
variable does not exist. This is clearer to a human user, but it is
annoying for scripts if they forget to silence the error output and
get their output mixed with our error messages. The main use of this
new feature is for scripting purposes.
2017-10-14 09:46:58 -07:00
|
|
|
| Bool b -> string_of_bool b
|
|
|
|
in
|
|
|
|
Some s
|
2020-10-15 05:47:19 -07:00
|
|
|
|
|
|
|
let merlin = false
|