Skip to content

Commit

Permalink
autogen.sh: Use command -v to check whether commands exist
Browse files Browse the repository at this point in the history
which(1) is not standardized by POSIX, and has different implementations
and behaviour on different distributions. The behaviour and exit status
of command -v is standardized by POSIX.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv authored and alexlarsson committed Jan 25, 2022
1 parent 994accc commit dc8227e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ test -n "$srcdir" || srcdir=.
olddir=$(pwd)
cd "$srcdir"

AUTORECONF=$(which autoreconf)
if test -z "$AUTORECONF"; then
if ! command -v autoreconf >/dev/null; then
echo "*** No autoreconf found, please install it ***"
exit 1
fi
Expand All @@ -25,8 +24,7 @@ fi
sed -e 's,$(libglnx_srcpath),subprojects/libglnx,g' < subprojects/libglnx/Makefile-libglnx.am > subprojects/Makefile-libglnx.am.inc
sed -e 's,$(bwrap_srcpath),subprojects/bubblewrap,g' < subprojects/bubblewrap/Makefile-bwrap.am > subprojects/Makefile-bwrap.am.inc

GTKDOCIZE=$(which gtkdocize 2>/dev/null)
if test -z "$GTKDOCIZE"; then
if ! command -v gtkdocize >/dev/null; then
echo "*** You don't have gtk-doc installed, and thus won't be able to generate the documentation. ***"
rm -f gtk-doc.make
cat > gtk-doc.make <<EOF
Expand Down

0 comments on commit dc8227e

Please sign in to comment.