Rework the indent target.
- Check indent is present at ./configure stage; - If gindent(1) is installed, use it instead of indent(1);
This commit is contained in:
parent
2688de6500
commit
67fb1330f8
2 changed files with 14 additions and 2 deletions
|
@ -20,6 +20,8 @@ doc : Doxyfile
|
||||||
.PHONY: doc
|
.PHONY: doc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INDENT_CMD = indent -br -brs -ce --line-length120 -nut -i2
|
if HAS_INDENT
|
||||||
|
INDENT_ARGS = -br -brs -ce --line-length120 -nut -i2
|
||||||
indent:
|
indent:
|
||||||
find $(top_srcdir)/libnfc $(top_srcdir)/include $(top_srcdir)/examples -name "*.[hc]" -exec $(INDENT_CMD) '{}' \;
|
find $(top_srcdir)/libnfc $(top_srcdir)/include $(top_srcdir)/examples -name "*.[hc]" -exec $(INDENT) $(INDENT_ARGS) '{}' ';'
|
||||||
|
endif
|
||||||
|
|
10
configure.ac
10
configure.ac
|
@ -90,6 +90,16 @@ then
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
|
AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
|
||||||
|
|
||||||
|
# The indent target require GNU indent
|
||||||
|
AC_PATH_PROG([INDENT], [indent])
|
||||||
|
AC_PATH_PROG([GINDENT], [gindent])
|
||||||
|
if test x"$GINDENT" != x""; then
|
||||||
|
INDENT="$GINDENT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(INDENT)
|
||||||
|
AM_CONDITIONAL(HAS_INDENT, [test x"$INDENT" != x""])
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
PKG_CONFIG_REQUIRES=""
|
PKG_CONFIG_REQUIRES=""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue