]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add checkxalloc to toplevel Makefile
authorKarel Zak <kzak@redhat.com>
Wed, 4 Jan 2012 13:25:21 +0000 (14:25 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 4 Jan 2012 13:25:21 +0000 (14:25 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am
tools/checkxalloc.sh

index 3dd6b389b1222910200ff35f8c9b0852b8320fa9..43b28967eea6485277ca3ecafb6f6a687c7e8b59 100644 (file)
@@ -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)
index 89940fe23bf6df81ecec0af3626964da2a98c137..578340e26d49adadff80645c6b9077eb840fc156 100755 (executable)
@@ -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