summaryrefslogtreecommitdiff
path: root/devel/libexecinfo
diff options
context:
space:
mode:
authorasau <asau>2013-03-14 22:27:15 +0000
committerasau <asau>2013-03-14 22:27:15 +0000
commit6fd84874cae4abd07586fc02414ec2fa03e625e0 (patch)
treecf1c326f2ab32d7e998b03f2427b9d77181323c4 /devel/libexecinfo
parent85435056ca4a294034b3ba99a2f3984bb2f2d11f (diff)
downloadpkgsrc-6fd84874cae4abd07586fc02414ec2fa03e625e0.tar.gz
Import libexecinfo 1.1 as devel/libexecinfo
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.
Diffstat (limited to 'devel/libexecinfo')
-rw-r--r--devel/libexecinfo/DESCR4
-rw-r--r--devel/libexecinfo/Makefile24
-rw-r--r--devel/libexecinfo/PLIST7
-rw-r--r--devel/libexecinfo/buildlink3.mk13
-rw-r--r--devel/libexecinfo/distinfo6
-rw-r--r--devel/libexecinfo/patches/patch-execinfo.c60
6 files changed, 114 insertions, 0 deletions
diff --git a/devel/libexecinfo/DESCR b/devel/libexecinfo/DESCR
new file mode 100644
index 00000000000..123920dfc38
--- /dev/null
+++ b/devel/libexecinfo/DESCR
@@ -0,0 +1,4 @@
+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.
diff --git a/devel/libexecinfo/Makefile b/devel/libexecinfo/Makefile
new file mode 100644
index 00000000000..a5622c98421
--- /dev/null
+++ b/devel/libexecinfo/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1.1.1 2013/03/14 22:27:15 asau Exp $
+
+DISTNAME= libexecinfo-1.1
+CATEGORIES= devel
+MASTER_SITES= $(MASTER_SITE_FREEBSD)
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= ober@NetBSD.org
+HOMEPAGE= http://www.freebsdsoftware.org/devel/libexecinfo.html
+COMMENT= BSD Licensed clone of backtrace facility found in GNU libc
+LICENSE= 2-clause-bsd
+
+USE_BSD_MAKEFILE= yes
+MAKE_FLAGS+= MKLINT=no
+
+CFLAGS.Linux+= -D_GNU_SOURCE # Dl_info internals
+CFLAGS.Linux+= -Wno-unused-result # write(2) is declared specially
+
+INSTALLATION_DIRS= include lib
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/execinfo.h ${DESTDIR}${PREFIX}/include
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/libexecinfo/PLIST b/devel/libexecinfo/PLIST
new file mode 100644
index 00000000000..40c8f3719fe
--- /dev/null
+++ b/devel/libexecinfo/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2013/03/14 22:27:15 asau Exp $
+include/execinfo.h
+lib/libexecinfo.a
+lib/libexecinfo.so
+lib/libexecinfo.so.1
+lib/libexecinfo.so.1.0
+lib/libexecinfo_pic.a
diff --git a/devel/libexecinfo/buildlink3.mk b/devel/libexecinfo/buildlink3.mk
new file mode 100644
index 00000000000..624ed79eb43
--- /dev/null
+++ b/devel/libexecinfo/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2013/03/14 22:27:15 asau Exp $
+
+BUILDLINK_TREE+= libexecinfo
+
+.if !defined(LIBEXECINFO_BUILDLINK3_MK)
+LIBEXECINFO_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libexecinfo+= libexecinfo>=1.1
+BUILDLINK_ABI_DEPENDS.libexecinfo+= libexecinfo>=1.1
+BUILDLINK_PKGSRCDIR.libexecinfo?= ../../devel/libexecinfo
+.endif # LIBEXECINFO_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -libexecinfo
diff --git a/devel/libexecinfo/distinfo b/devel/libexecinfo/distinfo
new file mode 100644
index 00000000000..5aa51a77358
--- /dev/null
+++ b/devel/libexecinfo/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2013/03/14 22:27:15 asau Exp $
+
+SHA1 (libexecinfo-1.1.tar.bz2) = a2330eae993880850a90ccfdc389a89cdd7f95ab
+RMD160 (libexecinfo-1.1.tar.bz2) = b2227d4095be0002185b667b9fde71cd876a4ed7
+Size (libexecinfo-1.1.tar.bz2) = 4841 bytes
+SHA1 (patch-execinfo.c) = 01a2337029c623f6e2385c74ca9f7f2a34569356
diff --git a/devel/libexecinfo/patches/patch-execinfo.c b/devel/libexecinfo/patches/patch-execinfo.c
new file mode 100644
index 00000000000..098b8b33e0e
--- /dev/null
+++ b/devel/libexecinfo/patches/patch-execinfo.c
@@ -0,0 +1,60 @@
+$NetBSD: patch-execinfo.c,v 1.1.1.1 2013/03/14 22:27:15 asau Exp $
+
+Patch from FreeBSD ports devel/libexecinfo. Makes execinfo.c compilable
+
+--- execinfo.c.orig
++++ execinfo.c
+@@ -69,7 +69,8 @@
+ char **
+ backtrace_symbols(void *const *buffer, int size)
+ {
+- int i, clen, alen, offset;
++ size_t clen, alen;
++ int i, offset;
+ char **rval;
+ char *cp;
+ Dl_info info;
+@@ -78,7 +79,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 +92,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,12 +108,15 @@
+ 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] += (long) rval;
++
+ return rval;
+ }
+