diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-05 14:28:06 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-05 14:28:06 -0700 |
commit | 2179b2d467d69e45559b8e4f161a904a21f05321 (patch) | |
tree | 1c29081ef1bba8766b50b94899273ebb4cd74873 | |
parent | 6b361c028b5ad931b61df86fae570f3ef9f41c15 (diff) |
Add hooks for checking source code with lint/sparse/etc.
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | src/Makefile.am | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index d3dd678..2d72364 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,3 +10,8 @@ ChangeLog: (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) dist-hook: ChangeLog + +if LINT +lint: + (cd src && $(MAKE) $(MFLAGS) lint) +endif LINT diff --git a/configure.ac b/configure.ac index fb79a19..2cea81f 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,11 @@ AC_DEFINE(ICE_t, 1, [Xtrans transport type]) # Checks for header files. AC_HEADER_STDC +dnl Allow checking code with lint, sparse, etc. +XORG_WITH_LINT +XORG_LINT_LIBRARY([ICE]) +LINT_FLAGS="${LINT_FLAGS} ${ICE_CFLAGS} ${XTRANS_CFLAGS}" + if test "x$GCC" = "xyes"; then GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations \ diff --git a/src/Makefile.am b/src/Makefile.am index b549ede..0207a89 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,3 +38,11 @@ iceinclude_HEADERS=\ $(top_srcdir)/include/X11/ICE/ICEmsg.h \ $(top_srcdir)/include/X11/ICE/ICEproto.h \ $(top_srcdir)/include/X11/ICE/ICEutil.h + +if LINT +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) + +lint: + $(LINT) $(ALL_LINT_FLAGS) $(libICE_la_SOURCES) $(XINERAMA_LIBS) +endif LINT |