summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-10-04 18:50:44 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2006-10-04 18:50:44 -0700
commitb00dcc90e490454fdd983b4bf6d0fa92ab91d0be (patch)
tree6fe259fe90df68522101334a1f4df0bee15b0446
parent5d18f978c9085c3c9d9a44c90e73055125e11a68 (diff)
Add XORG_WITH_LINT support for checking source code with lint/sparse/etc.
-rw-r--r--Makefile.am5
-rw-r--r--configure.ac8
-rw-r--r--src/Makefile.am7
3 files changed, 20 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index a16b742..3536607 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,3 +32,8 @@ ChangeLog:
git-log > ChangeLog
dist-hook: ChangeLog
+
+if LINT
+lint:
+ (cd src && $(MAKE) $(MFLAGS) lint)
+endif LINT
diff --git a/configure.ac b/configure.ac
index 067d4b3..6dc6919 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,10 @@ AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
+# Require xorg-macros version 1.1.0 or newer for XORG_WITH_LINT macro
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.1)
+
# Check for progs
AC_PROG_CC
AC_PROG_LIBTOOL
@@ -51,6 +55,10 @@ PKG_CHECK_MODULES(FONTENC, xproto)
AC_SUBST(FONTENC_CFLAGS)
AC_SUBST(FONTENC_LIBS)
+
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+LINT_FLAGS="${LINT_FLAGS} ${FONTENC_CFLAGS}"
XORG_RELEASE_VERSION
diff --git a/src/Makefile.am b/src/Makefile.am
index 34355d9..3c6c3f6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,3 +20,10 @@ libfontencincludedir = $(includedir)/X11/fonts
libfontencinclude_HEADERS = \
$(top_srcdir)/include/X11/fonts/fontenc.h
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libfontenc_la_SOURCES) $(libfontenc_la_LIBADD) $(LIBS)
+endif LINT