summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-28 22:53:36 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-28 22:53:36 +0000
commit385d7fa4f151425539d613c9665b5e862f3ef614 (patch)
tree39c7e788d6ce22e6f092e5b6a052a999a48bc37f
parent21ea069c9078edd386e96e038e1a71e041e32cf5 (diff)
Add "--with-lint" configure flag and "make lint" Makefile target to check
source code with lint, sparse or similar tools.
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac25
3 files changed, 38 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a94c187..1355d28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-06-28 Alan Coopersmith <alan.coopersmith@sun.com>
+ * configure.ac:
+ * Makefile.am:
+ Add "--with-lint" configure flag and "make lint" Makefile target
+ to check source code with lint, sparse or similar tools.
+
+2006-06-28 Alan Coopersmith <alan.coopersmith@sun.com>
+
* include/X11/Xauth.h:
Remove prototype for XauGetAuthByName to clear lint warning:
name declared but never used or defined
diff --git a/Makefile.am b/Makefile.am
index 03bf6ac..6008b3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,12 @@ TESTS=Autest
Autest_SOURCES=Autest.c
Autest_LDADD=libXau.la
+if LINT
+lint:
+ $(LINT) $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(libXau_la_SOURCES)
+endif LINT
+
LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%)
libmandir = $(LIB_MAN_DIR)
diff --git a/configure.ac b/configure.ac
index 8ecadb6..eca100e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,31 @@ dnl XXX incomplete, please fill this in
XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
fi
+# Allow checking code with lint, sparse, etc.
+AC_ARG_WITH(lint, [AC_HELP_STRING([lint],
+ [Use a lint-style source code checker (default: disabled)])])
+if test "x$with_lint" = "xyes" ; then
+ LINT="lint"
+else
+ LINT="$with_lint"
+fi
+if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
+ case $LINT in
+ lint|*/lint)
+ case $host_os in
+ solaris*)
+ LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+ ;;
+ esac
+ ;;
+ esac
+fi
+
+LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
+AC_SUBST(LINT)
+AC_SUBST(LINT_FLAGS)
+AM_CONDITIONAL(LINT, [test x$LINT != xno])
+
if test "x$GCC" = "xyes"; then
GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \