build-sys: add checkxalloc to toplevel Makefile

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-01-04 14:25:21 +01:00
parent cce4d25aed
commit d05a3e9713
2 changed files with 12 additions and 0 deletions

View 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)

View File

@ -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