summaryrefslogtreecommitdiff
path: root/graphics/MesaLib
diff options
context:
space:
mode:
authorbjs <bjs>2008-04-25 20:11:11 +0000
committerbjs <bjs>2008-04-25 20:11:11 +0000
commit45cee7d4f097c7cefa7ebf91f760db77182db61d (patch)
tree78842ff03367e1d6eb0e1dfbf693c4f4e0437d8e /graphics/MesaLib
parentb2bc0bc18c0c94c92a1c0592853d4ef96234b803 (diff)
downloadpkgsrc-45cee7d4f097c7cefa7ebf91f760db77182db61d.tar.gz
Add some SUBST magic for NetBSD to change the name of the function
called in the x86/x86_64 assembler dispatch routine to __thr_getspecific to avoid an unresolved symbol error from ld at link-time. This is a weak alias in libc and a strong alias in libpthread, so everything should work fine. This could probably be fixed in a better way, but for now, I think "it works" is a plus. Bump rev.
Diffstat (limited to 'graphics/MesaLib')
-rw-r--r--graphics/MesaLib/Makefile3
-rw-r--r--graphics/MesaLib/hacks.mk18
2 files changed, 19 insertions, 2 deletions
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile
index 4231751cffd..b54c4a73a36 100644
--- a/graphics/MesaLib/Makefile
+++ b/graphics/MesaLib/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.57 2008/04/24 07:40:24 bjs Exp $
+# $NetBSD: Makefile,v 1.58 2008/04/25 20:11:11 bjs Exp $
PKGNAME= MesaLib-${MESA_PKGVERSION}
+PKGREVISION= 1
COMMENT= Graphics library similar to SGI's OpenGL
MESA_HEADERS= gl.h gl_mangle.h glext.h glx.h glxext.h \
diff --git a/graphics/MesaLib/hacks.mk b/graphics/MesaLib/hacks.mk
index 5800cbeae3a..9890ce9a0d4 100644
--- a/graphics/MesaLib/hacks.mk
+++ b/graphics/MesaLib/hacks.mk
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.5 2008/04/24 07:40:24 bjs Exp $
+# $NetBSD: hacks.mk,v 1.6 2008/04/25 20:11:11 bjs Exp $
.if !defined(MESALIBS_HACKS_MK)
MESALIBS_HACKS_MK= # defined
@@ -34,5 +34,21 @@ PKG_HACKS+= gcc-hidden-visibility
CFLAGS+= -fvisibility=hidden
. endif
. endif
+###
+### XXX this shoddy hack is here to fix the unresolved symbol error that
+### results due to '.extern pthread_getspecific' in the x86 and x86-64
+### assembler dispatch routines. This should be removed ASAP!
+###
+. include "../../mk/bsd.fast.prefs.mk"
+
+. if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*86*) && \
+ empty(PTHREAD_STUBLIB:U:M*pthstub*)
+SUBST_CLASSES+= asm-hack
+SUBST_FILES.asm-hack= src/mesa/x86/glapi_x86.S
+SUBST_FILES.asm-jack+= src/mesa/x86/glapi_x86-64.S
+SUBST_MESSAGE.asm-hack+=Teaching x86 assembler code about NetBSD thread stubs
+SUBST_SED.asm-hack= -e 's,pthread_getspecific,__libc_thr_getspecific,g'
+SUBST_STAGE.asm-hack= post-patch
+. endif
.endif