build: replace non-POSIX test -a|o

test/[ from sbase unix tools[1] throws "too many arguments" if -a or
-o is provided. The syntax has been marked obsolescent as per the
manual[2].

[1] http://core.suckless.org/sbase/
[2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16

PR-URL: https://github.com/nodejs/node/pull/38731
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Issam E. Maghni 2021-05-18 23:15:53 -04:00 committed by Richard Lau
parent aeea252b96
commit b5b1d1fb79
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
2 changed files with 7 additions and 7 deletions

View File

@ -102,7 +102,7 @@ $(NODE_EXE): build_type:=Release
$(NODE_G_EXE): build_type:=Debug $(NODE_G_EXE): build_type:=Debug
$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile $(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=${build_type} V=$(V) $(MAKE) -C out BUILDTYPE=${build_type} V=$(V)
if [ ! -r $@ -o ! -L $@ ]; then \ if [ ! -r $@ ] || [ ! -L $@ ]; then \
ln -fs out/${build_type}/$(NODE_EXE) $@; fi ln -fs out/${build_type}/$(NODE_EXE) $@; fi
else else
ifeq ($(BUILD_WITH), ninja) ifeq ($(BUILD_WITH), ninja)
@ -116,11 +116,11 @@ else
endif endif
$(NODE_EXE): config.gypi out/Release/build.ninja $(NODE_EXE): config.gypi out/Release/build.ninja
ninja -C out/Release $(NINJA_ARGS) ninja -C out/Release $(NINJA_ARGS)
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
$(NODE_G_EXE): config.gypi out/Debug/build.ninja $(NODE_G_EXE): config.gypi out/Debug/build.ninja
ninja -C out/Debug $(NINJA_ARGS) ninja -C out/Debug $(NINJA_ARGS)
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
else else
$(NODE_EXE) $(NODE_G_EXE): $(NODE_EXE) $(NODE_G_EXE):
$(warning This Makefile currently only supports building with 'make' or 'ninja') $(warning This Makefile currently only supports building with 'make' or 'ninja')
@ -906,7 +906,7 @@ BINARYTAR=$(BINARYNAME).tar
HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0) HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation # Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
SKIP_XZ ?= 0 SKIP_XZ ?= 0
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0) XZ = $(shell [ $(HAS_XZ) -eq 1 ] && [ $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
XZ_COMPRESSION ?= 9e XZ_COMPRESSION ?= 9e
PKG=$(TARNAME).pkg PKG=$(TARNAME).pkg
MACOSOUTDIR=out/macos MACOSOUTDIR=out/macos
@ -947,7 +947,7 @@ release-only: check-xz
echo "" >&2 ; \ echo "" >&2 ; \
exit 1 ; \ exit 1 ; \
fi fi
@if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \ @if [ "$(DISTTYPE)" != "release" ] || [ "$(RELEASE)" = "1" ]; then \
exit 0; \ exit 0; \
else \ else \
echo "" >&2 ; \ echo "" >&2 ; \
@ -956,7 +956,7 @@ release-only: check-xz
echo "" >&2 ; \ echo "" >&2 ; \
exit 1 ; \ exit 1 ; \
fi fi
@if [ "$(RELEASE)" = "0" -o -f "$(CHANGELOG)" ]; then \ @if [ "$(RELEASE)" = "0" ] || [ -f "$(CHANGELOG)" ]; then \
exit 0; \ exit 0; \
else \ else \
echo "" >&2 ; \ echo "" >&2 ; \

View File

@ -56,7 +56,7 @@ export CXX_host=$(command -v g++)
host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}') host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}')
major=$(echo $host_gcc_version | awk -F . '{print $1}') major=$(echo $host_gcc_version | awk -F . '{print $1}')
minor=$(echo $host_gcc_version | awk -F . '{print $2}') minor=$(echo $host_gcc_version | awk -F . '{print $2}')
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || ( [ $major -eq 6 ] && [ $minor -lt 3 ] ); then
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0" echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
return 1 return 1
fi fi