Replace which with command for portability (#542)

The `which` command is not part of the posix standard and not available
in some environments.  The `command` command is part of the posix
standard and well supported.

See https://unix.stackexchange.com/q/85249 for a discussion about the
use of `command` instead of `which`.

If a system had `libtool` but not `which`, the build process would issue
an erroneous error stating:

    libtool is required, but wasn't found on this system

Switching to `command` corrects this problem.
This commit is contained in:
Jim Patterson
2017-05-19 14:51:56 +02:00
committed by Frank Denis
parent 00212b2604
commit 1fd6a4bfc2
2 changed files with 15 additions and 7 deletions
+4 -1
View File
@@ -16,7 +16,10 @@ else
fi
fi
which python >/dev/null 2>&1 || \
command -v command >/dev/null 2>&1 || \
{ echo "command is required, but wasn't found on this system"; exit 1; }
command -v python >/dev/null 2>&1 || \
{ echo >&2 "Python not found. Aborting."; exit 1; }
SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)