summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2020-09-21 10:07:26 +0100
committerDavid Allsopp <david.allsopp@metastack.com>2020-09-21 10:11:39 +0100
commit2bc77ee5cd43719e6fb8cc0793457bacdd386815 (patch)
tree65e35059aa5e6722f2bf73fe084ab4c60eaf4205
parent14300d3b1a992a51760da7489aae8784782d09f6 (diff)
downloadocaml-resurrect-cygwin64-review-base.tar.gz
Simpler implementation of Ccomp.linker_is_flexlinkresurrect-cygwin64-review-base
-rw-r--r--utils/ccomp.ml24
1 files changed, 4 insertions, 20 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 1986299ca5..22b60a8b92 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -208,23 +208,7 @@ let call_linker mode output_name files extra =
)
let linker_is_flexlink =
- let command =
- String.trim @@ Option.value !Clflags.c_compiler ~default:Config.mkexe in
- if String.length command < 2 then false else
- (* Get the first "word" of command *)
- let full_path =
- (* This is not comprehensive, but should be good enough for Windows *)
- if command.[0] = '"' then
- match String.index_from command 1 '"' with
- | idx -> String.sub command 1 (idx - 1)
- | exception Not_found -> String.sub command 1 (String.length command - 1)
- else
- match String.index_from command 1 ' ' with
- | idx -> String.sub command 0 idx
- | exception Not_found -> command
- in
- let prog =
- let prog = Filename.basename full_path in
- Option.value ~default:prog @@ Filename.chop_suffix_opt prog ~suffix:".exe"
- in
- String.lowercase_ascii prog = "flexlink"
+ (* Config.mkexe, Config.mkdll and Config.mkmaindll are all flexlink
+ invocations for the native Windows ports and for Cygwin, if shared library
+ support is enabled. *)
+ Sys.win32 || Config.supports_shared_libraries && Sys.cygwin