[CRIU] [PATCHv2 1/2] build/nmk: use TAGS instead ETAGS and CTAGS
Dmitry Safonov
dsafonov at virtuozzo.com
Thu Feb 25 02:26:48 PST 2016
Impact: do not use both, do not try to use one of them without a check.
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
scripts/nmk/scripts/tools.mk | 8 ++++++--
scripts/nmk/scripts/utils.mk | 3 +++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk
index 0538dde..fa4816d 100644
--- a/scripts/nmk/scripts/tools.mk
+++ b/scripts/nmk/scripts/tools.mk
@@ -22,8 +22,12 @@ SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
CSCOPE := cscope
-ETAGS := etags
-CTAGS := ctags
+
+ifeq ($(call pkg-check, etags --version),y)
+TAGS := etags
+else
+TAGS := ctags
+endif
export RM LD CC CPP AS AR STRIP OBJCOPY OBJDUMP
export NM SH MAKE MKDIR AWK PERL PYTHON SH CSCOPE
diff --git a/scripts/nmk/scripts/utils.mk b/scripts/nmk/scripts/utils.mk
index 50ceb7a..e452ab4 100644
--- a/scripts/nmk/scripts/utils.mk
+++ b/scripts/nmk/scripts/utils.mk
@@ -12,6 +12,9 @@ try-cc = $(shell sh -c
# Usage: ifeq ($(call pkg-config-check, library),y)
pkg-config-check = $(shell sh -c 'pkg-config $(1) && echo y')
+# Usage: ifeq ($(call pkg-check, package --version),y)
+pkg-check = $(shell sh -c '$(1) && echo y')
+
#
# Remove duplicates.
uniq = $(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))))
--
2.7.1
More information about the CRIU
mailing list