summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2009-11-27 12:55:41 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2009-11-27 12:55:41 +0800
commit12433c7c4f3a0283ab5320fe43a92f6af177d37e (patch)
treec607da358545cea6a4d67a3e05034b1cd0c329d4 /devel
parent569251449283294d8166999236825df336bb6e33 (diff)
downloadmarcuscom-ports-12433c7c4f3a0283ab5320fe43a92f6af177d37e.tar.gz
marcuscom-ports-12433c7c4f3a0283ab5320fe43a92f6af177d37e.tar.zst
marcuscom-ports-12433c7c4f3a0283ab5320fe43a92f6af177d37e.zip
Add ${PTHREAD_LIBS} to LDFLAGS for all modern versions of FreeBSD.
This is a hack, but it's required to fix a crash in applications which link to this library and use pthread_condattr_{init,destroy}. Ideally, those symbols need to be added to libc. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13255 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel')
-rw-r--r--devel/libpthread-stubs/Makefile35
-rw-r--r--devel/libpthread-stubs/distinfo3
-rw-r--r--devel/libpthread-stubs/files/patch-Makefile.in28
-rw-r--r--devel/libpthread-stubs/files/patch-configure-libs11
-rw-r--r--devel/libpthread-stubs/files/patch-configure-objformat21
-rw-r--r--devel/libpthread-stubs/pkg-descr11
-rw-r--r--devel/libpthread-stubs/pkg-plist5
7 files changed, 114 insertions, 0 deletions
diff --git a/devel/libpthread-stubs/Makefile b/devel/libpthread-stubs/Makefile
new file mode 100644
index 000000000..8427ff738
--- /dev/null
+++ b/devel/libpthread-stubs/Makefile
@@ -0,0 +1,35 @@
+# New ports collection makefile for: libpthread-stubs
+# Date created: 24 January 2007
+# Whom: wahjava
+#
+# $FreeBSD$
+#
+
+PORTNAME= libpthread-stubs
+PORTVERSION= 0.3
+PORTREVISION= 1
+CATEGORIES= devel
+MASTER_SITES= http://xcb.freedesktop.org/dist/
+
+MAINTAINER= wahjava@gmail.com
+COMMENT= This library provides weak aliases for pthread functions
+
+USE_GMAKE= yes
+USE_BZIP2= yes
+USE_GNOME= gnomehack pkgconfig
+USE_LDCONFIG= yes
+
+GNU_CONFIGURE= yes
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 700000
+CONFIGURE_ENV+= LDFLAGS=-lpthread
+.else
+# XXX This is a hack to fix a problem where pthread_condattr_{init,destroy}
+# are not found leading to crashes.
+# When the stubs are added to libc, this hack can be removed.
+CONFIGURE_ENV+= LDFLAGS=${PTHREAD_FLAGS}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/libpthread-stubs/distinfo b/devel/libpthread-stubs/distinfo
new file mode 100644
index 000000000..963274463
--- /dev/null
+++ b/devel/libpthread-stubs/distinfo
@@ -0,0 +1,3 @@
+MD5 (libpthread-stubs-0.3.tar.bz2) = e8fa31b42e13f87e8f5a7a2b731db7ee
+SHA256 (libpthread-stubs-0.3.tar.bz2) = 35b6d54e3cc6f3ba28061da81af64b9a92b7b757319098172488a660e3d87299
+SIZE (libpthread-stubs-0.3.tar.bz2) = 203468
diff --git a/devel/libpthread-stubs/files/patch-Makefile.in b/devel/libpthread-stubs/files/patch-Makefile.in
new file mode 100644
index 000000000..4bfc2a9a8
--- /dev/null
+++ b/devel/libpthread-stubs/files/patch-Makefile.in
@@ -0,0 +1,28 @@
+
+$FreeBSD: ports/devel/libpthread-stubs/files/patch-Makefile.in,v 1.2 2009/11/05 20:16:01 miwi Exp $
+
+--- Makefile.in.orig
++++ Makefile.in
+@@ -75,9 +75,9 @@
+ LTLIBRARIES = $(lib_LTLIBRARIES)
+ libpthread_stubs_la_LIBADD =
+ am__libpthread_stubs_la_SOURCES_DIST = stubs.c
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_OBJECTS = stubs.lo
++am_libpthread_stubs_la_OBJECTS = stubs.lo
+ libpthread_stubs_la_OBJECTS = $(am_libpthread_stubs_la_OBJECTS)
+-@BUILD_LIB_TRUE@am_libpthread_stubs_la_rpath = -rpath $(libdir)
++am_libpthread_stubs_la_rpath = -rpath $(libdir)
+ DEFAULT_INCLUDES = -I.@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+@@ -221,8 +221,8 @@
+ top_srcdir = @top_srcdir@
+ pkgconfigdir = $(prefix)/libdata/pkgconfig
+ pkgconfig_DATA = pthread-stubs.pc
+-@BUILD_LIB_TRUE@lib_LTLIBRARIES = libpthread-stubs.la
+-@BUILD_LIB_TRUE@libpthread_stubs_la_SOURCES = stubs.c
++lib_LTLIBRARIES = libpthread-stubs.la
++libpthread_stubs_la_SOURCES = stubs.c
+ all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
diff --git a/devel/libpthread-stubs/files/patch-configure-libs b/devel/libpthread-stubs/files/patch-configure-libs
new file mode 100644
index 000000000..91c919993
--- /dev/null
+++ b/devel/libpthread-stubs/files/patch-configure-libs
@@ -0,0 +1,11 @@
+--- configure.orig Wed Jan 24 17:10:44 2007
++++ configure Wed Jan 24 17:11:08 2007
+@@ -20705,7 +20705,7 @@
+ _ACEOF
+
+ else
+- PKG_CONFIG_LIBS='-L${libdir} -pthread-stubs'
++ PKG_CONFIG_LIBS='-L${libdir} -lpthread-stubs'
+ fi
+ done
+
diff --git a/devel/libpthread-stubs/files/patch-configure-objformat b/devel/libpthread-stubs/files/patch-configure-objformat
new file mode 100644
index 000000000..00a2029e6
--- /dev/null
+++ b/devel/libpthread-stubs/files/patch-configure-objformat
@@ -0,0 +1,21 @@
+--- configure.old Fri Feb 2 12:45:00 2007
++++ configure Fri Feb 2 12:45:41 2007
+@@ -9008,14 +9008,10 @@
+ freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+- if test -x /usr/bin/objformat; then
+- objformat=`/usr/bin/objformat`
+- else
+- case $host_os in
+- freebsd[123]*) objformat=aout ;;
+- *) objformat=elf ;;
+- esac
+- fi
++ case $host_os in
++ freebsd[123]*) objformat=aout ;;
++ *) objformat=elf ;;
++ esac
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
diff --git a/devel/libpthread-stubs/pkg-descr b/devel/libpthread-stubs/pkg-descr
new file mode 100644
index 000000000..5669418fe
--- /dev/null
+++ b/devel/libpthread-stubs/pkg-descr
@@ -0,0 +1,11 @@
+This library provides weak aliases for pthread functions not provided in libc
+or otherwise available by default. Libraries like libxcb rely on pthread
+stubs to use pthreads optionally, becoming thread-safe when linked to
+libpthread, while avoiding any performance hit when running single-threaded.
+libpthread-stubs supports this behavior even on platforms which do not supply
+all the necessary pthread stubs. On platforms which already supply all the
+necessary pthread stubs, this package ships only the pkg-config file
+pthread-stubs.pc, to allow libraries to unconditionally express a dependency
+on pthread-stubs and still obtain correct behavior.
+
+WWW: http://xcb.freedesktop.org/
diff --git a/devel/libpthread-stubs/pkg-plist b/devel/libpthread-stubs/pkg-plist
new file mode 100644
index 000000000..4738179c9
--- /dev/null
+++ b/devel/libpthread-stubs/pkg-plist
@@ -0,0 +1,5 @@
+lib/libpthread-stubs.a
+lib/libpthread-stubs.la
+lib/libpthread-stubs.so
+lib/libpthread-stubs.so.0
+libdata/pkgconfig/pthread-stubs.pc