Tue Jun 24 18:55:44 2008 UTC ()
We want to use -fvisibility=hidden _unless_ we're building graphics/glut,
not the other way around.

 - This is the way that mesa expects things to be.
 - Not doing this for MesaLib (at least for dri on NetBSD/amd64) will result
   in reloc-related errors at link-time.

Building on NetBSD/amd64 was broken without this.


(bjs)
diff -r1.9 -r1.10 pkgsrc/graphics/MesaLib/hacks.mk

cvs diff -r1.9 -r1.10 pkgsrc/graphics/MesaLib/Attic/hacks.mk (expand / switch to unified diff)

--- pkgsrc/graphics/MesaLib/Attic/hacks.mk 2008/06/05 13:03:41 1.9
+++ pkgsrc/graphics/MesaLib/Attic/hacks.mk 2008/06/24 18:55:44 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: hacks.mk,v 1.9 2008/06/05 13:03:41 tron Exp $ 1# $NetBSD: hacks.mk,v 1.10 2008/06/24 18:55:44 bjs Exp $
2 2
3.if !defined(MESALIBS_HACKS_MK) 3.if !defined(MESALIBS_HACKS_MK)
4MESALIBS_HACKS_MK= # defined 4MESALIBS_HACKS_MK= # defined
5 5
6### [Fri Dec 30 21:00:59 CET 2005 : schwarz] 6### [Fri Dec 30 21:00:59 CET 2005 : schwarz]
7### make sys/types.h not conflict with inttypes.h 7### make sys/types.h not conflict with inttypes.h
8### (issue is specific to IRIX 5.3) 8### (issue is specific to IRIX 5.3)
9### 9###
10. if !empty(MACHINE_PLATFORM:MIRIX-5.3-*) 10. if !empty(MACHINE_PLATFORM:MIRIX-5.3-*)
11PKG_HACKS+= sys_types_h-inttypes_h-conflict 11PKG_HACKS+= sys_types_h-inttypes_h-conflict
12post-wrapper: 12post-wrapper:
13 ${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h 13 ${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h
14# should match int8_t, int16_t, and int32_t (only) 14# should match int8_t, int16_t, and int32_t (only)
@@ -21,29 +21,32 @@ post-wrapper: @@ -21,29 +21,32 @@ post-wrapper:
21### 21###
22### XXXbjs: -ffast-math seems to cause instability, at least on amd64. 22### XXXbjs: -ffast-math seems to cause instability, at least on amd64.
23### I have disabled it pending further testing. 23### I have disabled it pending further testing.
24### 24###
25. if !empty(CC_VERSION:Mgcc-[34]*) 25. if !empty(CC_VERSION:Mgcc-[34]*)
26PKG_HACKS+= no-strict-aliasing 26PKG_HACKS+= no-strict-aliasing
27CFLAGS+= -fno-strict-aliasing 27CFLAGS+= -fno-strict-aliasing
28#PKG_HACKS+= gcc-fast-math 28#PKG_HACKS+= gcc-fast-math
29#CFLAGS+= -ffast-math 29#CFLAGS+= -ffast-math
30. endif 30. endif
31 31
32. if !empty(CC_VERSION:Mgcc-[4-9]*) 32. if !empty(CC_VERSION:Mgcc-[4-9]*)
33# Don't hide symbols for glut by default, it doesn't know how to unhide them. 33# Don't hide symbols for glut by default, it doesn't know how to unhide them.
34. if empty(PKGNAME:M*glut*) 34. if !empty(PKGNAME:M*glut*)
35PKG_HACKS+= gcc-hidden-visibility 35PKG_HACKS+= no-gcc-hidden-visibility
36BUILDLINK_TRANSFORM+= rm:-fvisibility=hidden 36BUILDLINK_TRANSFORM+= rm:-fvisibility=hidden
 37.else
 38PKG_HACKS+= gcc-hidden-visibility
 39CFLAGS+= -fvisibility=hidden
37. endif 40. endif
38. endif 41. endif
39### 42###
40### XXX this shoddy hack is here to fix the unresolved symbol error that 43### XXX this shoddy hack is here to fix the unresolved symbol error that
41### results due to '.extern pthread_getspecific' in the x86/x86-64 44### results due to '.extern pthread_getspecific' in the x86/x86-64
42### assembler dispatch routines. Morever, there are also link-time 45### assembler dispatch routines. Morever, there are also link-time
43### issues with certain other applications due to pthread_getspecific() 46### issues with certain other applications due to pthread_getspecific()
44### in glthread.c and glxext.c, so "fix" those also. 47### in glthread.c and glxext.c, so "fix" those also.
45### 48###
46. include "../../mk/bsd.fast.prefs.mk" 49. include "../../mk/bsd.fast.prefs.mk"
47 50
48. if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*86*) && \ 51. if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*86*) && \
49 empty(PTHREAD_STUBLIB:U:M*pthstub*) 52 empty(PTHREAD_STUBLIB:U:M*pthstub*)