summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-06-06 14:11:04 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-06-06 14:11:04 -0700
commit57a201a15637cfea6c15a4d0ed8b629c9cd49495 (patch)
tree63f4dbcc97d2aee0823ddcf0f1abc6187668ccfc
parent5e791a1465aba3b8be89b4cf2d9f90dee18e8e96 (diff)
Add hooks to check code with sparse/lint
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac5
-rw-r--r--src/Makefile.am8
3 files changed, 17 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 23a33b8..20760d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,3 +26,7 @@ pkgconfig_DATA = xtst.pc
EXTRA_DIST = xtst.pc.in autogen.sh
+if LINT
+lint:
+ (cd src && $(MAKE) $(MFLAGS) lint)
+endif LINT
diff --git a/configure.ac b/configure.ac
index a7fc7ae..554ab13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,11 @@ AC_PROG_LIBTOOL
# Check for dependencies
PKG_CHECK_MODULES(XTST, x11 xext recordproto xextproto inputproto)
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+XORG_LINT_LIBRARY([Xtst])
+LINT_FLAGS="${LINT_FLAGS} ${XTST_CFLAGS}"
+
AC_SUBST(XTST_CFLAGS)
AC_SUBST(XTST_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index a3759b2..7e3a901 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,3 +8,11 @@ libXtst_la_LIBADD = @XTST_LIBS@
AM_CFLAGS = @XTST_CFLAGS@
libXtst_la_LDFLAGS = -version-number 6:1:0 -no-undefined
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libXtst_la_SOURCES) $(XTST_LIBS)
+endif LINT