From dc8227ea8b5368429e6b99d71055c8b895951964 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jan 2022 09:56:32 +0000 Subject: autogen.sh: Use command -v to check whether commands exist 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 --- autogen.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'autogen.sh') diff --git a/autogen.sh b/autogen.sh index ac0d408b..25c1455e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 @@ -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 <