diff --git a/Makefile.config.in b/Makefile.config.in index ec9e1babf..50b3eb1b3 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -77,6 +77,7 @@ RANLIB = @RANLIB@ RUBY_CFLAGS = @RUBY_CFLAGS@ RUBY_LIBS = @RUBY_LIBS@ SEE_CFLAGS = @SEE_CFLAGS@ +SPARSE = @SPARSE@ SPIDERMONKEY_CFLAGS = @SPIDERMONKEY_CFLAGS@ SPIDERMONKEY_LIBS = @SPIDERMONKEY_LIBS@ VERSION = @VERSION@ diff --git a/Makefile.lib b/Makefile.lib index a35c721c1..aa42ca7b8 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -33,6 +33,9 @@ quiet_cmd_ld_objs = " [LD] $(RELPATH)$@" quiet_cmd_link = ' [LINK] $(RELPATH)$@' cmd_link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) + quiet_cmd_sparse = ' [SPARSE] $(RELPATH)$(2)' + cmd_sparse = $(SPARSE) $(DEFS) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(SPARSE_FLAGS) $(2) + # Recursive make quiet_cmd_recmake = "[MAKE $(3)] $(RELPATH)$(2)" cmd_recmake = $(MAKE) -C $(2) $(3) @@ -44,7 +47,6 @@ quiet_cmd_installprog = " [INSTALL] $(RELPATH)$(2) -> $(3)" cmd_installprog = $(INSTALL_PROGRAM) $(2) $(3) - ### Internal build rules DEP_FILES_1 = $(foreach src,$(OBJS),.deps/$(src)) @@ -115,6 +117,15 @@ clean-default: cleanall-default: clean-default +check-default: +ifneq ($(SPARSE),) + @$(foreach file, $(wildcard *.c), \ + $(call ncmd,sparse,$(file));) +endif + +# sparse is architecture-neutral, which means that we need to tell it +# explicitly what architecture to check for. Fix this up for yours.. +SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ install-default: all-default ifdef PROGS @$(MKINSTALLDIRS) $(DESTDIR)$(bindir) @@ -134,9 +145,9 @@ endif # Recursion: -.PHONY: all-recursive install-recursive clean-recursive cleanall-recursive init-recursive +.PHONY: all-recursive install-recursive clean-recursive cleanall-recursive init-recursive check-recursive -all-recursive install-recursive clean-recursive cleanall-recursive init-recursive: +all-recursive install-recursive clean-recursive cleanall-recursive init-recursive check-recursive: ifdef SUBDIRS @$(foreach subdir,$(sort $(SUBDIRS)), \ $(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;) @@ -144,6 +155,7 @@ endif all: all-recursive all-default all-local install: install-recursive install-default install-local +check: check-recursive check-default check-local clean: clean-recursive clean-default clean-local cleanall: cleanall-recursive cleanall-default @@ -152,6 +164,7 @@ init: init-default init-recursive all-local: install-local: clean-local: +check-local: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/configure.in b/configure.in index cad84d8cb..328a8a343 100644 --- a/configure.in +++ b/configure.in @@ -54,6 +54,9 @@ AC_PROG_INSTALL AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id") +AC_PATH_PROGS(SPARSE, "sparse") +AC_SUBST(SPARSE) + CONFIG_ASCIIDOC="no" CONFIG_POD2HTML="no" CONFIG_XMLTO="no"