From 45732b8862cf357837f11d4305eadd3fb92e204f Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 6 Oct 2020 03:35:57 +0100 Subject: [PATCH] Fix %{make} on Windows Signed-off-by: Kate --- CHANGES.md | 4 ++++ src/stdune/bin.ml | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 34bf9fa575c..8d48299b840 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,10 @@ Unreleased installed and to be usable by other public libraries in the same project (#3655, fixes #1017, @rgrinberg) +- Fix the `%{make}` variable on Windows by only checking for a `gmake` binary + on UNIX-like systems as a unrelated `gmake` binary might exist on Windows. + (#3853, @kit-ty-kate) + 2.7.1 (2/09/2020) ----------------- diff --git a/src/stdune/bin.ml b/src/stdune/bin.ml index adf5bf2bd77..df029398fb5 100644 --- a/src/stdune/bin.ml +++ b/src/stdune/bin.ml @@ -41,6 +41,12 @@ let which ~path prog = Option.some_if (exists fn) fn) let make ~path = - match which ~path "gmake" with + let gmake = + if Sys.unix then + which ~path "gmake" + else + None + in + match gmake with | None -> which ~path "make" | some -> some