From d05a3e971366923d3d9ce65e1afb373188b06b10 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 4 Jan 2012 14:25:21 +0100 Subject: [PATCH] build-sys: add checkxalloc to toplevel Makefile Signed-off-by: Karel Zak --- Makefile.am | 2 ++ tools/checkxalloc.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile.am b/Makefile.am index 3dd6b389b1..43b28967ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,6 +88,8 @@ checkconfig: -name '*.[hcS]' -type f -print | sort -u \ | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir) +checkxalloc: + @ $(top_srcdir)/tools/checkxalloc.sh ENABLE_ALL = --enable-static-programs --enable-most-builds DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-use-tty-group $(ENABLE_ALL) diff --git a/tools/checkxalloc.sh b/tools/checkxalloc.sh index 89940fe23b..578340e26d 100755 --- a/tools/checkxalloc.sh +++ b/tools/checkxalloc.sh @@ -11,3 +11,13 @@ cd "$(git rev-parse --show-toplevel)" || { git grep -zl '#include "xalloc.h"' | xargs -0 grep -nwE '[^x](([cm]|re)alloc|strdup)\(' + +result=$? + +if [ $result -eq 123 ]; then + exit 0 # not found +elif [ $result -eq 0 ]; then + exit 1 # found +fi + +exit $result -- 2.47.3