diff options
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/Makefile.am | 8 |
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 |