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