From fc02787c53c6b3718273f16bd91edf53cce863a5 Mon Sep 17 00:00:00 2001 From: reed Date: Mon, 21 May 2007 20:46:43 +0000 Subject: Import sparse. Sparse, the semantic parser, provides a compiler frontend capable of parsing most of ANSI C as well as many GCC extensions, and a collection of sample compiler backends, including a static analyzer also called "sparse". Sparse provides a set of annotations designed to convey semantic information about types, such as what address space pointers point to, or what locks a function acquires or releases. Linus Torvalds started writing Sparse in 2003, initially targeting issues such as mixing pointers to user address space and pointers to kernel address space. --- devel/sparse/DESCR | 11 +++++++++++ devel/sparse/Makefile | 22 ++++++++++++++++++++++ devel/sparse/PLIST | 26 ++++++++++++++++++++++++++ devel/sparse/distinfo | 6 ++++++ devel/sparse/patches/patch-aa | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 devel/sparse/DESCR create mode 100644 devel/sparse/Makefile create mode 100644 devel/sparse/PLIST create mode 100644 devel/sparse/distinfo create mode 100644 devel/sparse/patches/patch-aa (limited to 'devel/sparse') diff --git a/devel/sparse/DESCR b/devel/sparse/DESCR new file mode 100644 index 00000000000..8db09c7108d --- /dev/null +++ b/devel/sparse/DESCR @@ -0,0 +1,11 @@ +Sparse, the semantic parser, provides a compiler frontend capable +of parsing most of ANSI C as well as many GCC extensions, and a +collection of sample compiler backends, including a static analyzer +also called "sparse". Sparse provides a set of annotations designed +to convey semantic information about types, such as what address +space pointers point to, or what locks a function acquires or +releases. + +Linus Torvalds started writing Sparse in 2003, initially targeting +issues such as mixing pointers to user address space and pointers +to kernel address space. diff --git a/devel/sparse/Makefile b/devel/sparse/Makefile new file mode 100644 index 00000000000..de14dab4629 --- /dev/null +++ b/devel/sparse/Makefile @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $ +# + +DISTNAME= sparse-0.3 +CATEGORIES= devel lang +MASTER_SITES= http://kernel.org/pub/software/devel/sparse/dist/ + +MAINTAINER= reed@reedmedia.net +HOMEPAGE= http://kernel.org/pub/software/devel/sparse/ +COMMENT= Semantic parser for C + +INSTALLATION_DIRS+= share/doc/sparse +PKGCONFIG_OVERRIDE+= sparse.pc.in +REPLACE_PERL= cgcc +USE_TOOLS+= gmake perl:run + +post-install: + ${INSTALL_DATA} ${WRKSRC}/FAQ ${PREFIX}/share/doc/sparse/ + ${INSTALL_DATA} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/sparse/ + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/sparse/ + +.include "../../mk/bsd.pkg.mk" diff --git a/devel/sparse/PLIST b/devel/sparse/PLIST new file mode 100644 index 00000000000..93ec2949d51 --- /dev/null +++ b/devel/sparse/PLIST @@ -0,0 +1,26 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $ +bin/cgcc +bin/sparse +include/sparse/allocate.h +include/sparse/bitmap.h +include/sparse/compat.h +include/sparse/dissect.h +include/sparse/expression.h +include/sparse/flow.h +include/sparse/ident-list.h +include/sparse/lib.h +include/sparse/linearize.h +include/sparse/parse.h +include/sparse/ptrlist.h +include/sparse/scope.h +include/sparse/storage.h +include/sparse/symbol.h +include/sparse/target.h +include/sparse/token.h +lib/libsparse.a +lib/pkgconfig/sparse.pc +share/doc/sparse/FAQ +share/doc/sparse/LICENSE +share/doc/sparse/README +@dirrm include/sparse +@dirrm share/doc/sparse diff --git a/devel/sparse/distinfo b/devel/sparse/distinfo new file mode 100644 index 00000000000..13e96b350ab --- /dev/null +++ b/devel/sparse/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $ + +SHA1 (sparse-0.3.tar.gz) = 1d868b29234176abd5f3f5463aad1f11d5268dc2 +RMD160 (sparse-0.3.tar.gz) = 36bb7e5611f56c5b222f33a0853e8315af406704 +Size (sparse-0.3.tar.gz) = 177462 bytes +SHA1 (patch-aa) = 234aa80cdd04835b9a8b2bfe4e41b0c7a1f07ff2 diff --git a/devel/sparse/patches/patch-aa b/devel/sparse/patches/patch-aa new file mode 100644 index 00000000000..f99a8400b0a --- /dev/null +++ b/devel/sparse/patches/patch-aa @@ -0,0 +1,35 @@ +$NetBSD: patch-aa,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $ + +--- Makefile.orig 2007-05-21 15:15:45.000000000 -0500 ++++ Makefile 2007-05-21 15:17:21.000000000 -0500 +@@ -15,8 +15,8 @@ + # + CFLAGS += -DDEBUG + +-DESTDIR= +-PREFIX=$(HOME) ++DESTDIR?= ++PREFIX?=$(HOME) + BINDIR=$(PREFIX)/bin + LIBDIR=$(PREFIX)/lib + INCLUDEDIR=$(PREFIX)/include +@@ -48,15 +48,15 @@ + install -d $(DESTDIR)$(INCLUDEDIR)/sparse + install -d $(DESTDIR)$(PKGCONFIGDIR) + for f in $(INST_PROGRAMS); do \ +- install -v $$f $(DESTDIR)$(BINDIR)/$$f || exit 1; \ ++ install $$f $(DESTDIR)$(BINDIR)/$$f || exit 1; \ + done + for f in $(LIBS); do \ +- install -m 644 -v $$f $(DESTDIR)$(LIBDIR)/$$f || exit 1; \ ++ install -m 644 $$f $(DESTDIR)$(LIBDIR)/$$f || exit 1; \ + done + for f in $(LIB_H); do \ +- install -m 644 -v $$f $(DESTDIR)$(INCLUDEDIR)/sparse/$$f || exit 1; \ ++ install -m 644 $$f $(DESTDIR)$(INCLUDEDIR)/sparse/$$f || exit 1; \ + done +- install -m 644 -v sparse.pc $(DESTDIR)$(PKGCONFIGDIR)/sparse.pc ++ install -m 644 sparse.pc $(DESTDIR)$(PKGCONFIGDIR)/sparse.pc + + sparse.pc: sparse.pc.in + sed 's|@version@|$(VERSION)|g;s|@prefix@|$(PREFIX)|g;s|@libdir@|$(LIBDIR)|g;s|@includedir@|$(INCLUDEDIR)|g' sparse.pc.in > sparse.pc -- cgit v1.2.3