From fe48eede0ed807dde28a5d7187f8490ac2615989 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 2 Sep 2019 16:48:16 +0000 Subject: [PATCH] `command -v` with more than one argument is non-portable On FreeBSD build fails, so check if `msbuild` exists without arguments. $ gmake command: wrong number of arguments OpenRA requires the 'msbuild -verbosity:m -nologo' tool provided by Mono >= 5.4. gmake: *** [Makefile:154: core] Error 1 # FreeBSD sh $ command -v echo ls command: wrong number of arguments # dash $ command -v echo ls echo # ksh, bash, zsh $ command -v echo ls echo /bin/ls --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bf92314790..a15020afd8 100644 --- a/Makefile +++ b/Makefile @@ -151,7 +151,7 @@ test: core all: dependencies core core: - @command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) + @command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) ifeq ($(WIN32), $(filter $(WIN32),true yes y on 1)) @$(MSBUILD) -t:build -p:Configuration="Release-x86" else