summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index 7972f01b387..40d0c37b11b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -82,7 +82,16 @@ check_version ()
printf '%s' "(using $uprog0=$uprog) "
fi
- command -v $uprog > /dev/null || return 1
+ ## /bin/sh should always define the "command" builtin, but
+ ## sometimes it does not on hydra.nixos.org.
+ ## /bin/sh = "BusyBox v1.27.2", "built-in shell (ash)".
+ ## It seems to be an optional compile-time feature in that shell:
+ ## see ASH_CMDCMD in <https://git.busybox.net/busybox/tree/shell/ash.c>.
+ if command -v command > /dev/null 2>&1; then
+ command -v $uprog > /dev/null || return 1
+ else
+ $uprog --version > /dev/null 2>&1 || return 1
+ fi
have_version=`get_version $uprog` || return 4
have_maj=`major_version $have_version`