summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-10-10 13:33:33 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2006-10-10 13:33:33 -0700
commitd0e12a97849871b0b2af04bf8d7a3839c54b31a8 (patch)
tree6f54e01dbcad005acf2c27127d798b128ac5cc28
parent932965298c244553f303fab3bdf23941cc40bb23 (diff)
downloadxorg-lib-libXcursor-d0e12a97849871b0b2af04bf8d7a3839c54b31a8.tar.gz
Add XORG_WITH_LINT to allow checking code with lint/sparse/etc.
-rw-r--r--Makefile.am5
-rw-r--r--configure.ac7
-rw-r--r--src/Makefile.am8
3 files changed, 20 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 3355bdd..0050eb2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,3 +29,8 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xcursor.pc
EXTRA_DIST = xcursor.pc.in autogen.sh
+
+if LINT
+lint:
+ (cd src && $(MAKE) $(MFLAGS) lint)
+endif LINT
diff --git a/configure.ac b/configure.ac
index 87df4e2..ece5827 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,10 @@ AC_CONFIG_SRCDIR([Makefile.am])
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
@@ -65,6 +69,9 @@ AC_SUBST(XCURSOR_LIBS)
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+
AC_OUTPUT([Makefile
src/Makefile
man/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index d52a0f4..a8734f3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,3 +18,11 @@ libXcursor_la_LDFLAGS = -version-number 1:0:2 -no-undefined
libXcursorincludedir = $(includedir)/X11/Xcursor
libXcursorinclude_HEADERS = $(top_srcdir)/include/X11/Xcursor/Xcursor.h
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libXcursor_la_SOURCES) $(XCURSOR_LIBS)
+endif LINT