Skip to content

Commit

Permalink
build: fix check-xz for platforms defaulting to sh
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rvagg authored and BridgeAR committed Dec 7, 2018
1 parent cf567f4 commit 5984611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -851,10 +851,10 @@ BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
endif
BINARYTAR=$(BINARYNAME).tar
# OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [[ $$? = 0 ]] && echo 1 || echo 0)
HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
SKIP_XZ ?= 0
XZ = $(shell [[ $(HAS_XZ) = 1 && $(SKIP_XZ) = 0 ]] && echo 1 || echo 0)
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
XZ_COMPRESSION ?= 9e
PKG=$(TARNAME).pkg
MACOSOUTDIR=out/macos
Expand Down

0 comments on commit 5984611

Please sign in to comment.