diff options
author | Jason Evans <jasone@FreeBSD.org> | 2008-08-14 18:46:25 +0000 |
---|---|---|
committer | Jason Evans <jasone@FreeBSD.org> | 2008-08-14 18:46:25 +0000 |
commit | c7688c2a1bfbe48bf170e30cad5b97add51e2acf (patch) | |
tree | ced3b0a56987a6052312bbc64bfabd5f7a797b17 /devel/ptmalloc | |
parent | a30666669da67cedef344b2c74dff7eceb3e1cdf (diff) | |
download | ports-c7688c2a1bfbe48bf170e30cad5b97add51e2acf.tar.gz ports-c7688c2a1bfbe48bf170e30cad5b97add51e2acf.zip |
Notes
Diffstat (limited to 'devel/ptmalloc')
-rw-r--r-- | devel/ptmalloc/Makefile | 22 | ||||
-rw-r--r-- | devel/ptmalloc/distinfo | 6 | ||||
-rw-r--r-- | devel/ptmalloc/files/patch-Makefile | 87 | ||||
-rw-r--r-- | devel/ptmalloc/pkg-descr | 16 | ||||
-rw-r--r-- | devel/ptmalloc/pkg-plist | 2 |
5 files changed, 60 insertions, 73 deletions
diff --git a/devel/ptmalloc/Makefile b/devel/ptmalloc/Makefile index 85705061295a..835a8f2cd790 100644 --- a/devel/ptmalloc/Makefile +++ b/devel/ptmalloc/Makefile @@ -6,25 +6,31 @@ # $FreeBSD$ PORTNAME= ptmalloc -PORTVERSION= 1.0 -PORTREVISION= 1 +PORTVERSION= 2.0 CATEGORIES= devel MASTER_SITES= http://www.malloc.de/malloc/ -DISTNAME= ptmalloc +DISTNAME= ${PORTNAME}2-current MAINTAINER= ports@FreeBSD.org -COMMENT= Alternative malloc, performs better with threaded applications +COMMENT= Alternative threads-aware malloc +USE_GMAKE= yes +USE_LD_CONFIG= yes +WRKSRC= ${WRKDIR}/${PORTNAME}2 INCDIR= include/${PORTNAME} PLIST_SUB= INCDIR=${INCDIR} +post-patch: + @${REINPLACE_CMD} -e 's+-pthread+${PTHREAD_LIBS}+g ;' \ + ${WRKSRC}/Makefile + do-install: all ${MKDIR} ${PREFIX}/${INCDIR} - ${INSTALL_DATA} ${WRKSRC}/ptmalloc.h ${PREFIX}/${INCDIR}/malloc.h - ${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so.1 - ${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so - ${INSTALL_PROGRAM} ${WRKSRC}/libptmalloc.a ${PREFIX}/lib/libptmalloc.a + ${INSTALL_DATA} ${WRKSRC}/malloc.h ${PREFIX}/${INCDIR}/ + ${INSTALL_PROGRAM} ${WRKSRC}/malloc.so ${PREFIX}/lib/libptmalloc.so.2 + ${LN} -s ${PREFIX}/lib/ptmalloc.so.2 ${PREFIX}/lib/libptmalloc.so + ${INSTALL_PROGRAM} ${WRKSRC}/libmalloc.a ${PREFIX}/lib/libptmalloc.a post-install: @${ECHO_CMD} diff --git a/devel/ptmalloc/distinfo b/devel/ptmalloc/distinfo index c0e4754271fd..fa039102d4d0 100644 --- a/devel/ptmalloc/distinfo +++ b/devel/ptmalloc/distinfo @@ -1,3 +1,3 @@ -MD5 (ptmalloc.tar.gz) = 10b3fce4711eeada16726fd5e218309b -SHA256 (ptmalloc.tar.gz) = 806761559619e37ee78477682dd4b38b861c173c4a7167c753ac6d1799a1af3d -SIZE (ptmalloc.tar.gz) = 55961 +MD5 (ptmalloc2-current.tar.gz) = 3db9e72c01ce55da006cdc56b966d7fa +SHA256 (ptmalloc2-current.tar.gz) = 46a5691b19557fde3c3b97c3d86649a40cf5a2a1f4129c37b360907dd1fbdd5a +SIZE (ptmalloc2-current.tar.gz) = 78594 diff --git a/devel/ptmalloc/files/patch-Makefile b/devel/ptmalloc/files/patch-Makefile index 0db580441b50..9b1015c3ef4e 100644 --- a/devel/ptmalloc/files/patch-Makefile +++ b/devel/ptmalloc/files/patch-Makefile @@ -1,57 +1,52 @@ ---- Makefile.orig Mon Dec 20 21:58:38 1999 -+++ Makefile Tue Dec 14 13:22:01 2004 -@@ -10,7 +10,7 @@ - - OPT_FLAGS = -O #-g - WARN_FLAGS = # -Wall --SH_FLAGS = -shared -+SH_FLAGS = -shared -fpic - - # Flags for the test programs - T_FLAGS = -DUSE_MALLOC=1 -DMALLOC_HOOKS -DTEST=1 -@@ -27,6 +27,9 @@ - THR_FLAGS = -DUSE_PTHREADS=1 -DUSE_TSD_DATA_HACK -D_REENTRANT +--- Makefile.orig 2006-06-05 06:13:57.000000000 -0500 ++++ Makefile 2008-06-17 20:56:10.000000000 -0500 +@@ -15,12 +15,12 @@ + TAR_FLAGS = --numeric-owner --exclude "*~" --exclude "debian/tmp*" + + #CC = /pkg/gcc-2.95.2-wg/bin/gcc +-CC = cc ++CC ?= cc + + SYS_FLAGS = +-OPT_FLAGS = -g -O # -O2 ++OPT_FLAGS = -O2 # -O2 + WARN_FLAGS = #-Wall -Wstrict-prototypes +-SH_FLAGS = -shared -fpic ++SH_FLAGS = -shared -fPIC + + INC_FLAGS = -Isysdeps/generic + +@@ -35,6 +35,9 @@ + THR_FLAGS = -DUSE_TSD_DATA_HACK -D_REENTRANT THR_LIBS = -lpthread +# Target libraries -+LIBS= libptmalloc.a ptmalloc.so ++LIBS= libmalloc.a malloc.so + RM = rm -f + AR = ar + RANLIB = ranlib +@@ -46,12 +49,12 @@ + TESTS = t-test1$(T_SUF) t-test2$(T_SUF) \ + tst-mallocstate$(T_SUF) tst-mstats$(T_SUF) + +-CFLAGS = $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS) ++CFLAGS += $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS) - # Don't need it for the Linux C library 6, see `glibc' target below. -@@ -40,7 +43,9 @@ .c.o: $(CC) -c $(CFLAGS) $< --all: $(TESTS) -+all: ${LIBS} -+ -+tests: $(TESTS) - - shared: ptmalloc.so +-all: $(LIB_MALLOC) $(TESTS) ++all: $(LIBS) $(TESTS) -@@ -48,14 +53,14 @@ + malloc.o: malloc.c malloc.h $(CC) -c $(CFLAGS) $(M_FLAGS) $< - - ptmalloc.so: ptmalloc.c ptmalloc.h thread-m.h -- $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) $< -o $@ -+ $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) ptmalloc.c -o $@ - - again: - $(RM) $(TESTS) - $(MAKE) $(TESTS) - - clean: -- $(RM) ptmalloc.o ptmalloc.so $(TESTS) core -+ $(RM) ptmalloc.o ptmalloc.so $(TESTS) core lib* - - t-test1$(T_SUF): t-test1.c t-test.h thread-m.h $(MALLOC) - $(CC) $(CFLAGS) $(T_FLAGS) t-test1.c $(MALLOC) $(THR_LIBS) -o $@ -@@ -129,3 +134,7 @@ - dist: - cd ..; tar cf - $(DIST_FILES2:%=ptmalloc/%) | \ - gzip -9 >ptmalloc.tar.gz -+ -+libptmalloc.a: ptmalloc.o -+ ar qcvf $@ ptmalloc.o -+ ranlib $@ +@@ -102,7 +105,7 @@ + posix: + $(MAKE) THR_FLAGS='-DUSE_TSD_DATA_HACK -D_REENTRANT' \ + OPT_FLAGS='$(OPT_FLAGS)' SYS_FLAGS='$(SYS_FLAGS)' CC='$(CC)' \ +- INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' ++ INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' \ + THR_LIBS=-lpthread + + # posix threads with explicit initialization. Known to be needed on HPUX. diff --git a/devel/ptmalloc/pkg-descr b/devel/ptmalloc/pkg-descr index 6123835295fb..4d685884c521 100644 --- a/devel/ptmalloc/pkg-descr +++ b/devel/ptmalloc/pkg-descr @@ -1,7 +1,5 @@ ptmalloc is the original version of the malloc that was later included -in GNU libc. Under some circumstances, notably with pthreads and -excessive calls to realloc, it performs significantly better than -FreeBSD malloc. This version is *not* GPL or LGPL: +in GNU libc. This version is *not* GPL or LGPL: Copyright (c) 1999 Wolfram Gloger @@ -24,8 +22,6 @@ FreeBSD malloc. This version is *not* GPL or LGPL: PERFORMANCE OF THIS SOFTWARE. This is not the latest version: it's older than the one in GNU libc. -There is a newer version, but it's still marked as "current snapshot". -It's in /usr/ports/devel/ptmalloc-2/. This package comes with no documentation beyond a README, which isn't worth installing. It appears that the GNU libc man page malloc(3) @@ -33,14 +29,4 @@ applies, but it's not included here for copyright reasons. There's nothing unusual about it. In particular, the section TUNING in FreeBSD malloc(3) does not apply. -This library uses the POSIX pthread_atfork() function which was not -committed to -CURRENT until 10 December 2004. See PR bin/68841 for -further details. To build it on older versions, first install this -patch, which should be transparent. - -In addition to the library, the package contains a couple of test -cases. Theoretically they could be run using the FreeBSD libraries, -but they call the legacy memalign() function, which is not provided by -FreeBSD. It may be of interest to fix this issue. - WWW: http://www.malloc.de/en/ diff --git a/devel/ptmalloc/pkg-plist b/devel/ptmalloc/pkg-plist index bf930b1eeb59..8ce2085a2fcf 100644 --- a/devel/ptmalloc/pkg-plist +++ b/devel/ptmalloc/pkg-plist @@ -1,5 +1,5 @@ %%INCDIR%%/malloc.h lib/libptmalloc.a lib/libptmalloc.so -lib/libptmalloc.so.1 +lib/libptmalloc.so.2 @dirrm %%INCDIR%% |