From c98be137c711235fe5bff430e93222d2a47b5e6a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 15 Feb 2007 18:59:53 -0800 Subject: Add support for source code checkers such as sparse & lint --- Makefile.am | 4 ++++ configure.ac | 8 ++++++++ src/Makefile.am | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/Makefile.am b/Makefile.am index 5ba56df..d830939 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,3 +26,7 @@ pkgconfig_DATA = xinerama.pc EXTRA_DIST = xinerama.pc.in autogen.sh +if LINT +lint: + (cd src && $(MAKE) $(MFLAGS) lint) +endif LINT diff --git a/configure.ac b/configure.ac index e4f8ed9..e47de85 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,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])]) +XORG_MACROS_VERSION(1.1) + # Check for progs AC_PROG_CC AC_PROG_LIBTOOL @@ -37,6 +41,10 @@ PKG_CHECK_MODULES(XINERAMA, x11 xext xextproto xineramaproto) AC_SUBST(XINERAMA_CFLAGS) AC_SUBST(XINERAMA_LIBS) + +dnl Allow checking code with lint, sparse, etc. +XORG_WITH_LINT +LINT_FLAGS="${LINT_FLAGS} ${XINERAMA_CFLAGS}" XORG_CHECK_MALLOC_ZERO XORG_RELEASE_VERSION diff --git a/src/Makefile.am b/src/Makefile.am index 098ff05..7d718d4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,3 +7,11 @@ libXinerama_la_SOURCES = \ libXinerama_la_LIBADD = $(XINERAMA_LIBS) libXinerama_la_LDFLAGS = -version-number 1:0:0 -no-undefined + +if LINT +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) + +lint: + $(LINT) $(ALL_LINT_FLAGS) $(libXinerama_la_SOURCES) $(XINERAMA_LIBS) +endif LINT -- cgit v1.2.3