aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/config.in1
-rw-r--r--config/config_utils.in7
-rw-r--r--config/kernel/linux.in7
3 files changed, 13 insertions, 2 deletions
diff --git a/config/config.in b/config/config.in
index cc349aa0..bbde6a66 100644
--- a/config/config.in
+++ b/config/config.in
@@ -1,4 +1,5 @@
mainmenu "crosstool-NG $(CT_VERSION) Configuration"
+source "config/config_utils.in"
source "config/configure.in"
source "config/global.in"
source "config/target.in"
diff --git a/config/config_utils.in b/config/config_utils.in
new file mode 100644
index 00000000..cc52ca1d
--- /dev/null
+++ b/config/config_utils.in
@@ -0,0 +1,7 @@
+# $(if-success,<command>,<then>,<else>)
+# Return <then> if <command> exits with 0, <else> otherwise.
+if-success = $(shell,{ $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
+
+# $(success,<command>)
+# Return y if <command> exits with 0, n otherwise
+success = $(if-success,$(1),y,n)
diff --git a/config/kernel/linux.in b/config/kernel/linux.in
index 6d872c42..0f85ff89 100644
--- a/config/kernel/linux.in
+++ b/config/kernel/linux.in
@@ -12,12 +12,15 @@
# (including versions in between) until the EOL dates indicated below.
# Such pinned versions are indicated in version.desc files with a comment.
+config KERNEL_has_rsync
+ def_bool $(success,which rsync)
+
config KERNEL_DEP_RSYNC
def_bool y
- select LINUX_REQUIRE_older_than_5_3 if !CONFIGURE_has_rsync
+ select LINUX_REQUIRE_older_than_5_3 if !KERNEL_has_rsync
comment "Linux >=5.3 requires rsync"
- depends on !CONFIGURE_has_rsync
+ depends on !KERNEL_has_rsync
choice
bool