File: 0002-Trigger-output-complete-exe-on-custom-with-an-enviro.patch

package info (click to toggle)
ocaml 5.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 43,124 kB
  • sloc: ml: 355,439; ansic: 51,636; sh: 25,098; asm: 5,413; makefile: 3,673; python: 919; javascript: 273; awk: 253; perl: 59; fortran: 21; cs: 9
file content (36 lines) | stat: -rw-r--r-- 1,271 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Stephane Glondu <steph@glondu.net>
Date: Thu, 3 Sep 2020 15:21:10 +0200
Subject: Trigger -output-complete-exe on -custom with an environment variable

---
 driver/main_args.ml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/driver/main_args.ml b/driver/main_args.ml
index ea07d15..7972427 100644
--- a/driver/main_args.ml
+++ b/driver/main_args.ml
@@ -1920,7 +1920,6 @@ third-party libraries such as Lwt, but with a different API."
     include Core
     include Compiler
     let _compat_32 = set bytecode_compatible_32
-    let _custom = set custom_runtime
     let _dcamlprimc = set keep_camlprimc_file
     let _dinstr = set dump_instr
     let _dllib s = Compenv.defer (ProcessDLLs (Misc.rev_split_words s))
@@ -1939,6 +1938,15 @@ third-party libraries such as Lwt, but with a different API."
     let _use_runtime s = use_runtime := s
     let _v () = Compenv.print_version_and_library "compiler"
     let _vmthread () = Compenv.fatal vmthread_removed_message
+    let _custom () =
+      if
+        match Sys.getenv_opt "OCAML_CUSTOM_USE_OUTPUT_COMPLETE_EXE" with
+        | None | Some "" -> false
+        | Some _ -> true
+      then
+        _output_complete_exe ()
+      else
+        set custom_runtime ()
   end
 
 end