Skip to content

Commit bfec6a4

Browse files
rvaggBridgeAR
authored andcommitted
build: fix check-xz for platforms defaulting to sh
5e80a9a introduced check-xz, using `[[ .. ]]` syntax, but this is a bash builtin and some platforms default to `sh` when doing `$(shell ...)` in Makefiles. Fix is to make it sh friendly. Ref: #24551 PR-URL: #24841 Refs: #24551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 0ed669c commit bfec6a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,10 @@ BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
851851
endif
852852
BINARYTAR=$(BINARYNAME).tar
853853
# OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
854-
HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [[ $$? = 0 ]] && echo 1 || echo 0)
854+
HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
855855
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
856856
SKIP_XZ ?= 0
857-
XZ = $(shell [[ $(HAS_XZ) = 1 && $(SKIP_XZ) = 0 ]] && echo 1 || echo 0)
857+
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
858858
XZ_COMPRESSION ?= 9e
859859
PKG=$(TARNAME).pkg
860860
MACOSOUTDIR=out/macos

0 commit comments

Comments
 (0)