rules.mk: make the locked template available even if flock has not been built yet...
authorFelix Fietkau <nbd@openwrt.org>
Wed, 20 Jan 2016 21:31:38 +0000 (21:31 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 20 Jan 2016 21:31:38 +0000 (21:31 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48414

rules.mk

index f0c813620a991bd5ef65509c964aa6f2d9f25675..11ed80950a786ef2856059f8e353f4798b8e0e8b 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -333,12 +333,16 @@ endef
 # Execute commands under flock
 # $(1) => The shell expression.
 # $(2) => The lock name. If not given, the global lock will be used.
-define locked
+ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),)
+  define locked
        SHELL= \
-       $(STAGING_DIR_HOST)/bin/flock \
+       flock \
                $(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \
                -c '$(subst ','\'',$(1))'
-endef
+  endef
+else
+  locked=$(1)
+endif
 
 # Recursively copy paths into another directory, purge dangling
 # symlinks before.