1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

port of ccmalloc

This is port of ccmalloc, memory leak detector for C/C++.

PR:		ports/36336
Submitted by:	Jure Menart <jure@kom.org>
This commit is contained in:
Edwin Groothuis 2003-04-05 12:47:13 +00:00
parent 8308b5b197
commit 83a45c624c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=78300
9 changed files with 175 additions and 0 deletions

View File

@ -87,6 +87,7 @@
SUBDIR += ccache
SUBDIR += cccc
SUBDIR += ccdoc
SUBDIR += ccmalloc
SUBDIR += cdecl
SUBDIR += cdialog
SUBDIR += cdk

29
devel/ccmalloc/Makefile Normal file
View File

@ -0,0 +1,29 @@
# New ports collection makefile for: oaf
# Date created: 1st June 2000
# Whom: Ade Lovett <ade@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= ccmalloc
PORTVERSION= 0.3.9
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://www.inf.ethz.ch/personal/biere/projects/ccmalloc/
MAINTAINER= jure@kom.org
COMMENT= C/C++ memory profiler and memory leak tracer
USE_PERL5= yes
USE_GMAKE= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --prefix=${PREFIX}
CC= gcc -g -Wall
CXX= g++
post-install:
@${CAT} pkg-message
.include <bsd.port.mk>

1
devel/ccmalloc/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (ccmalloc-0.3.9.tar.gz) = 9ba598edf3b21acc6a7a6196944f5af7

View File

@ -0,0 +1,18 @@
--- Makefile.in.orig Wed Jan 30 15:27:10 2002
+++ Makefile.in Mon Mar 18 17:39:49 2002
@@ -3,6 +3,7 @@
COMPILERS=@COMPILERS@
TARGETS=lib/libccmalloc.a @TARGETS@ bin/ccmalloc
PREFIX=@PREFIX@
+OPSYS=@OPSYS@
#--------------------------------------------------------------------------#
@@ -43,6 +44,7 @@
-e 's,@''PREFIX@,$(PREFIX),g' \
-e 's,@''COMPILERS@,"$(COMPILERS)",g' \
-e 's,@''VERSION@,@VERSION@,g' \
+ -e 's,@''OPSYS@,@OPSYS@,g' \
src/ccmalloc.in > $@
chmod 755 $@

View File

@ -0,0 +1,82 @@
--- configure.orig Wed Feb 6 01:20:53 2002
+++ configure Sat Apr 5 04:43:02 2003
@@ -27,7 +27,8 @@
fmt="%-26s ..."
debug=no
prefix=/usr/local
-os=unsupported
+
+OPSYS=unsupported
#--------------------------------------------------------------------------#
# process command line options
@@ -40,7 +41,7 @@
exit 0
;;
--prefix=*)
- prefix=`expr $1 : '--prefix=\(.*\)'`
+ prefix=`expr -- $1 : '--prefix=\(.*\)'`
;;
--debug)
debug=yes
@@ -70,26 +71,26 @@
SunOS )
case `uname -r` in
5.* )
- os=solaris
+ OPSYS=solaris
;;
esac
;;
Linux )
- os=linux
+ OPSYS=linux
;;
FreeBSD )
- os=freebsd
+ OPSYS=freebsd
;;
esac
-if [ $os = unsupported ]
+if [ $OPSYS = unsupported ]
then
echo
echo "*** configure: unsupported operating system" 1>&2
exit 1
fi
-echo " $os"
+echo " $OPSYS"
#--------------------------------------------------------------------------#
# search for C compilers
@@ -205,7 +206,7 @@
}
EOF
-case $os in
+case $OPSYS in
freebsd )
LIB=""
;;
@@ -285,8 +286,9 @@
(
echo "#ifndef _config_h_INCLUDED"
[ $debug = no ] && echo "#define NDEBUG"
-[ $os = solaris ] && echo "#define OS_IS_SOLARIS"
-[ $os = linux ] && echo "#define OS_IS_LINUX"
+[ $OPSYS = solaris ] && echo "#define OS_IS_SOLARIS"
+[ $OPSYS = linux ] && echo "#define OS_IS_LINUX"
+[ $OPSYS = freebsd ] && echo "#define OS_IS_FREEBSD"
[ $atexit = yes ] && echo "#define HAVE_ATEXIT"
cat<<-EOF
#define VERSION "$version"
@@ -319,6 +321,7 @@
-e "s,@COMPILERS@,$COMPILERS,g" \
-e "s,@VERSION@,$version,g" \
-e "s,@TARGETS@,$TARGETS,g" \
+-e "s,@OPSYS@,$OPSYS,g" \
Makefile.in > $dst
echo >> $dst

View File

@ -0,0 +1,29 @@
--- src/ccmalloc.in.orig Wed Jan 30 06:23:55 2002
+++ src/ccmalloc.in Sat Apr 5 02:05:19 2003
@@ -9,6 +9,13 @@
#
COMPILERS=@COMPILERS@
PREFIX=@PREFIX@
+OPSYS=@OPSYS@
+
+case $OPSYS in
+ linux | solaris) COMP_ARGS='-lccmalloc -ldl';;
+ freebsd ) COMP_ARGS='-lccmalloc';;
+ *) COMP_ARGS='-lccmalloc -ldl';;
+esac
usage () {
echo \
@@ -104,10 +111,10 @@
then
wrapper="$PREFIX/lib/ccmalloc-$CC.o"
echo "ccmalloc: using '$wrapper' as C++ wrapper"
- cmd="$args $wrapper -L$PREFIX/lib -lccmalloc -ldl"
+ cmd="$args $wrapper -L$PREFIX/lib $COMP_ARGS"
else
echo "ccmalloc: no C++ wrapper for '$base' installed"
- cmd="$args -L$PREFIX/lib -lccmalloc -ldl"
+ cmd="$args -L$PREFIX/lib $COMP_ARGS"
fi
echo $cmd

4
devel/ccmalloc/pkg-descr Normal file
View File

@ -0,0 +1,4 @@
CCMalloc can help you track down memory related problems with C/C++
programs.
WWW: http://www.inf.ethz.ch/personal/biere/projects/ccmalloc/

View File

@ -0,0 +1,6 @@
Please take a look at sample configuration file:
/usr/local/share/ccmalloc/ccmalloc.cfg
You should edit it and copy it to: ~/.ccmalloc

5
devel/ccmalloc/pkg-plist Normal file
View File

@ -0,0 +1,5 @@
bin/ccmalloc
lib/libccmalloc.a
lib/ccmalloc-g++.o
share/ccmalloc/ccmalloc.cfg
@dirrm share/ccmalloc