summaryrefslogtreecommitdiff
path: root/development/cppcheck
diff options
context:
space:
mode:
Diffstat (limited to 'development/cppcheck')
-rw-r--r--development/cppcheck/README13
-rw-r--r--development/cppcheck/cppcheck.SlackBuild91
-rw-r--r--development/cppcheck/cppcheck.info10
-rw-r--r--development/cppcheck/slack-desc19
4 files changed, 133 insertions, 0 deletions
diff --git a/development/cppcheck/README b/development/cppcheck/README
new file mode 100644
index 0000000000..634a18c7a5
--- /dev/null
+++ b/development/cppcheck/README
@@ -0,0 +1,13 @@
+Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many
+other analysis tools, we don't detect syntax errors. Cppcheck only detects
+the types of bugs that the compilers normally fail to detect. The goal is to
+have no false positives.
+
+To supplement Cppcheck, it is recommended that you enable as many compiler
+warnings as possible. For the GCC compiler, take a look at
+http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html for a comprehensive
+list of warning options that GCC supports. At a minimum, it is recommended
+that you enable -Wall, -Wextra, and -pedantic
+
+If you do not want to install the manual pages, you can run the build script
+like this: MAKEMAN=no ./cppcheck.SlackBuild
diff --git a/development/cppcheck/cppcheck.SlackBuild b/development/cppcheck/cppcheck.SlackBuild
new file mode 100644
index 0000000000..175ab44941
--- /dev/null
+++ b/development/cppcheck/cppcheck.SlackBuild
@@ -0,0 +1,91 @@
+#!/bin/sh -e
+
+# Slackware build script for cgdb
+
+# Copyright 2009-2010 Sean Donner (sean.donner@gmail.com)
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=cppcheck
+VERSION=${VERSION:-1.39}
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+MAKEMAN=${MAKEMAN:-yes}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown root:root . -R
+
+make \
+ CFLAGS="$SLKCFLAGS -Wall -Wextra -pedantic -DNDEBUG" \
+ CXXFLAGS="$SLKCFLAGS -Wall -Wextra -pedantic -DNDEBUG"
+make install DESTDIR=$PKG
+
+if [ x"$MAKEMAN" == "xyes" ]; then
+ xsltproc \
+ --nonet \
+ --param man.charmap.use.subset "0" \
+ --param make.year.ranges "1" \
+ --param make.single.year.ranges "1" \
+ --output man/ \
+ /etc/asciidoc/docbook-xsl/manpage.xsl \
+ man/$PRGNAM.1.xml
+ mkdir -p $PKG/usr/man/man1
+ gzip -9c man/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+fi
+
+( cd $PKG
+ find . -exec file {} + | sed -n '/ELF.*executable\|shared object/s/:.*$//p' | \
+ xargs strip --strip-unneeded 2> /dev/null || true
+ find . -exec file {} + | sed -n '/current ar archive/s/:.*$//p' | \
+ xargs strip --strip-debug 2> /dev/null || true
+)
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING Changelog $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+find . -perm /111 -exec chmod 755 {} + -o -perm /444 ! -perm /111 -exec chmod 644 {} +
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/development/cppcheck/cppcheck.info b/development/cppcheck/cppcheck.info
new file mode 100644
index 0000000000..14f2c9e390
--- /dev/null
+++ b/development/cppcheck/cppcheck.info
@@ -0,0 +1,10 @@
+PRGNAM="cppcheck"
+VERSION="1.38"
+HOMEPAGE="http://cppcheck.wiki.sourceforge.net"
+DOWNLOAD="http://downloads.sourceforge.net/project/cppcheck/cppcheck/1.39/cppcheck-1.39.tar.gz"
+MD5SUM="d59b76739189a18b5e839729676abf6c"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Sean Donner"
+EMAIL="sean.donner@gmail.com"
+APPROVED="rworkman"
diff --git a/development/cppcheck/slack-desc b/development/cppcheck/slack-desc
new file mode 100644
index 0000000000..2a0197ce1a
--- /dev/null
+++ b/development/cppcheck/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+cppcheck: Cppcheck (A tool for static C/C++ code analysis)
+cppcheck:
+cppcheck: Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers
+cppcheck: and many other analysis tools, we don't detect syntax errors. Cppcheck
+cppcheck: only detects the types of bugs that the compilers normally fail to
+cppcheck: detect. The goal is no false positives.
+cppcheck:
+cppcheck:
+cppcheck:
+cppcheck:
+cppcheck: