diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2006-09-26 18:30:41 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2006-09-26 18:30:41 -0700 |
commit | 945f89d551438298d9a09a4fd3e9e40ac6b1ad51 (patch) | |
tree | a29355f672279c4cfde64ef33d590be142769478 | |
parent | 3cc151c221139869980bc33d5336ab75c04606bc (diff) |
Add hooks for checking code with sparse/lint/etc.
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/Makefile.am | 9 |
3 files changed, 23 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index b6a7f44..4de13ba 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 e9ac0cd..d130966 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 before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.1) + # Check for progs AC_PROG_CC AC_PROG_LIBTOOL @@ -43,6 +47,11 @@ AC_CHECK_FUNC([shmat], AC_DEFINE(HAS_SHM,1,[Has shm*() functions])) XORG_CHECK_MALLOC_ZERO XORG_RELEASE_VERSION +dnl Allow checking code with lint, sparse, etc. +XORG_WITH_LINT +LINT_FLAGS="${LINT_FLAGS} ${XVMC_CFLAGS}" + + AC_OUTPUT([Makefile include/Makefile include/X11/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index e342bb1..3314c5c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,3 +21,12 @@ libXvMCW_la_CFLAGS = \ libXvMC_la_LDFLAGS = -version-number 1:0:0 -no-undefined libXvMCW_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) $(libXvMC_la_SOURCES) $(XV_LIBS) +endif LINT |