[Midnightbsd-cvs] mports: devel/libexecinfo: add libexecinfo

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Oct 19 02:11:22 EDT 2007


Log Message:
-----------
add libexecinfo

Added Files:
-----------
    mports/devel/libexecinfo:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-plist (r1.1)
    mports/devel/libexecinfo/files:
        patch-execinfo.c (r1.1)

-------------- next part --------------
--- /dev/null
+++ devel/libexecinfo/pkg-descr
@@ -0,0 +1,6 @@
+This is a quick-n-dirty BSD licensed clone of backtrace facility found
+in the GNU libc, mainly intended for porting linuxish code to BSD
+platforms, however it can be used at any platform which has a gcc
+compiler.
+
+WWW: http://www.gnu.org/software/libc/manual/html_node/Backtraces.html
--- /dev/null
+++ devel/libexecinfo/pkg-plist
@@ -0,0 +1,4 @@
+include/execinfo.h
+lib/libexecinfo.a
+lib/libexecinfo.so
+lib/libexecinfo.so.1
--- /dev/null
+++ devel/libexecinfo/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for:	libexecinfo
+# Date created:				10 August 2003
+# Whom:					Maxim Sobolev <sobomax at FreeBSD.org>
+#
+# $MidnightBSD: mports/devel/libexecinfo/Makefile,v 1.1 2007/10/19 06:11:20 laffer1 Exp $
+# $FreeBSD: ports/devel/libexecinfo/Makefile,v 1.7 2006/06/29 13:21:47 itetcu Exp $
+#
+
+PORTNAME=	libexecinfo
+PORTVERSION=	1.1
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR=	itetcu
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	A library for inspecting program's backtrace
+
+USE_BZIP2=	yes
+USE_LDCONFIG=	yes
+FAKE_MAKEARGS=	LIBDIR=${FAKE_DESTDIR}${PREFIX}/lib \
+		INCLUDEDIR=${FAKE_DESTDIR}${PREFIX}/include
+
+PORTDOCS=	README
+
+post-install:
+.if !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.endif
+
+.include <bsd.port.mk>
--- /dev/null
+++ devel/libexecinfo/distinfo
@@ -0,0 +1,3 @@
+MD5 (libexecinfo-1.1.tar.bz2) = 8e9e81c554c1c5d735bc877448e92b91
+SHA256 (libexecinfo-1.1.tar.bz2) = c9a21913e7fdac8ef6b33250b167aa1fc0a7b8a175145e26913a4c19d8a59b1f
+SIZE (libexecinfo-1.1.tar.bz2) = 4841
--- /dev/null
+++ devel/libexecinfo/files/patch-execinfo.c
@@ -0,0 +1,45 @@
+--- execinfo.c.orig	Sun Jul 18 22:21:09 2004
++++ execinfo.c	Wed Feb  9 16:56:51 2005
+@@ -78,7 +78,6 @@
+     rval = malloc(clen);
+     if (rval == NULL)
+         return NULL;
+-    (char **)cp = &(rval[size]);
+     for (i = 0; i < size; i++) {
+         if (dladdr(buffer[i], &info) != 0) {
+             if (info.dli_sname == NULL)
+@@ -92,14 +91,14 @@
+                    2 +                      /* " <" */
+                    strlen(info.dli_sname) + /* "function" */
+                    1 +                      /* "+" */
+-                   D10(offset) +            /* "offset */
++                   10 +                     /* "offset */
+                    5 +                      /* "> at " */
+                    strlen(info.dli_fname) + /* "filename" */
+                    1;                       /* "\0" */
+             rval = realloc_safe(rval, clen + alen);
+             if (rval == NULL)
+                 return NULL;
+-            snprintf(cp, alen, "%p <%s+%d> at %s",
++            snprintf((char *) rval + clen, alen, "%p <%s+%d> at %s",
+               buffer[i], info.dli_sname, offset, info.dli_fname);
+         } else {
+             alen = 2 +                      /* "0x" */
+@@ -108,11 +107,14 @@
+             rval = realloc_safe(rval, clen + alen);
+             if (rval == NULL)
+                 return NULL;
+-            snprintf(cp, alen, "%p", buffer[i]);
++            snprintf((char *) rval + clen, alen, "%p", buffer[i]);
+         }
+-        rval[i] = cp;
+-        cp += alen;
++        rval[i] = (char *) clen;
++        clen += alen;
+     }
++
++    for (i = 0; i < size; i++)
++        rval[i] += (int) rval;
+ 
+     return rval;
+ }


More information about the Midnightbsd-cvs mailing list