summaryrefslogtreecommitdiff
path: root/graphics/MesaLib
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/MesaLib')
-rw-r--r--graphics/MesaLib/Makefile23
-rw-r--r--graphics/MesaLib/PLIST5
-rw-r--r--graphics/MesaLib/distinfo40
-rw-r--r--graphics/MesaLib/files/configs/default6
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc8
-rw-r--r--graphics/MesaLib/hacks.mk6
-rw-r--r--graphics/MesaLib/options.mk42
-rw-r--r--graphics/MesaLib/patches/patch-aa14
-rw-r--r--graphics/MesaLib/patches/patch-ab63
-rw-r--r--graphics/MesaLib/patches/patch-af44
-rw-r--r--graphics/MesaLib/patches/patch-ak22
-rw-r--r--graphics/MesaLib/patches/patch-al836
-rw-r--r--graphics/MesaLib/patches/patch-an17
-rw-r--r--graphics/MesaLib/patches/patch-ao28
-rw-r--r--graphics/MesaLib/patches/patch-ap63
-rw-r--r--graphics/MesaLib/patches/patch-ax21
-rw-r--r--graphics/MesaLib/patches/patch-ay10
17 files changed, 114 insertions, 1134 deletions
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile
index 10a2eb8fb33..6a77d745792 100644
--- a/graphics/MesaLib/Makefile
+++ b/graphics/MesaLib/Makefile
@@ -1,16 +1,22 @@
-# $NetBSD: Makefile,v 1.64 2008/07/16 06:34:00 bjs Exp $
+# $NetBSD: Makefile,v 1.65 2008/07/27 00:03:42 bjs Exp $
PKGNAME= MesaLib-${MESA_PKGVERSION}
-PKGREVISION= 4
COMMENT= Graphics library similar to SGI's OpenGL
MESA_HEADERS= gl.h gl_mangle.h glext.h glx.h glxext.h \
glx_mangle.h osmesa.h xmesa.h xmesa_x.h \
xmesa_xf86.h
+MESA_HEADERS+= internal/dri_interface.h internal/sarea.h
+
PKG_DESTDIR_SUPPORT= user-destdir
-BUILD_DEFS+= MESA_HZ MESA_EXECMEM_HEAPSIZE
+BUILD_DEFS+= MESA_HZ
+###
+### XXX Older versions of xf86driproto installed dri_interface.h, which
+### is now installed by Mesa.
+###
+BUILDLINK_API_DEPENDS.driproto+= xf86driproto>=2.0.4
.include "../../mk/bsd.prefs.mk"
@@ -22,7 +28,7 @@ CFLAGS.NetBSD+= -D_NETBSD_SOURCE
CFLAGS+= -D__GLX_ALIGN64
.endif
-.if !empty(MACHINE_ARCH:Mi386)
+.if !empty(MACHINE_ARCH:Mi386) || !empty(MACHINE_ARCH:Mx86_64)
###
### This is taken from <sys/arch/i386/include/npx.h>. If we don't override
### it, the FPU control word will be restored to 0x037f.
@@ -43,15 +49,9 @@ CFLAGS.FreeBSD+= -DDEFAULT_x86_FPU=0x1272
.endif
CFLAGS.FreeBSD+= -DUSE_NATIVE_LIBM_FUNCS
-CFLAGS.FreeBSD+= -DUSE_SSE_SYSCTL_DETECTION
-
CFLAGS.Linux+= -DUSE_NATIVE_LIBM_FUNCS
-
CFLAGS.NetBSD+= -DUSE_NATIVE_LIBM_FUNCS
-CFLAGS.NetBSD+= -DUSE_SSE_SYSCTL_DETECTION
-
CFLAGS.DragonFly+= -DUSE_NATIVE_LIBM_FUNCS
-CFLAGS.DragonFly+= -DUSE_SSE_SYSCTL_DETECTION
PLIST_VARS= dri nodri
@@ -81,6 +81,9 @@ post-extract:
${RM} -f ${WRKSRC}/$${fn}/*.orig; \
done
+pre-install:
+ ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL/internal
+
pre-build:
cd ${WRKSRC} && ${RM} -fr src/glu src/glut progs
diff --git a/graphics/MesaLib/PLIST b/graphics/MesaLib/PLIST
index 677fcfbf83e..b3e40389925 100644
--- a/graphics/MesaLib/PLIST
+++ b/graphics/MesaLib/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.17 2008/07/16 21:38:25 abs Exp $
+@comment $NetBSD: PLIST,v 1.18 2008/07/27 00:03:42 bjs Exp $
include/GL/GLwDrawA.h
include/GL/GLwDrawAP.h
include/GL/GLwMDrawA.h
@@ -9,6 +9,8 @@ include/GL/glext.h
include/GL/glx.h
include/GL/glx_mangle.h
include/GL/glxext.h
+include/GL/internal/dri_interface.h
+include/GL/internal/sarea.h
include/GL/osmesa.h
include/GL/xmesa.h
include/GL/xmesa_x.h
@@ -33,3 +35,4 @@ lib/pkgconfig/gl.pc
lib/pkgconfig/glw.pc
${PLIST.dri}@dirrm lib/dri
@unexec ${RMDIR} %D/include/GL 2>/dev/null || ${TRUE}
+@unexec ${RMDIR} %D/include/GL/internal 2>/dev/null || ${TRUE}
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo
index 79363da7f22..f9b9ed7d52c 100644
--- a/graphics/MesaLib/distinfo
+++ b/graphics/MesaLib/distinfo
@@ -1,42 +1,28 @@
-$NetBSD: distinfo,v 1.55 2008/06/27 13:24:39 tnn Exp $
+$NetBSD: distinfo,v 1.56 2008/07/27 00:03:42 bjs Exp $
-SHA1 (Mesa-7.0.3/Mesa-7.0.3-001) = 32725fd4632d51495253b06786b3f0e743d11dbd
-RMD160 (Mesa-7.0.3/Mesa-7.0.3-001) = 92b1e1d3eb3932a419c6d1fb9e7b96ef5c32fd1a
-Size (Mesa-7.0.3/Mesa-7.0.3-001) = 12578 bytes
-SHA1 (Mesa-7.0.3/Mesa-7.0.3-002) = 9fcdeb76d4cf44f0aeadff48bf7c48335773a2c0
-RMD160 (Mesa-7.0.3/Mesa-7.0.3-002) = 63b568f9c3f0e09cf53de064aee3350b4f96ee2d
-Size (Mesa-7.0.3/Mesa-7.0.3-002) = 639 bytes
-SHA1 (Mesa-7.0.3/Mesa-7.0.3-003) = d514fc54a8002983e16e38506253caed68470f39
-RMD160 (Mesa-7.0.3/Mesa-7.0.3-003) = 380c8929b520f597d618c69b014efa12a9c11e2f
-Size (Mesa-7.0.3/Mesa-7.0.3-003) = 10876 bytes
-SHA1 (Mesa-7.0.3/MesaDemos-7.0.3.tar.bz2) = c8dfef08f3b3f7abc70d99e16a35b0bbc1af4f8a
-RMD160 (Mesa-7.0.3/MesaDemos-7.0.3.tar.bz2) = 22917fbab3987e1d60d46321e1a77d5cbdd3800c
-Size (Mesa-7.0.3/MesaDemos-7.0.3.tar.bz2) = 1342158 bytes
-SHA1 (Mesa-7.0.3/MesaGLUT-7.0.3.tar.bz2) = ce263120bfa258d6cf791c21d506ea215e806b5f
-RMD160 (Mesa-7.0.3/MesaGLUT-7.0.3.tar.bz2) = 9cf615868d540d3121b1219b0395f5f268e407cd
-Size (Mesa-7.0.3/MesaGLUT-7.0.3.tar.bz2) = 329421 bytes
-SHA1 (Mesa-7.0.3/MesaLib-7.0.3.tar.bz2) = 49b92094a25f189b411f393174ee666e73dddf36
-RMD160 (Mesa-7.0.3/MesaLib-7.0.3.tar.bz2) = 1672be9d235f19c779c42ea4f443995b1844c836
-Size (Mesa-7.0.3/MesaLib-7.0.3.tar.bz2) = 3389327 bytes
-SHA1 (patch-aa) = 6db543357cfe41fe1ab1fc16d823ff61d3e8646b
-SHA1 (patch-ab) = ab6c3eb50f2e8091aeca30f92f55e02661c099e9
+SHA1 (Mesa-7.0.4/MesaDemos-7.0.4.tar.bz2) = 70e9b37120b978fda9cff8e1478e94cdc245b80f
+RMD160 (Mesa-7.0.4/MesaDemos-7.0.4.tar.bz2) = 1dd92b4260a32c30e9242a28fbb34178b24abf44
+Size (Mesa-7.0.4/MesaDemos-7.0.4.tar.bz2) = 1327557 bytes
+SHA1 (Mesa-7.0.4/MesaGLUT-7.0.4.tar.bz2) = 718a04690414720eabe5d15a14e0f7880aeafa5d
+RMD160 (Mesa-7.0.4/MesaGLUT-7.0.4.tar.bz2) = a34e94b27b6531c3c9833faaaf8cdff6b0aa7cf8
+Size (Mesa-7.0.4/MesaGLUT-7.0.4.tar.bz2) = 327581 bytes
+SHA1 (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 7f658fb2e8fa988d2c00aa63d9e4b834f96b67db
+RMD160 (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 7c3dff2b7eddcbd4974147dd0ae09a792d6d0765
+Size (Mesa-7.0.4/MesaLib-7.0.4.tar.bz2) = 3401051 bytes
+SHA1 (patch-ab) = 06e2b4159bbda8c87cd264babe129b6bea017cbc
SHA1 (patch-ac) = ed3ec49ea2aacf231bbcb38093f3dc01a0cb2468
SHA1 (patch-ad) = 5667b1bfab7cfeb1b9ea8750798f027fd0ccfd44
SHA1 (patch-ae) = e1c37a279cf3fc78d7eb43e392abbb40d3419a5f
-SHA1 (patch-af) = da03d949c3105bc548b4c6c762e8a787a995aa94
SHA1 (patch-ag) = 9010c8c90a43a37bbc5766957e25536ac67e55b5
SHA1 (patch-ah) = 3e60a700697f200fb2819f9270a37ad4a5cfa695
SHA1 (patch-ai) = 171a27e6e4a5ed92c6c2355283179e2091031a79
SHA1 (patch-aj) = 3749b279b500b1a93e45985ae956e8a70d854d9c
-SHA1 (patch-ak) = 74a1ffa426de7720a771c1d94aecb7bde17fd26c
-SHA1 (patch-al) = b734af278352de120b704025ff2e9ac127e5ec7f
SHA1 (patch-am) = 744f13b6a2fc79746bcacecf11461e78de7bf1ef
-SHA1 (patch-an) = a6960dcf6c184fa0692c0f679ebb59e004e0f499
-SHA1 (patch-ao) = 3b1f615bcf0ea14814f8e7763ba6fc9411078667
-SHA1 (patch-ap) = 20237356cd866c2ebe573124bba7be66fb335754
SHA1 (patch-aq) = 0e6099b0d23f5931b5d6ee80debc2231f9a58de5
SHA1 (patch-at) = 4b3d95a116734ad8951816e042b497f638c4cf6b
SHA1 (patch-au) = 6ce0d6236e5fb9f53db3bcb388b328ab0e132907
SHA1 (patch-av) = 5b03aeed0c4a9405be77f08cb0b1e56e544f7ef7
SHA1 (patch-aw) = d2c81d420aafad8ba5a2dcbe59fb331016535e32
+SHA1 (patch-ax) = 63edfecd17dfaf2a76f69ba3cedb1610738bf9cc
+SHA1 (patch-ay) = 8a5eb2d874026032f9b9c15e06abb40863a21a8a
SHA1 (patch-cb) = 0eac61e6656c8a8d6452504dd06ed6969ddbeba2
diff --git a/graphics/MesaLib/files/configs/default b/graphics/MesaLib/files/configs/default
index 6921e7a53a5..45d364ea3ea 100644
--- a/graphics/MesaLib/files/configs/default
+++ b/graphics/MesaLib/files/configs/default
@@ -1,4 +1,4 @@
-# $NetBSD: default,v 1.1 2008/04/24 07:40:24 bjs Exp $
+# $NetBSD: default,v 1.2 2008/07/27 00:03:42 bjs Exp $
CONFIG_NAME = default
@@ -10,8 +10,8 @@ MESA_TINY= 3
GLU_CFLAGS= # defined
MKLIB_OPTIONS=
-MKDEP= makedepend
-MKDEP_OPTIONS= -fdepend
+MKDEP?= makedepend
+MKDEP_OPTIONS?= -fdepend
INSTALL?= $(TOP)/bin/minstall
# Python and flags (generally only needed by the developers)
diff --git a/graphics/MesaLib/files/configs/pkgsrc b/graphics/MesaLib/files/configs/pkgsrc
index ed2f6c699b7..17ad444db68 100644
--- a/graphics/MesaLib/files/configs/pkgsrc
+++ b/graphics/MesaLib/files/configs/pkgsrc
@@ -1,4 +1,4 @@
-# $NetBSD: pkgsrc,v 1.1 2008/04/24 07:40:24 bjs Exp $
+# $NetBSD: pkgsrc,v 1.2 2008/07/27 00:03:42 bjs Exp $
include $(TOP)/configs/default
@@ -30,11 +30,7 @@ GLUT_LIB_DEPS=\
GLW_LIB_DEPS=\
$(TOP)/$(LIB_DIR)/lib$(GL_LIB).la -lXt -lX11
-# XXX this is wrong, revisit when doing MesaDemos
-APP_LIB_DEPS= $(TOP)/$(LIB_DIR)/lib$(GLUT_LIB).la \
- $(TOP)/$(LIB_DIR)/lib$(GLU_LIB).la \
- $(TOP)/$(LIB_DIR)/lib$(GL_LIB).la \
- -lXext -lXmu -lXi -lX11 -lm
+APP_LIB_DEPS= -lGL -lGLU -lglut -lXext -lXmu -lXi -lX11 -lm
SRC_DIRS= mesa glw glu glut/glx
DRIVER_DIRS= x11 osmesa
diff --git a/graphics/MesaLib/hacks.mk b/graphics/MesaLib/hacks.mk
index 186984f81e7..fc7ab2e22f1 100644
--- a/graphics/MesaLib/hacks.mk
+++ b/graphics/MesaLib/hacks.mk
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.12 2008/06/27 13:24:39 tnn Exp $
+# $NetBSD: hacks.mk,v 1.13 2008/07/27 00:03:42 bjs Exp $
.if !defined(MESALIBS_HACKS_MK)
MESALIBS_HACKS_MK= # defined
@@ -17,7 +17,7 @@ post-wrapper:
.include "../../mk/compiler.mk"
###
### Ordinarily, this is defined by the build. However, in pkgsrc,
-### policy dictates that we do it here.
+### policy dictates that we do it here.
###
### XXXbjs: -ffast-math seems to cause instability, at least on amd64.
### I have disabled it pending further testing.
@@ -52,7 +52,7 @@ SUBST_FILES.asm-hack= src/mesa/x86/glapi_x86.S
SUBST_FILES.asm-hack+= src/mesa/x86-64/glapi_x86-64.S
SUBST_FILES.asm-hack+= src/mesa/glapi/glthread.c
SUBST_FILES.asm-hack+= src/glx/x11/glxext.c
-SUBST_MESSAGE.asm-hack+=Teaching glapi about NetBSD thread stubs
+SUBST_MESSAGE.asm-hack=Teaching glapi about NetBSD thread stubs
SUBST_SED.asm-hack= -e 's,pthread_getspecific,__libc_thr_getspecific,g'
SUBST_STAGE.asm-hack= post-patch
. endif
diff --git a/graphics/MesaLib/options.mk b/graphics/MesaLib/options.mk
index d739b19127f..b4af8459c18 100644
--- a/graphics/MesaLib/options.mk
+++ b/graphics/MesaLib/options.mk
@@ -1,7 +1,6 @@
-# $NetBSD: options.mk,v 1.9 2008/06/03 11:06:17 tron Exp $
+# $NetBSD: options.mk,v 1.10 2008/07/27 00:03:42 bjs Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
-PKG_SUPPORTED_OPTIONS= mesa-execmem-mmap
# Assembler code build configurations
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
@@ -10,35 +9,6 @@ PKG_SUPPORTED_OPTIONS+= ${MACHINE_ARCH}
PKG_SUGGESTED_OPTIONS+= ${MACHINE_ARCH}
.endif
###
-### XXX Prior to this patch, Mesa only allocated executable memory
-### with mmap(2) and PROT_EXEC on linux. On e.g. OpenBSD and NetBSD,
-### pages which absolutely required PROT_EXEC were allocated using
-### malloc(3). You may wonder why it only worked on Linux. Answer:
-### the code was excluded with '#ifdef __linux__'! "Porting" this
-### [to BSD platforms] involved adding three lines of [preprocessor]
-### code (see patch-ap if you're curious).
-###
-### Please do note hack (NetBSD-only for now) I added to wire down
-### this memory by setting the MESA_EXECMEM_MMAP environment variable;
-### you probably don't want it paged out. MAP_WIRED is probably
-### overkill--I will revisit this at a later date.
-###
-### You may also define MESA_EXECMEM_HEAP_SIZE in your build
-### environment to adjust the size of the anonymous executable
-### memory pool (in bytes). The default is 10MB (huge?).
-###
-### Here's the bottom line: IF YOUR PLATFORM DOES NOT HAVE AN
-### EXECUTABLE HEAP, YOU RUN THE RISK OF MANY SEGMENTATION FAULTS
-### UNLESS THIS OPTION IS ENABLED. If enabling this option results in
-### build failure, please do file a PR. Thanks to Owain Ainsworth
-### <oga@openbsd.org> for discovering this.
-###
-### --bjs (04/23/08)
-###
-.if (!empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux")
-PKG_SUGGESTED_OPTIONS= mesa-execmem-mmap
-.endif
-###
### XXX There are [probably] others, but let's not get crazy just yet.
### This will take a while to test for the myriad platforms we
### support.
@@ -84,13 +54,3 @@ PLIST.nodri= # empty
###
MAKE_JOBS_SAFE= no
.endif
-###
-### XXX This is the default heap size. Would there be an occasion to
-### change it? It seems large, so we should investigate further.
-###
-MESA_EXECMEM_HEAPSIZE?= 10485760
-
-.if !empty(PKG_OPTIONS:Mmesa-execmem-mmap)
-CFLAGS+= -DMESA_EXECMEM_MMAP
-CFLAGS+= -DEXEC_HEAP_SIZE=${MESA_EXECMEM_HEAPSIZE:M[0-9]*:Q}
-.endif
diff --git a/graphics/MesaLib/patches/patch-aa b/graphics/MesaLib/patches/patch-aa
deleted file mode 100644
index ddc6cb46bf1..00000000000
--- a/graphics/MesaLib/patches/patch-aa
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-aa,v 1.8 2008/04/24 07:40:24 bjs Exp $
-
---- src/mesa/x86/assyntax.h.orig 2007-06-21 18:10:55.000000000 -0400
-+++ src/mesa/x86/assyntax.h
-@@ -985,7 +985,8 @@ SECTION _DATA public align=16 class=DATA
-
- #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
- || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
-- || defined(__FreeBSD__) && __FreeBSD__ >= 3
-+ || defined(__FreeBSD__) && __FreeBSD__ >= 3 \
-+ || defined(__NetBSD__) && defined(__ELF__)
- #define GLNAME(a) a
- #else
- #define GLNAME(a) CONCAT(_, a)
diff --git a/graphics/MesaLib/patches/patch-ab b/graphics/MesaLib/patches/patch-ab
index 10e168ae5a3..e06088ac656 100644
--- a/graphics/MesaLib/patches/patch-ab
+++ b/graphics/MesaLib/patches/patch-ab
@@ -1,22 +1,47 @@
-$NetBSD: patch-ab,v 1.15 2008/04/24 07:40:24 bjs Exp $
+$NetBSD: patch-ab,v 1.16 2008/07/27 00:03:42 bjs Exp $
---- src/glu/Makefile.orig 2007-09-12 12:03:23.000000000 -0400
-+++ src/glu/Makefile
-@@ -22,10 +22,13 @@ glu.pc: glu.pc.in
- $(pcedit) $< > $@
-
- install: glu.pc
-- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
-- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-- $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
-+ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
-+ $(LIBTOOL) --mode=install \
-+ $(BSD_INSTALL_LIB) $(TOP)/$(LIB_DIR)/libGLU.la \
-+ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-+ $(BSD_INSTALL_DATA) glu.pc \
-+ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+--- src/glu/sgi/Makefile.orig 2008-07-18 10:39:12.000000000 -0400
++++ src/glu/sgi/Makefile
+@@ -8,7 +8,8 @@ include $(TOP)/configs/current
+
+ GLU_MAJOR = 1
+ GLU_MINOR = 3
+-GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
++GLU_TINY= 0 # What is the point of having such a strange versioning scheme?
++ # It breaks libtool, but I hate to say it: libtool is right!
+
+ INCDIRS = -I$(TOP)/include -Iinclude -Iinternals -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
+
+@@ -115,10 +116,12 @@ OBJECTS = $(C_OBJECTS) $(CC_OBJECTS)
+ ##### RULES #####
+
+ .c.o:
+- $(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(INCDIRS) \
++ $(CFLAGS) $(COPTS) -DNDEBUG -DLIBRARYBUILD $< -o $(@:.o=.lo)
+
+ .cc.o:
+- $(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(INCDIRS) \
++ $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $(@:.o=.lo)
+
+
+ ##### TARGETS #####
+@@ -136,11 +139,12 @@ $(TOP)/$(LIB_DIR):
+
+ # Make the library:
+ $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
+- $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
+- -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
+- -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
+- -exports glu.exports \
+- $(GLU_LIB_DEPS) $(OBJECTS)
++ $(LIBTOOL) --mode=link $(CXX) \
++ -o $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME:.so=.la) $(LDFLAGS) \
++ -rpath $(PREFIX)/lib $(GLU_LIB_DEPS) $(OBJECTS:.o=.lo) \
++ -version-info $(GLU_MAJOR):$(GLU_MINOR):$(GLU_TINY) \
++ -export-symbols glu.sym
++
+
clean:
- @for dir in $(SUBDIRS) ; do \
diff --git a/graphics/MesaLib/patches/patch-af b/graphics/MesaLib/patches/patch-af
deleted file mode 100644
index d24fb5e0911..00000000000
--- a/graphics/MesaLib/patches/patch-af
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-af,v 1.9 2008/04/24 07:40:24 bjs Exp $
-
---- src/glu/sgi/Makefile.orig 2007-09-28 20:43:28.000000000 -0400
-+++ src/glu/sgi/Makefile
-@@ -8,7 +8,8 @@ include $(TOP)/configs/current
-
- GLU_MAJOR = 1
- GLU_MINOR = 3
--GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
-+GLU_TINY= 0 # What is the point of having such a strange versioning scheme?
-+ # It breaks libtool, but I hate to say it: libtool is right!
-
- INCDIRS = -I$(TOP)/include -Iinclude -Iinternals -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
-
-@@ -115,10 +116,12 @@ OBJECTS = $(C_OBJECTS) $(CC_OBJECTS)
- ##### RULES #####
-
- .c.o:
-- $(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
-+ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(INCDIRS) \
-+ $(CFLAGS) $(COPTS) -DNDEBUG -DLIBRARYBUILD $< -o $(@:.o=.lo)
-
- .cc.o:
-- $(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
-+ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(INCDIRS) \
-+ $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $(@:.o=.lo)
-
-
- ##### TARGETS #####
-@@ -136,10 +139,10 @@ $(TOP)/$(LIB_DIR):
-
- # Make the library:
- $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
-- $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
-- -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
-- -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
-- $(GLU_LIB_DEPS) $(OBJECTS)
-+ $(LIBTOOL) --mode=link $(CXX) \
-+ -o $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME:.so=.la) $(LDFLAGS) \
-+ -rpath $(PREFIX)/lib $(GLU_LIB_DEPS) $(OBJECTS:.o=.lo) \
-+ -version-info $(GLU_MAJOR):$(GLU_MINOR):$(GLU_TINY)
-
-
- clean:
diff --git a/graphics/MesaLib/patches/patch-ak b/graphics/MesaLib/patches/patch-ak
deleted file mode 100644
index 242f8a41962..00000000000
--- a/graphics/MesaLib/patches/patch-ak
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ak,v 1.6 2008/04/24 07:40:24 bjs Exp $
-
---- include/GL/glxext.h.orig 2007-06-21 18:10:53.000000000 -0400
-+++ include/GL/glxext.h
-@@ -389,7 +389,7 @@ typedef struct {
- #elif defined(__sun__) || defined(__digital__)
- #include <inttypes.h>
- #if defined(__STDC__)
--#if defined(__arch64__)
-+#if defined(__arch64__) || defined(_LP64)
- typedef long int int64_t;
- typedef unsigned long int uint64_t;
- #else
-@@ -397,7 +397,7 @@ typedef long long int int64_t;
- typedef unsigned long long int uint64_t;
- #endif /* __arch64__ */
- #endif /* __STDC__ */
--#elif defined( __VMS )
-+#elif defined( __VMS ) || defined(__sgi)
- #include <inttypes.h>
- #elif defined(__SCO__) || defined(__USLC__)
- #include <stdint.h>
diff --git a/graphics/MesaLib/patches/patch-al b/graphics/MesaLib/patches/patch-al
deleted file mode 100644
index 8e45040ab1c..00000000000
--- a/graphics/MesaLib/patches/patch-al
+++ /dev/null
@@ -1,836 +0,0 @@
-$NetBSD: patch-al,v 1.4 2008/04/24 07:40:24 bjs Exp $
-
---- src/mesa/drivers/x11/xm_tri.c.orig 2007-06-21 18:10:54.000000000 -0400
-+++ src/mesa/drivers/x11/xm_tri.c
-@@ -66,7 +66,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
-
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- GLuint i; \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -82,7 +82,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
-
- #include "swrast/s_tritemp.h"
-
-@@ -102,7 +102,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -117,7 +117,7 @@
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
- span.z += span.zStep; \
-- }
-+ } }
-
- #include "swrast/s_tritemp.h"
-
-@@ -137,7 +137,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb);
-
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -152,7 +152,7 @@
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
- span.z += span.zStep; \
-- }
-+ } }
-
- #include "swrast/s_tritemp.h"
-
-@@ -171,7 +171,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb);
-
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -184,7 +184,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
-
- #include "swrast/s_tritemp.h"
-
-@@ -202,7 +202,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -217,7 +217,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -232,7 +232,7 @@
- #define SETUP_CODE \
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -248,7 +248,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -265,7 +265,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -278,7 +278,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -296,7 +296,7 @@
- #define SETUP_CODE \
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -310,7 +310,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -327,7 +327,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- XDITHER_SETUP(y); \
-@@ -342,7 +342,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -357,7 +357,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- XDITHER_SETUP(y); \
-@@ -373,7 +373,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -390,7 +390,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- LOOKUP_SETUP; \
- for (i = 0; i < span.end; i++) { \
-@@ -404,7 +404,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -422,7 +422,7 @@
- #define SETUP_CODE \
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -436,7 +436,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -453,7 +453,7 @@
- XMesaImage *img = xrb->ximage; \
- unsigned long pixel; \
- PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -463,7 +463,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -481,7 +481,7 @@
- GET_XRB(xrb); \
- GLuint p = PACK_8A8B8G8R( v2->color[0], v2->color[1],\
- v2->color[2], v2->color[3]);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -490,7 +490,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -508,7 +508,7 @@
- GET_XRB(xrb); \
- GLuint p = PACK_8A8R8G8B(v2->color[0], v2->color[1], \
- v2->color[2], v2->color[3]);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -517,7 +517,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -534,7 +534,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -543,7 +543,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
-
- #include "swrast/s_tritemp.h"
-
-@@ -561,7 +561,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- const GLubyte *color = v2->color;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -573,7 +573,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -588,7 +588,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -601,7 +601,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -618,7 +618,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- GLushort p = PACK_5R6G5B( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -627,7 +627,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -645,7 +645,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- const GLubyte *color = v2->color;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -656,7 +656,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -673,7 +673,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \
-@@ -684,7 +684,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -699,7 +699,7 @@
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage; \
- FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- FLAT_DITHER_ROW_SETUP(y); \
-@@ -711,7 +711,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -731,7 +731,7 @@
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2];
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -741,7 +741,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -762,7 +762,7 @@
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2]; \
- GLubyte p = LOOKUP(r,g,b);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -771,7 +771,7 @@
- zRow[i] = z; \
- } \
- span.z += span.zStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -785,7 +785,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -796,7 +796,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -812,7 +812,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = PACK_8A8B8G8R(FixedToInt(span.red), \
-@@ -822,7 +822,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -838,7 +838,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = PACK_8A8R8G8B(FixedToInt(span.red), \
-@@ -848,7 +848,7 @@
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
- span.alpha += span.alphaStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -863,7 +863,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
-@@ -871,7 +871,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -886,7 +886,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- PIXEL_TYPE *pixel = pRow; \
- for (i = 0; i < span.end; i++, pixel++) { \
-@@ -896,7 +896,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -910,7 +910,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -921,7 +921,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -936,7 +936,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) PACK_5R6G5B(FixedToInt(span.red), \
-@@ -944,7 +944,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -960,7 +960,7 @@
- #define SETUP_CODE \
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -969,7 +969,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -984,7 +984,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- XDITHER_SETUP(y); \
-@@ -994,7 +994,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1007,7 +1007,7 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- XDITHER_SETUP(y); \
-@@ -1018,7 +1018,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1033,7 +1033,7 @@
- #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
- #define SETUP_CODE \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- LOOKUP_SETUP; \
- for (i = 0; i < span.end; i++) { \
-@@ -1042,7 +1042,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1058,7 +1058,7 @@
- #define SETUP_CODE \
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -1067,7 +1067,7 @@
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1082,12 +1082,12 @@
- XMesaImage *img = xrb->ximage; \
- unsigned long pixel; \
- PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
- XMesaPutPixel(img, x, y, pixel); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1103,11 +1103,11 @@
- GET_XRB(xrb); \
- unsigned long p = PACK_8B8G8R( v2->color[0], \
- v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1123,11 +1123,11 @@
- GET_XRB(xrb); \
- unsigned long p = PACK_8R8G8B( v2->color[0], \
- v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1143,11 +1143,11 @@
- GET_XRB(xrb); \
- unsigned long p = PACK_8R8G8B( v2->color[0], \
- v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1162,14 +1162,14 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- const GLubyte *color = v2->color;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- PIXEL_TYPE *pixel = pRow; \
- for (i = 0; i < span.end; i++, pixel++) { \
- pixel->r = color[RCOMP]; \
- pixel->g = color[GCOMP]; \
- pixel->b = color[BCOMP]; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1182,7 +1182,7 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
-@@ -1190,7 +1190,7 @@
- PACK_TRUEDITHER(p, x, y, v2->color[0], \
- v2->color[1], v2->color[2] ); \
- XMesaPutPixel(img, x, y, p); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1206,11 +1206,11 @@
- GET_XRB(xrb); \
- unsigned long p = PACK_5R6G5B( v2->color[0], \
- v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1226,13 +1226,13 @@
- XMesaContext xmesa = XMESA_CONTEXT(ctx); \
- GET_XRB(xrb); \
- const GLubyte *color = v2->color;
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
- PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \
- color[GCOMP], color[BCOMP]); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1247,13 +1247,13 @@
- #define SETUP_CODE \
- GET_XRB(xrb); \
- FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \
- for (i = 0; i < span.end; i++, x++) { \
- pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1266,14 +1266,14 @@
- GET_XRB(xrb); \
- XMesaImage *img = xrb->ximage; \
- FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- FLAT_DITHER_ROW_SETUP(y); \
- for (i = 0; i < span.end; i++, x++) { \
- unsigned long p = FLAT_DITHER(x); \
- XMesaPutPixel(img, x, y, p ); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1291,12 +1291,12 @@
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2];
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- GLint x = span.x, y = YFLIP(xrb, span.y); \
- for (i = 0; i < span.end; i++, x++) { \
- pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
-@@ -1315,11 +1315,11 @@
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2]; \
- GLubyte p = LOOKUP(r,g,b);
--#define RENDER_SPAN( span ) \
-+#define RENDER_SPAN( span ) { \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
-- }
-+ } }
- #include "swrast/s_tritemp.h"
-
-
diff --git a/graphics/MesaLib/patches/patch-an b/graphics/MesaLib/patches/patch-an
deleted file mode 100644
index e1d38aa10d2..00000000000
--- a/graphics/MesaLib/patches/patch-an
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-an,v 1.1 2008/04/24 07:40:24 bjs Exp $
-
---- src/mesa/main/glheader.h.orig 2008-03-09 12:53:33.000000000 -0400
-+++ src/mesa/main/glheader.h
-@@ -77,6 +77,12 @@
- # if _MSC_VER == 1200
- typedef UINT_PTR uintptr_t;
- # endif
-+#elif defined(__INTERIX)
-+/* Interix 3.x has a gcc that shadows this. */
-+# ifndef _UINTPTR_T_DEFINED
-+ typedef unsigned long uintptr_t;
-+# define _UINTPTR_T_DEFINED
-+# endif
- #else
- # include <inttypes.h>
- #endif
diff --git a/graphics/MesaLib/patches/patch-ao b/graphics/MesaLib/patches/patch-ao
deleted file mode 100644
index 56b5197ff5b..00000000000
--- a/graphics/MesaLib/patches/patch-ao
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-ao,v 1.2 2008/04/30 07:00:14 bjs Exp $
-
---- src/mesa/x86/common_x86.c.orig 2008-04-29 15:29:20.000000000 -0400
-+++ src/mesa/x86/common_x86.c
-@@ -38,7 +38,7 @@
- #if defined(USE_SSE_ASM) && defined(__linux__)
- #include <linux/version.h>
- #endif
--#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__DragonFly__))
-+#if defined(USE_SSE_ASM) && defined(USE_SSE_SYSCTL_DETECTION)
- #include <sys/types.h>
- #include <sys/sysctl.h>
- #endif
-@@ -113,6 +113,14 @@ static void check_os_sse_support( void )
- if (ret || !enabled)
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
- }
-+#elif defined (__NetBSD__)
-+ {
-+ int ret, enabled;
-+ size_t len = sizeof(enabled);
-+ ret = sysctlbyname("machdep.sse", &enabled, &len, (void *)NULL, 0);
-+ if (ret || !enabled)
-+ _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
-+ }
- #elif defined(WIN32)
- LPTOP_LEVEL_EXCEPTION_FILTER oldFilter;
-
diff --git a/graphics/MesaLib/patches/patch-ap b/graphics/MesaLib/patches/patch-ap
deleted file mode 100644
index 61b7e38a61e..00000000000
--- a/graphics/MesaLib/patches/patch-ap
+++ /dev/null
@@ -1,63 +0,0 @@
-$NetBSD: patch-ap,v 1.1 2008/04/24 07:40:24 bjs Exp $
-
-This patch enables code for handing out chunks of executable memory
-from an "EXEC_HEAP_SIZE-ed" anonymous area.
-
-Previously, it was only enabled for linux! Nice!
-
-While here, add code to look for the 'MESA_EXECMEM_WIRED' environment
-variable. If it is defined (assuming MAP_WIRED is defined at build
-time, of course), then the mapped anonymous pages are wired down.
-
---- src/mesa/main/execmem.c.orig 2007-11-03 10:41:44.000000000 -0400
-+++ src/mesa/main/execmem.c
-@@ -36,7 +36,7 @@
-
-
-
--#if defined(__linux__)
-+#if defined(MESA_EXECMEM_MMAP)
-
- /*
- * Allocate a large block of memory which can hold code then dole it out
-@@ -47,26 +47,38 @@
- #include <sys/mman.h>
- #include "mm.h"
-
-+#ifndef EXEC_HEAP_SIZE
- #define EXEC_HEAP_SIZE (10*1024*1024)
-+#endif
-+
-+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-+#define MAP_ANONYMOUS MAP_ANON
-+#endif
-
- _glthread_DECLARE_STATIC_MUTEX(exec_mutex);
-
- static struct mem_block *exec_heap = NULL;
- static unsigned char *exec_mem = NULL;
-
-+static int flags = MAP_PRIVATE | MAP_ANONYMOUS;
-+
-
- static void
- init_heap(void)
- {
-+#ifdef MAP_WIRED
-+ flags |= _mesa_getenv("MESA_EXECMEM_WIRED") ? MAP_WIRED : 0;
-+#endif
-+
- if (!exec_heap)
- exec_heap = mmInit( 0, EXEC_HEAP_SIZE );
-
- if (!exec_mem)
- exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,
- PROT_EXEC | PROT_READ | PROT_WRITE,
-- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
--}
-+ flags, -1, 0);
-
-+}
-
- void *
- _mesa_exec_malloc(GLuint size)
diff --git a/graphics/MesaLib/patches/patch-ax b/graphics/MesaLib/patches/patch-ax
new file mode 100644
index 00000000000..8b56f9aae6d
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-ax
@@ -0,0 +1,21 @@
+$NetBSD: patch-ax,v 1.1 2008/07/27 00:03:42 bjs Exp $
+
+--- src/glu/Makefile.orig 2008-07-18 10:39:12.000000000 -0400
++++ src/glu/Makefile
+@@ -22,10 +22,12 @@ glu.pc: glu.pc.in
+ $(pcedit) $< > $@
+
+ install: glu.pc
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ $(LIBTOOL) --mode=install \
++ $(BSD_INSTALL_LIB) $(TOP)/$(LIB_DIR)/libGLU.la \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA) glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+
+ clean:
+ @for dir in $(SUBDIRS) ; do \
diff --git a/graphics/MesaLib/patches/patch-ay b/graphics/MesaLib/patches/patch-ay
new file mode 100644
index 00000000000..b49469feb2f
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-ay
@@ -0,0 +1,10 @@
+$NetBSD: patch-ay,v 1.1 2008/07/27 00:03:42 bjs Exp $
+
+--- progs/xdemos/Makefile.orig 2008-07-18 10:39:12.000000000 -0400
++++ progs/xdemos/Makefile
+@@ -94,3 +94,5 @@ xrotfontdemo.o: xrotfontdemo.c xuserotfo
+ yuvrect_client: yuvrect_client.c
+ $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@
+
++glthreads: glthreads.c
++ $(CC) $(PTHREAD_CFLAGS) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) -o $@