Sun Apr 27 09:43:12 2008 UTC ()
The "pkgsrc-i386" target doesn't seem to work on SunOS, so for now fall back
to the "pkgsrc" target which is intended to be portable.


(tnn)
diff -r1.8 -r1.9 pkgsrc/graphics/Mesa/Makefile.lib
diff -r1.2 -r1.3 pkgsrc/graphics/MesaLib/options.mk

cvs diff -r1.8 -r1.9 pkgsrc/graphics/Mesa/Attic/Makefile.lib (switch to unified diff)

--- pkgsrc/graphics/Mesa/Attic/Makefile.lib 2008/04/26 20:38:49 1.8
+++ pkgsrc/graphics/Mesa/Attic/Makefile.lib 2008/04/27 09:43:12 1.9
@@ -1,98 +1,88 @@ @@ -1,98 +1,88 @@
1# $NetBSD: Makefile.lib,v 1.8 2008/04/26 20:38:49 tnn Exp $ 1# $NetBSD: Makefile.lib,v 1.9 2008/04/27 09:43:12 tnn Exp $
2# 2#
3# This Makefile fragment is included by all packages that build libraries 3# This Makefile fragment is included by all packages that build libraries
4# from the Mesa sources. 4# from the Mesa sources.
5# 5#
6 6
7.include "../../graphics/Mesa/Makefile.common" 7.include "../../graphics/Mesa/Makefile.common"
8 8
9DISTFILES+= MesaLib-${MESA_VERSION}${EXTRACT_SUFX} 9DISTFILES+= MesaLib-${MESA_VERSION}${EXTRACT_SUFX}
10DISTFILES+= MesaGLUT-${MESA_VERSION}${EXTRACT_SUFX} 10DISTFILES+= MesaGLUT-${MESA_VERSION}${EXTRACT_SUFX}
11DISTFILES+= MesaDemos-${MESA_VERSION}${EXTRACT_SUFX} 11DISTFILES+= MesaDemos-${MESA_VERSION}${EXTRACT_SUFX}
12 12
13PKG_INSTALLATION_TYPES= overwrite pkgviews 13PKG_INSTALLATION_TYPES= overwrite pkgviews
14 14
15USE_LANGUAGES= c c++ 15USE_LANGUAGES= c c++
16USE_LIBTOOL= yes 16USE_LIBTOOL= yes
17USE_TOOLS+= gmake makedepend pkg-config 17USE_TOOLS+= gmake makedepend pkg-config
18 18
19PATCHDIR= ${.CURDIR}/../MesaLib/patches 19PATCHDIR= ${.CURDIR}/../MesaLib/patches
20DISTINFO_FILE= ${.CURDIR}/../MesaLib/distinfo 20DISTINFO_FILE= ${.CURDIR}/../MesaLib/distinfo
21 21
22COPTS?= # empty 22COPTS?= # empty
23COPTS+= -prefer-pic # Make sure to build PIC libraries. 23COPTS+= -prefer-pic # Make sure to build PIC libraries.
24 24
25MAKE_ENV+= MAKE=${GMAKE:Q} 25MAKE_ENV+= MAKE=${GMAKE:Q}
26MAKE_ENV+= COPTS=${COPTS:M*:Q} 26MAKE_ENV+= COPTS=${COPTS:M*:Q}
27 27
28#.if ${X11_TYPE} == "modular" 28#.if ${X11_TYPE} == "modular"
29#. if defined(PKG_BUILD_OPTIONS.libX11) && \ 29#. if defined(PKG_BUILD_OPTIONS.libX11) && \
30# !empty(PKG_BUILD_OPTIONS.libX11:Mxcb) 30# !empty(PKG_BUILD_OPTIONS.libX11:Mxcb)
31#MAKE_ENV+= USE_XCB=yes 31#MAKE_ENV+= USE_XCB=yes
32#. endif 32#. endif
33#.endif 33#.endif
34 34
35#.if empty(MAKE_ENV:MUSE_XCB=*) 35#.if empty(MAKE_ENV:MUSE_XCB=*)
36MAKE_ENV+= USE_XCB=no 36MAKE_ENV+= USE_XCB=no
37#.endif 37#.endif
38 38
39.include "../../mk/compiler.mk" 39.include "../../mk/compiler.mk"
40 40
41MESA_HZ?= 100 41MESA_HZ?= 100
42MAKE_ENV+= MESA_HZ=${MESA_HZ:Q} 42MAKE_ENV+= MESA_HZ=${MESA_HZ:Q}
43.if ${OPSYS} == "NetBSD" && exists(/sbin/sysctl) 43.if ${OPSYS} == "NetBSD" && exists(/sbin/sysctl)
44tmphz=\ 44tmphz=\
45 ${/sbin/sysctl kern.clockrate || ${TRUE}\ 45 ${/sbin/sysctl kern.clockrate || ${TRUE}\
46 :L:sh:ts,:S/,//gW:C/([^[0-9]]*)(=|[^ hz])*([^[0-9])//g:M[0-9]*} 46 :L:sh:ts,:S/,//gW:C/([^[0-9]]*)(=|[^ hz])*([^[0-9])//g:M[0-9]*}
47. if !empty(tmphz) && (${tmphz} > 50) && (${tmphz} < 2001) 47. if !empty(tmphz) && (${tmphz} > 50) && (${tmphz} < 2001)
48MESA_HZ= ${tmphz} 48MESA_HZ= ${tmphz}
49. endif 49. endif
50.endif 50.endif
51### 51###
52### XXX do we still want this? 52### XXX do we still want this?
53### 53###
54.if ${OPSYS} == "SunOS" 54.if ${OPSYS} == "Interix"
55. if ${MACHINE_ARCH} == "sparc" 
56. if !empty(PKGSRC_COMPILER:Msunpro) 
57BUILD_TARGET= sunos5 
58. else 
59BUILD_TARGET= sunos5-gcc 
60. endif 
61. else 
62BUILD_TARGET?= pkgsrc 
63. endif 
64.elif ${OPSYS} == "Interix" 
65BUILD_TARGET= interix3 55BUILD_TARGET= interix3
66.else 56.else
67BUILD_TARGET?= pkgsrc 57BUILD_TARGET?= pkgsrc
68.endif 58.endif
69 59
70RM_PATCH_BACKUP_DIRS= docs src/mesa src/glut/glx \ 60RM_PATCH_BACKUP_DIRS= docs src/mesa src/glut/glx \
71 progs/demos progs/xdemos progs/glsl 61 progs/demos progs/xdemos progs/glsl
72pre-patch: 62pre-patch:
73 @ for fn in ${RM_PATCH_BACKUP_DIRS}; do \ 63 @ for fn in ${RM_PATCH_BACKUP_DIRS}; do \
74 ${RM} -f ${WRKSRC}/$${fn}/*.orig; \ 64 ${RM} -f ${WRKSRC}/$${fn}/*.orig; \
75 done 65 done
76 66
77post-patch: 67post-patch:
78 ${CP} ${.CURDIR}/../MesaLib/files/configs/[a-z]* ${WRKSRC}/configs 68 ${CP} ${.CURDIR}/../MesaLib/files/configs/[a-z]* ${WRKSRC}/configs
79 69
80post-install: install-headers 70post-install: install-headers
81 71
82.PHONY: install-headers 72.PHONY: install-headers
83install-headers: 73install-headers:
84 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL 74 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
85.for hdr in ${MESA_HEADERS} 75.for hdr in ${MESA_HEADERS}
86 if [ -f ${WRKSRC}/include/GL/${hdr:Q} ]; then \ 76 if [ -f ${WRKSRC}/include/GL/${hdr:Q} ]; then \
87 ${INSTALL_DATA} ${WRKSRC}/include/GL/${hdr:Q} \ 77 ${INSTALL_DATA} ${WRKSRC}/include/GL/${hdr:Q} \
88 ${DESTDIR}${PREFIX}/include/GL; \ 78 ${DESTDIR}${PREFIX}/include/GL; \
89 fi; 79 fi;
90.endfor 80.endfor
91 81
92SUBST_CLASSES+= fix-paths 82SUBST_CLASSES+= fix-paths
93SUBST_STAGE.fix-paths= pre-configure 83SUBST_STAGE.fix-paths= pre-configure
94SUBST_MESSAGE.fix-paths= Fixing absolute paths. 84SUBST_MESSAGE.fix-paths= Fixing absolute paths.
95SUBST_FILES.fix-paths= src/*.c 85SUBST_FILES.fix-paths= src/*.c
96SUBST_FILES.fix-paths+= scripts/*.sh 86SUBST_FILES.fix-paths+= scripts/*.sh
97SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g' 87SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g'
98SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g' 88SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g'

cvs diff -r1.2 -r1.3 pkgsrc/graphics/MesaLib/options.mk (switch to unified diff)

--- pkgsrc/graphics/MesaLib/options.mk 2008/04/25 20:33:08 1.2
+++ pkgsrc/graphics/MesaLib/options.mk 2008/04/27 09:43:12 1.3
@@ -1,89 +1,91 @@ @@ -1,89 +1,91 @@
1# $NetBSD: options.mk,v 1.2 2008/04/25 20:33:08 bjs Exp $ 1# $NetBSD: options.mk,v 1.3 2008/04/27 09:43:12 tnn Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib 3PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
4PKG_SUPPORTED_OPTIONS= mesa-execmem-mmap 4PKG_SUPPORTED_OPTIONS= mesa-execmem-mmap
5 5
6# Assembler code build configurations 6# Assembler code build configurations
7.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" 7.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
 8 ${OPSYS} != "SunOS"
8PKG_SUPPORTED_OPTIONS+= ${MACHINE_ARCH} 9PKG_SUPPORTED_OPTIONS+= ${MACHINE_ARCH}
9PKG_SUGGESTED_OPTIONS+= ${MACHINE_ARCH} 10PKG_SUGGESTED_OPTIONS+= ${MACHINE_ARCH}
10.endif 11.endif
11### 12###
12### XXX Prior to this patch, Mesa only allocated executable memory 13### XXX Prior to this patch, Mesa only allocated executable memory
13### with mmap(2) and PROT_EXEC on linux. On e.g. OpenBSD and NetBSD, 14### with mmap(2) and PROT_EXEC on linux. On e.g. OpenBSD and NetBSD,
14### pages which absolutely required PROT_EXEC were allocated using 15### pages which absolutely required PROT_EXEC were allocated using
15### malloc(3). You may wonder why it only worked on Linux. Answer: 16### malloc(3). You may wonder why it only worked on Linux. Answer:
16### the code was excluded with '#ifdef __linux__'! "Porting" this 17### the code was excluded with '#ifdef __linux__'! "Porting" this
17### [to BSD platforms] involved adding three lines of [preprocessor] 18### [to BSD platforms] involved adding three lines of [preprocessor]
18### code (see patch-ap if you're curious). 19### code (see patch-ap if you're curious).
19### 20###
20### Please do note hack (NetBSD-only for now) I added to wire down 21### Please do note hack (NetBSD-only for now) I added to wire down
21### this memory by setting the MESA_EXECMEM_MMAP environment variable; 22### this memory by setting the MESA_EXECMEM_MMAP environment variable;
22### you probably don't want it paged out. MAP_WIRED is probably 23### you probably don't want it paged out. MAP_WIRED is probably
23### overkill--I will revisit this at a later date. 24### overkill--I will revisit this at a later date.
24### 25###
25### You may also define MESA_EXECMEM_HEAP_SIZE in your build 26### You may also define MESA_EXECMEM_HEAP_SIZE in your build
26### environment to adjust the size of the anonymous executable 27### environment to adjust the size of the anonymous executable
27### memory pool (in bytes). The default is 10MB (huge?). 28### memory pool (in bytes). The default is 10MB (huge?).
28### 29###
29### Here's the bottom line: IF YOUR PLATFORM DOES NOT HAVE AN 30### Here's the bottom line: IF YOUR PLATFORM DOES NOT HAVE AN
30### EXECUTABLE HEAP, YOU RUN THE RISK OF MANY SEGMENTATION FAULTS 31### EXECUTABLE HEAP, YOU RUN THE RISK OF MANY SEGMENTATION FAULTS
31### UNLESS THIS OPTION IS ENABLED. If enabling this option results in 32### UNLESS THIS OPTION IS ENABLED. If enabling this option results in
32### build failure, please do file a PR. Thanks to Owain Ainsworth 33### build failure, please do file a PR. Thanks to Owain Ainsworth
33### <oga@openbsd.org> for discovering this. 34### <oga@openbsd.org> for discovering this.
34### 35###
35### --bjs (04/23/08) 36### --bjs (04/23/08)
36### 37###
37.if (!empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux") 38.if (!empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux")
38PKG_SUGGESTED_OPTIONS= mesa-execmem-mmap 39PKG_SUGGESTED_OPTIONS= mesa-execmem-mmap
39.endif 40.endif
40### 41###
41### XXX There are [probably] others, but let's not get crazy just yet. 42### XXX There are [probably] others, but let's not get crazy just yet.
42### This will take a while to test for the myriad platforms we 43### This will take a while to test for the myriad platforms we
43### support. 44### support.
44### 45###
45.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ 46.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
46 ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc" || \ 47 ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc" || \
47 ${MACHINE_ARCH} == "sparc64") && \ 48 ${MACHINE_ARCH} == "sparc64") && \
48 (${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD") 49 (${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD")
49PKG_SUPPORTED_OPTIONS+= dri 50PKG_SUPPORTED_OPTIONS+= dri
50.endif 51.endif
51### 52###
52### XXX OpenGL still works fine with the software fallback. As of now, 53### XXX OpenGL still works fine with the software fallback. As of now,
53### I think this is a good way to see which bugs surface before the 54### I think this is a good way to see which bugs surface before the
54### next release branch. Upgrading the X server to the 1.4 branch 55### next release branch. Upgrading the X server to the 1.4 branch
55### is advised given that it's glx/glcore modules are built from 56### is advised given that it's glx/glcore modules are built from
56### Mesa 6.5.3 (a development release).  57### Mesa 6.5.3 (a development release).
57### 58###
58.if !empty(MACHINE_PLATFORM:MNetBSD-[4-9]*-[ix]86*) 59.if !empty(MACHINE_PLATFORM:MNetBSD-[4-9]*-[ix]86*)
59PKG_SUGGESTED_OPTIONS+= dri 60PKG_SUGGESTED_OPTIONS+= dri
60.endif 61.endif
61 62
62.include "../../mk/bsd.options.mk" 63.include "../../mk/bsd.options.mk"
63### 64###
64### XXX Yes, this is a bit overly verbose; with Mesa, that can't hurt much. 65### XXX Yes, this is a bit overly verbose; with Mesa, that can't hurt much.
65### 66###
66.if !empty(PKG_OPTIONS:Mi386) || !empty(PKG_OPTIONS:Mx86_64) 67.if (!empty(PKG_OPTIONS:Mi386) || !empty(PKG_OPTIONS:Mx86_64)) && \
 68 ${OPSYS} != "SunOS"
67BUILD_TARGET_SUFFIX= -${MACHINE_ARCH} 69BUILD_TARGET_SUFFIX= -${MACHINE_ARCH}
68.else 70.else
69BUILD_TARGET_SUFFIX= # empty 71BUILD_TARGET_SUFFIX= # empty
70.endif 72.endif
71 73
72.if !empty(PKG_OPTIONS:Mdri) 74.if !empty(PKG_OPTIONS:Mdri)
73BUILD_TARGET= pkgsrc-dri${BUILD_TARGET_SUFFIX} 75BUILD_TARGET= pkgsrc-dri${BUILD_TARGET_SUFFIX}
74PLIST.dri= # empty 76PLIST.dri= # empty
75. include "../../graphics/MesaLib/dri.mk" 77. include "../../graphics/MesaLib/dri.mk"
76.else 78.else
77BUILD_TARGET= pkgsrc${BUILD_TARGET_SUFFIX} 79BUILD_TARGET= pkgsrc${BUILD_TARGET_SUFFIX}
78PLIST.nodri= # empty 80PLIST.nodri= # empty
79.endif 81.endif
80### 82###
81### XXX This is the default heap size. Would there be an occasion to 83### XXX This is the default heap size. Would there be an occasion to
82### change it? It seems large, so we should investigate further. 84### change it? It seems large, so we should investigate further.
83### 85###
84MESA_EXECMEM_HEAPSIZE?= 10485760 86MESA_EXECMEM_HEAPSIZE?= 10485760
85 87
86.if !empty(PKG_OPTIONS:Mmesa-execmem-mmap) 88.if !empty(PKG_OPTIONS:Mmesa-execmem-mmap)
87CFLAGS+= -DMESA_EXECMEM_MMAP 89CFLAGS+= -DMESA_EXECMEM_MMAP
88CFLAGS+= -DEXEC_HEAP_SIZE=${MESA_EXECMEM_HEAPSIZE:M[0-9]*:Q} 90CFLAGS+= -DEXEC_HEAP_SIZE=${MESA_EXECMEM_HEAPSIZE:M[0-9]*:Q}
89.endif 91.endif