core/dependencies: check if we need to build our own host-coreutils
authorYann E. MORIN <yann.morin.1998@free.fr>
Wed, 18 Dec 2019 20:39:04 +0000 (21:39 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 6 Jan 2020 20:43:38 +0000 (21:43 +0100)
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/dependencies/check-host-coreutils.mk [new file with mode: 0644]
support/dependencies/check-host-coreutils.sh [new file with mode: 0755]

diff --git a/support/dependencies/check-host-coreutils.mk b/support/dependencies/check-host-coreutils.mk
new file mode 100644 (file)
index 0000000..87a3f44
--- /dev/null
@@ -0,0 +1,6 @@
+# Check whether the host's coreutils are up to date enough
+# to provide 'ln --relative' and 'realpath'.
+
+ifeq (,$(call suitable-host-package,coreutils))
+BR2_COREUTILS_HOST_DEPENDENCY = host-coreutils
+endif
diff --git a/support/dependencies/check-host-coreutils.sh b/support/dependencies/check-host-coreutils.sh
new file mode 100755 (executable)
index 0000000..4d36d74
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Exit on the first error
+set -e
+
+# Does ln supports the --relative/-r option?
+ln --relative --help >/dev/null 2>&1
+
+# Does realpath exist?
+realpath --help >/dev/null 2>&1
+
+echo OK