summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorbjs <bjs>2008-04-24 07:40:23 +0000
committerbjs <bjs>2008-04-24 07:40:23 +0000
commitd03b665b8f1b01b267e03754cdd57d49c467a15e (patch)
tree6bbfee0b0fe04d0a17958ecdce03609c4a7e5e16 /graphics
parentf0b8c648874efaad6b96dc6c8c89e64abee33232 (diff)
downloadpkgsrc-d03b665b8f1b01b267e03754cdd57d49c467a15e.tar.gz
Welcome to Mesa-7.0.3.
Changes from 6.4.2 are (obviously) far too numerous to mention! This package brings with it support for the Direct Rendering Infrastructure (DRI) on NetBSD-current; the kernel DRM was committed approximately one year ago. Patches for NetBSD 4.0 are available in the mailing list archives (I think), but are _not supported_. Developers and other interested parties are encouraged to read the TODO file, as well as my remarks in options.mk. There is still a significant amount of work to be done. Users of NetBSD/i386 (-current) shouldn't have much trouble getting mainstream cards (Intel i915 and Radeon 9600- R430 are by far the most tested) to work. I have taken great pains to ensure that this works properly, but inevitably there will be problems--especially on heretofore untested (read: non-x86) hardware. Your questions, comments, problem reports, and of course bug fixes are welcome. NOTE: There are currently problems (on NetBSD, at least) linking some executables, e.g. compiz, due to unresolved symbols for libpthread functions. This is due to libX11's thread stubs, which should not be enabled on NetBSD >= 2.0; see the TODO For more information and the URL of an interim patch.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Mesa/Makefile8
-rw-r--r--graphics/Mesa/Makefile.common20
-rw-r--r--graphics/Mesa/Makefile.lib82
-rw-r--r--graphics/MesaLib/DESCR3
-rw-r--r--graphics/MesaLib/Makefile74
-rw-r--r--graphics/MesaLib/PLIST27
-rw-r--r--graphics/MesaLib/TODO47
-rw-r--r--graphics/MesaLib/buildlink3.mk14
-rw-r--r--graphics/MesaLib/distinfo55
-rw-r--r--graphics/MesaLib/dri.mk16
-rw-r--r--graphics/MesaLib/files/configs/default61
-rw-r--r--graphics/MesaLib/files/configs/interix312
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc40
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-dri40
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-dri-i3869
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-dri-x86_649
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-i3869
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-indirect39
-rw-r--r--graphics/MesaLib/files/configs/pkgsrc-x86_649
-rw-r--r--graphics/MesaLib/files/configs/xcb-defs15
-rw-r--r--graphics/MesaLib/hacks.mk27
-rw-r--r--graphics/MesaLib/options.mk79
-rw-r--r--graphics/MesaLib/patches/patch-aa4
-rw-r--r--graphics/MesaLib/patches/patch-ab35
-rw-r--r--graphics/MesaLib/patches/patch-ac40
-rw-r--r--graphics/MesaLib/patches/patch-ad176
-rw-r--r--graphics/MesaLib/patches/patch-ae50
-rw-r--r--graphics/MesaLib/patches/patch-af42
-rw-r--r--graphics/MesaLib/patches/patch-ag54
-rw-r--r--graphics/MesaLib/patches/patch-ah73
-rw-r--r--graphics/MesaLib/patches/patch-ai75
-rw-r--r--graphics/MesaLib/patches/patch-aj46
-rw-r--r--graphics/MesaLib/patches/patch-ak35
-rw-r--r--graphics/MesaLib/patches/patch-al203
-rw-r--r--graphics/MesaLib/patches/patch-am34
-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-aq23
-rw-r--r--graphics/MesaLib/patches/patch-at33
-rw-r--r--graphics/MesaLib/patches/patch-au68
-rw-r--r--graphics/MesaLib/patches/patch-cb19
-rw-r--r--graphics/glu/DESCR16
-rw-r--r--graphics/glu/Makefile18
-rw-r--r--graphics/glu/PLIST5
-rw-r--r--graphics/glu/buildlink3.mk5
-rw-r--r--graphics/glu/hacks.mk6
-rw-r--r--graphics/glut/Makefile24
-rw-r--r--graphics/glut/PLIST5
-rw-r--r--graphics/glut/buildlink3.mk3
-rw-r--r--graphics/glut/hacks.mk6
51 files changed, 1451 insertions, 450 deletions
diff --git a/graphics/Mesa/Makefile b/graphics/Mesa/Makefile
index b081ba077d2..8e8b080efa6 100644
--- a/graphics/Mesa/Makefile
+++ b/graphics/Mesa/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.68 2007/10/25 22:00:45 jlam Exp $
+# $NetBSD: Makefile,v 1.69 2008/04/24 07:40:23 bjs Exp $
-PKGNAME= Mesa-${MESA_VERSION}
+PKGNAME= Mesa-${MESA_PKGVERSION}
MASTER_SITES= # empty
DISTFILES= # empty
@@ -9,10 +9,12 @@ COMMENT= Graphics library meta package, similar to SGI's OpenGL
CONFLICTS= Mesa-glx-[0-9]*
+PKG_DESTDIR_SUPPORT= user-destdir
+
USE_LANGUAGES= # empty
NO_CHECKSUM= yes
-NO_CONFIGURE= yes
NO_BUILD= yes
+NO_CONFIGURE= yes
EXTRACT_ONLY= # empty
PLIST_SRC= # empty (meta-package)
diff --git a/graphics/Mesa/Makefile.common b/graphics/Mesa/Makefile.common
index 4d8db85a33b..81110c53575 100644
--- a/graphics/Mesa/Makefile.common
+++ b/graphics/Mesa/Makefile.common
@@ -1,13 +1,14 @@
-# $NetBSD: Makefile.common,v 1.57 2007/08/13 11:18:29 seb Exp $
+# $NetBSD: Makefile.common,v 1.58 2008/04/24 07:40:23 bjs Exp $
#
# This Makefile fragment is included either directly or indirectly (through
# Makefile.lib) by all packages that are built from the Mesa sources.
#
+# used by graphics/Mesa/Makefile.lib
DISTNAME?= MesaLib-${MESA_VERSION}
+EXTRACT_SUFX= .tar.bz2
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mesa3d/}
-EXTRACT_SUFX= .tar.bz2
# When changing this version, please run "make distinfo" in the following
# package directories:
@@ -16,17 +17,18 @@ EXTRACT_SUFX= .tar.bz2
# graphics/MesaDemos
# graphics/glx-utils
#
-MESA_VERSION= 6.4.2
+MESA_VERSION= 7.0.3
+MESA_PKGVERSION= ${MESA_VERSION:S/-rc/rc/}
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.mesa3d.org/
+MAINTAINER= bjs@NetBSD.org
+HOMEPAGE= http://www.mesa3d.org/
PKG_DESTDIR_SUPPORT= user-destdir
-WRKSRC= ${WRKDIR}/Mesa-${MESA_VERSION}
-BUILDING_MESA= yes
-NO_CONFIGURE= yes
-DIST_SUBDIR= Mesa-${MESA_VERSION}
+WRKSRC= ${WRKDIR}/Mesa-${MESA_VERSION}
+BUILDING_MESA= yes
+NO_CONFIGURE= yes
+DIST_SUBDIR= Mesa-${MESA_VERSION}
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
diff --git a/graphics/Mesa/Makefile.lib b/graphics/Mesa/Makefile.lib
index faa1df6cc3e..2e97e54c9d0 100644
--- a/graphics/Mesa/Makefile.lib
+++ b/graphics/Mesa/Makefile.lib
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.lib,v 1.6 2007/08/13 11:18:30 seb Exp $
+# $NetBSD: Makefile.lib,v 1.7 2008/04/24 07:40:23 bjs Exp $
#
# This Makefile fragment is included by all packages that build libraries
# from the Mesa sources.
@@ -14,18 +14,43 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
-USE_TOOLS+= makedepend
-MAKE_JOBS_SAFE= no
+USE_TOOLS+= gmake makedepend pkg-config
PATCHDIR= ${.CURDIR}/../MesaLib/patches
DISTINFO_FILE= ${.CURDIR}/../MesaLib/distinfo
-INSTALLATION_DIRS+= lib
+COPTS?= # empty
+COPTS+= -prefer-pic # Make sure to build PIC libraries.
+
+MAKE_ENV+= MAKE=${GMAKE:Q}
+MAKE_ENV+= COPTS=${COPTS:M*:Q}
+
+#.if ${X11_TYPE} == "modular"
+#. if defined(PKG_BUILD_OPTIONS.libX11) && \
+# !empty(PKG_BUILD_OPTIONS.libX11:Mxcb)
+#MAKE_ENV+= USE_XCB=yes
+#. endif
+#.endif
+
+#.if empty(MAKE_ENV:MUSE_XCB=*)
+MAKE_ENV+= USE_XCB=no
+#.endif
.include "../../mk/compiler.mk"
-.include "../../mk/bsd.prefs.mk"
-# Mesa has proper support for Solaris and SunPro, use it.
+MESA_HZ?= 100
+MAKE_ENV+= MESA_HZ=${MESA_HZ:Q}
+.if ${OPSYS} == "NetBSD" && exists(/sbin/sysctl)
+tmphz=\
+ ${sysctl kern.clockrate || ${TRUE}\
+ :L:sh:ts,:S/,//gW:C/([^[0-9]]*)(=|[^ hz])*([^[0-9])//g:M[0-9]*}
+. if !empty(tmphz) && (${tmphz} > 50) && (${tmphz} < 2001)
+MESA_HZ= ${tmphz}
+. endif
+.endif
+###
+### XXX do we still want this?
+###
.if ${OPSYS} == "SunOS"
. if ${MACHINE_ARCH} == "sparc"
. if !empty(PKGSRC_COMPILER:Msunpro)
@@ -33,22 +58,41 @@ BUILD_TARGET= sunos5
. else
BUILD_TARGET= sunos5-gcc
. endif
-. else # i386
-BUILD_TARGET= pkgsrc
+. else
+BUILD_TARGET?= pkgsrc
. endif
.elif ${OPSYS} == "Interix"
BUILD_TARGET= interix3
.else
-BUILD_TARGET= pkgsrc
+BUILD_TARGET?= pkgsrc
.endif
-.PHONY: Mesa-install-libs
-pre-install: Mesa-install-libs
-Mesa-install-libs:
- @${TEST} -z ${INSTLIBS:M*:Q}"" || ${ECHO_MSG} "Installing libraries."
- @for lib in "" ${INSTLIBS}; do \
- ${TEST} -n "$$lib" || continue; \
- ${SETENV} ${MAKE_ENV} \
- ${LIBTOOL} --mode=install ${INSTALL_LIB} \
- $$lib ${DESTDIR}${PREFIX}/lib; \
- done
+RM_PATCH_BACKUP_DIRS= docs src/mesa src/glut/glx \
+ progs/demos progs/xdemos progs/glsl
+pre-patch:
+ @ for fn in ${RM_PATCH_BACKUP_DIRS}; do \
+ ${RM} -f ${WRKSRC}/$${fn}/*.orig; \
+ done
+
+post-patch:
+ ${CP} ${.CURDIR}/../MesaLib/files/configs/[a-z]* ${WRKSRC}/configs
+
+post-install: install-headers
+
+.PHONY: install-headers
+install-headers:
+ ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
+.for hdr in ${MESA_HEADERS}
+ if [ -f ${WRKSRC}/include/GL/${hdr:Q} ]; then \
+ ${INSTALL_DATA} ${WRKSRC}/include/GL/${hdr:Q} \
+ ${DESTDIR}${PREFIX}/include/GL; \
+ fi;
+.endfor
+
+SUBST_CLASSES+= fix-paths
+SUBST_STAGE.fix-paths= pre-configure
+SUBST_MESSAGE.fix-paths= Fixing absolute paths.
+SUBST_FILES.fix-paths= src/*.c
+SUBST_FILES.fix-paths+= scripts/*.sh
+SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g'
+SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g'
diff --git a/graphics/MesaLib/DESCR b/graphics/MesaLib/DESCR
index 2826fdb1354..8a8cccf5b97 100644
--- a/graphics/MesaLib/DESCR
+++ b/graphics/MesaLib/DESCR
@@ -3,6 +3,3 @@ that of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax
or state machine, it is being used with authorization from Silicon Graphics,
Inc. However, the author makes no claim that Mesa is in any way a
compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
-
-This is the GL part of the Mesa distribution for XFree86 versions below 4.0
-that do not include Mesa.
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile
index 77acd3701f3..4231751cffd 100644
--- a/graphics/MesaLib/Makefile
+++ b/graphics/MesaLib/Makefile
@@ -1,25 +1,59 @@
-# $NetBSD: Makefile,v 1.56 2007/11/03 22:36:06 rillig Exp $
+# $NetBSD: Makefile,v 1.57 2008/04/24 07:40:24 bjs Exp $
-PKGNAME= MesaLib-${MESA_VERSION}
-PKGREVISION= 3
+PKGNAME= MesaLib-${MESA_PKGVERSION}
COMMENT= Graphics library similar to SGI's OpenGL
-.include "../../graphics/Mesa/Makefile.lib"
+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
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+BUILD_DEFS+= MESA_HZ MESA_EXECMEM_HEAPSIZE
+
+.include "../../mk/bsd.prefs.mk"
-INSTLIBS= ${WRKSRC}/src/mesa/libGL.la \
- ${WRKSRC}/src/glw/libGLw.la \
- ${WRKSRC}/src/mesa/libOSMesa.la
+CFLAGS.NetBSD+= -D_NETBSD_SOURCE
-# The sparc asm included with Mesa does not build on sparc64
-.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "sparc64"
-CONFIGURE_ARGS+= --disable-sparc
+.if (${MACHINE_ARCH} == "x86_64" || \
+ ${MACHINE_ARCH} == "sparc64" || \
+ ${MACHINE_ARCH} == "alpha")
+CFLAGS+= -D__GLX_ALIGN64
.endif
+.if !empty(MACHINE_ARCH:Mi386)
+###
+### 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.
+###
+### Also, see patch-aq about the libm functions required (float functions
+### such as floorf). Proper configuration of this should be a goal of
+### the Mesa developers; alas, it obviously is not.
+###
+### XXX We need a reliable check for these functions.
+###
+#/* NetBSD uses IEEE double precision. */
+CFLAGS.NetBSD+= -DDEFAULT_X86_FPU=0x127f
+###
+###
+#/* FreeBSD leaves some exceptions unmasked as well. */
+###
+CFLAGS.FreeBSD+= -DDEFAULT_x86_FPU=0x1272
+.endif
+
+CFLAGS.FreeBSD+= -DUSE_NATIVE_LIBM_FUNCS
+CFLAGS.Linux+= -DUSE_NATIVE_LIBM_FUNCS
+CFLAGS.NetBSD+= -DUSE_NATIVE_LIBM_FUNCS
+
+PLIST_VARS= dri nodri
+
+.include "../../graphics/Mesa/Makefile.lib"
+.include "options.mk"
.include "../../mk/pthread.buildlink3.mk"
.if !empty(MACHINE_PLATFORM:MNetBSD-[12].*)
-.include "../../devel/pthread-stublib/buildlink3.mk"
-PTHREAD_STUBLIB= "-L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib -lpthstub"
+. include "../../devel/pthread-stublib/buildlink3.mk"
+PTHREAD_STUBLIB= "-L${PREFIX}/lib -Wl,-R${PREFIX}/lib -lpthstub"
.else
PTHREAD_STUBLIB= # provided by libc
.endif
@@ -29,23 +63,17 @@ PKGSRC_MAKE_ENV+= PTHREAD_STUBLIB=${PTHREAD_STUBLIB}
MAKE_ENV+= CROSS_COMPILING=yes
.endif
-MAKE_JOBS_SAFE= no
-
+RM_PATCH_BACKUP_DIRS= docs src/mesa src/glut/glx \
+ progs/demos progs/xdemos progs/glsl
post-extract:
${CP} ${FILESDIR}/gen_matypes.awk ${WRKSRC}/src/mesa/x86
${CP} ${FILESDIR}/gen_matypes.sh ${WRKSRC}/src/mesa/x86
${CHMOD} a+x ${WRKSRC}/src/mesa/x86/gen_matypes.sh
+ for fn in ${RM_PATCH_BACKUP_DIRS}; do \
+ ${RM} -f ${WRKSRC}/$${fn}/*.orig; \
+ done
pre-build:
cd ${WRKSRC} && ${RM} -fr src/glu src/glut progs
-do-install:
- ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
- cd ${WRKSRC}/include/GL; for hdr in \
- gl.h gl_mangle.h glext.h glx.h glxext.h glx_mangle.h \
- osmesa.h xmesa.h xmesa_x.h xmesa_xf86.h; \
- do \
- ${INSTALL_DATA} $${hdr} ${DESTDIR}${PREFIX}/include/GL; \
- done
-
.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/MesaLib/PLIST b/graphics/MesaLib/PLIST
index e836c933ae7..62a8dac77f2 100644
--- a/graphics/MesaLib/PLIST
+++ b/graphics/MesaLib/PLIST
@@ -1,4 +1,8 @@
-@comment $NetBSD: PLIST,v 1.15 2006/01/19 12:53:17 adam Exp $
+@comment $NetBSD: PLIST,v 1.16 2008/04/24 07:40:24 bjs Exp $
+include/GL/GLwDrawA.h
+include/GL/GLwDrawAP.h
+include/GL/GLwMDrawA.h
+include/GL/GLwMDrawAP.h
include/GL/gl.h
include/GL/gl_mangle.h
include/GL/glext.h
@@ -11,5 +15,22 @@ include/GL/xmesa_x.h
include/GL/xmesa_xf86.h
lib/libGL.la
lib/libGLw.la
-lib/libOSMesa.la
-@unexec ${RMDIR} %D/include/GL >/dev/null 2>&1 || ${TRUE}
+${PLIST.nodri}lib/libOSMesa.la
+${PLIST.dri}lib/dri/i810_dri.la
+${PLIST.dri}lib/dri/i915_dri.la
+${PLIST.dri}lib/dri/i915tex_dri.la
+${PLIST.dri}lib/dri/i965_dri.la
+${PLIST.dri}lib/dri/mach64_dri.la
+${PLIST.dri}lib/dri/mga_dri.la
+${PLIST.dri}lib/dri/r128_dri.la
+${PLIST.dri}lib/dri/r200_dri.la
+${PLIST.dri}lib/dri/r300_dri.la
+${PLIST.dri}lib/dri/radeon_dri.la
+${PLIST.dri}lib/dri/savage_dri.la
+${PLIST.dri}lib/dri/sis_dri.la
+${PLIST.dri}lib/dri/tdfx_dri.la
+${PLIST.dri}lib/dri/unichrome_dri.la
+lib/pkgconfig/gl.pc
+lib/pkgconfig/glw.pc
+${PLIST.dri}@dirrm lib/dri
+@unexec ${RMDIR} %D/include/GL 2>/dev/null || ${TRUE}
diff --git a/graphics/MesaLib/TODO b/graphics/MesaLib/TODO
new file mode 100644
index 00000000000..3eb9f983437
--- /dev/null
+++ b/graphics/MesaLib/TODO
@@ -0,0 +1,47 @@
+ $NetBSD: TODO,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+ Here is a [possibly non-exhaustive] list of issues to resolve prior
+ to the next quarterly freeze:
+
+ - Add/verify platform-specific values to use when restoring the FPU
+ control word.
+
+ - Make sure my modifications to src/mesa/main/execmem.c did not introduce
+ any regressions.
+
+ - Currently, enabling the mmap(2)-based allocator of anonymous executable
+ memory (versus simply using malloc()) is handled by the options
+ framework. This may not be appropriate.
+
+ - The Mesa master branch uses autoconf. Unfortunately, last I checked,
+ they do not use it to enable the heap allocator, nor use of floating-point
+ functions in libm, etc. Perhaps we should take a field trip to the
+ autoconf archive and write some of the m4 code required to implement
+ these tests. After all, pkgsrc is uncommon in that we do not
+ assume the entire world conforms to the behavior of (recent?) Linux
+ "distros".
+
+ - Check to see if HZ is actually used anywhere. Cursory grepping
+ of the code found nothing.
+
+ - Once we settle on which build-time configuration variables we will
+ use, document them and/or add them to mk/defaults/mk.conf.
+
+ - The xcb (X C Bindings, not X Cut Buffer, heh) support is currently
+ disabled.
+
+ - The pkg-config files are not generated with any dependency information.
+ I'm not sure that anything in pkgsrc currently uses these, though.
+
+ - There are issues with an unresolved symbol for pthread_getspecific due
+ to libX11's thread stubs on NetBSD >= 2.0. This should be fixed in
+ pkgsrc soon; until then, you may apply this patch to fix the issue:
+
+ http://www.NetBSD.org/~bjs/libX11.diff
+
+ It also includes some recent bug fixes from freedesktop.org's GIT
+ repository.
+
+ - I have not packaged the new MesaDemos yet due to lack of time.
+
+ --bjs
diff --git a/graphics/MesaLib/buildlink3.mk b/graphics/MesaLib/buildlink3.mk
index ae28db33e70..4eee0daa3db 100644
--- a/graphics/MesaLib/buildlink3.mk
+++ b/graphics/MesaLib/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.43 2007/12/06 04:31:23 obache Exp $
+# $NetBSD: buildlink3.mk,v 1.44 2008/04/24 07:40:24 bjs Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
@@ -14,12 +14,9 @@ BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}MesaLib
.if !empty(MESALIB_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=3.4.2
BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=6.4.1nb1
+BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=7.0.3
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-.if !defined(BUILDING_MESA)
-BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
-.endif
-
.include "../../mk/bsd.fast.prefs.mk"
# See <http://developer.apple.com/qa/qa2007/qa1567.html>.
@@ -27,7 +24,12 @@ BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
BUILDLINK_LDFLAGS.MesaLib+= -Wl,-dylib_file -Wl,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
.endif
-BUILDLINK_TRANSFORM+= l:MesaGL:GL
+pkgbase:= MesaLib
+.include "../../mk/pkg-build-options.mk"
+
+.if !empty(PKG_BUILD_OPTIONS.MesaLib:Mdri)
+. include "../../graphics/MesaLib/dri.mk"
+.endif
.endif # MESALIB_BUILDLINK3_MK
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo
index f7570eafb34..b444e55d022 100644
--- a/graphics/MesaLib/distinfo
+++ b/graphics/MesaLib/distinfo
@@ -1,26 +1,31 @@
-$NetBSD: distinfo,v 1.48 2007/08/13 11:18:40 seb Exp $
+$NetBSD: distinfo,v 1.49 2008/04/24 07:40:24 bjs Exp $
-SHA1 (Mesa-6.4.2/MesaDemos-6.4.2.tar.bz2) = 35b1ff78fc1bd1c303be754ad2ff4252ad6c0258
-RMD160 (Mesa-6.4.2/MesaDemos-6.4.2.tar.bz2) = 82e1dafd39abbe1c0e1de49adcff00dec19c6c1a
-Size (Mesa-6.4.2/MesaDemos-6.4.2.tar.bz2) = 814178 bytes
-SHA1 (Mesa-6.4.2/MesaGLUT-6.4.2.tar.bz2) = f136387c3076cfb24a40a7e41cacc43359493771
-RMD160 (Mesa-6.4.2/MesaGLUT-6.4.2.tar.bz2) = 46ab4c40107ba2765bc944b026ed9f584f8c432e
-Size (Mesa-6.4.2/MesaGLUT-6.4.2.tar.bz2) = 270291 bytes
-SHA1 (Mesa-6.4.2/MesaLib-6.4.2.tar.bz2) = 4f042bdf38c9eb62e04660bd18566e7ca50d8640
-RMD160 (Mesa-6.4.2/MesaLib-6.4.2.tar.bz2) = 6bf1afc0d3bd3f5e3b5c1a019838f40603446509
-Size (Mesa-6.4.2/MesaLib-6.4.2.tar.bz2) = 2913009 bytes
-SHA1 (patch-aa) = 90457ea124a42150e3a37b48e1e0691597668606
-SHA1 (patch-ab) = c257a57d4570576f160e9a4c029384718402c1bd
-SHA1 (patch-ac) = a12c3538907aaa63184371037c0f70924861fbe4
-SHA1 (patch-ad) = e926180243a180bc80b0332f2bcacc14b7c1f13b
-SHA1 (patch-ae) = c7dd8f4b9db5241acdd0f850162b8b4116cd93bd
-SHA1 (patch-af) = e3daa689966c27c32ddb0060a0910d2e5d063555
-SHA1 (patch-ag) = 722234c02093e0d3b10659fa83bb14c7f2e7a8ac
-SHA1 (patch-ah) = 94faa48a6945aa6e7a0fc8806129a463d99d4338
-SHA1 (patch-ai) = 3c5e4cc1e054514111d50c1d01257f4647b14558
-SHA1 (patch-aj) = a805947e1aaf73a798fd3a8c6e39bf1bd62afc3a
-SHA1 (patch-ak) = 9f3480d08d2b6b7048b018956c57ad6e5d253174
-SHA1 (patch-al) = 8ccbc370bc52882ee72ba76b72a99f163f7b89a7
-SHA1 (patch-am) = a7a40d0d1f371cfa312ae504582ce0521172f85c
-SHA1 (patch-ca) = 5a40dba087b59711778f499b084a2b818b779320
-SHA1 (patch-cb) = 31b4358e171042608a017f4dc98d44f35fcdce70
+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 (patch-ac) = ed3ec49ea2aacf231bbcb38093f3dc01a0cb2468
+SHA1 (patch-ad) = 8b0bb7cf68b9ab79fc67bd5ddb2ca4acd37babb7
+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) = d5086862fb820c2f79966a41712ce056fdc25f44
+SHA1 (patch-ap) = 20237356cd866c2ebe573124bba7be66fb335754
+SHA1 (patch-aq) = 0e6099b0d23f5931b5d6ee80debc2231f9a58de5
+SHA1 (patch-at) = 4b3d95a116734ad8951816e042b497f638c4cf6b
+SHA1 (patch-au) = 6ce0d6236e5fb9f53db3bcb388b328ab0e132907
+SHA1 (patch-cb) = 0eac61e6656c8a8d6452504dd06ed6969ddbeba2
diff --git a/graphics/MesaLib/dri.mk b/graphics/MesaLib/dri.mk
new file mode 100644
index 00000000000..f75d8f9ce54
--- /dev/null
+++ b/graphics/MesaLib/dri.mk
@@ -0,0 +1,16 @@
+# $NetBSD: dri.mk,v 1.1 2008/04/24 07:40:24 bjs Exp $
+#
+# Currently, this is for convenience only.
+#
+.if !defined(DRI_MK)
+DRI_MK= # defined
+
+. include "../../textproc/expat/buildlink3.mk"
+. include "../../x11/glproto/buildlink3.mk"
+. include "../../x11/libXdamage/buildlink3.mk"
+. include "../../x11/libXfixes/buildlink3.mk"
+. include "../../x11/libdrm/buildlink3.mk"
+. include "../../x11/libXxf86vm/buildlink3.mk"
+. include "../../x11/xf86driproto/buildlink3.mk"
+. include "../../x11/xf86vidmodeproto/buildlink3.mk"
+.endif
diff --git a/graphics/MesaLib/files/configs/default b/graphics/MesaLib/files/configs/default
new file mode 100644
index 00000000000..6921e7a53a5
--- /dev/null
+++ b/graphics/MesaLib/files/configs/default
@@ -0,0 +1,61 @@
+# $NetBSD: default,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+CONFIG_NAME = default
+
+# Version info
+MESA_MAJOR= 7
+MESA_MINOR= 0
+MESA_TINY= 3
+
+GLU_CFLAGS= # defined
+
+MKLIB_OPTIONS=
+MKDEP= makedepend
+MKDEP_OPTIONS= -fdepend
+INSTALL?= $(TOP)/bin/minstall
+
+# Python and flags (generally only needed by the developers)
+PYTHON2= $(PYTHONBIN)
+PYTHON_FLAGS= -t -O -O
+
+GL_LIB= GL
+GLU_LIB= GLU
+GLUT_LIB= glut
+GLW_LIB= GLw
+OSMESA_LIB= OSMesa
+
+GL_LIB_NAME?= lib$(GL_LIB).so
+GLU_LIB_NAME?= lib$(GLU_LIB).so
+GLUT_LIB_NAME?= lib$(GLUT_LIB).so
+GLW_LIB_NAME?= lib$(GLW_LIB).so
+OSMESA_LIB_NAME?= lib$(OSMESA_LIB).so
+
+ASM_SOURCES?= # defined
+GLW_SOURCES?= GLwDrawA.c
+
+LIB_DIR= lib
+SRC_DIRS= mesa glu glut/glx glw
+GLU_DIRS= sgi
+DRIVER_DIRS= x11 osmesa
+PROGRAM_DIRS= demos redbook samples glsl xdemos
+
+EXTRA_LIB_PATH?= # defined
+GL_LIB_DEPS=\
+ $(EXTRA_LIB_PATH) -lX11 -lXext -lm $(PTHREAD_STUBLIB)
+OSMESA_LIB_DEPS=\
+ -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+GLU_LIB_DEPS=\
+ -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
+GLUT_LIB_DEPS=\
+ -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) \
+ $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
+GLW_LIB_DEPS=\
+ -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) \
+ $(EXTRA_LIB_PATH) -lXt -lX11
+APP_LIB_DEPS=\
+ -lm
+
+INSTALL_DIR?= $(PREFIX)
+DRI_DRIVER_INSTALL_DIR?= $(PREFIX)/lib/dri
+
+DRI_DRIVER_SEARCH_DIR?= $(LOCALBASE)/lib/dri
diff --git a/graphics/MesaLib/files/configs/interix3 b/graphics/MesaLib/files/configs/interix3
new file mode 100644
index 00000000000..16a4566aad6
--- /dev/null
+++ b/graphics/MesaLib/files/configs/interix3
@@ -0,0 +1,12 @@
+# $NetBSD: interix3,v 1.1 2008/04/24 07:40:24 bjs Exp $
+#
+# Configuration for Interix 3.x
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = pkgsrc
+
+# Compiler and flags
+CFLAGS+= -DUSE_XSHM_HDRONLY -DPTHREADS
+APP_LIB_DEPS = -L$(LIB_DIR) -L${PREFIX}/lib -L${X11PREFIX}/lib -lXext -lXmu -lXi -lX11 -lm
+
diff --git a/graphics/MesaLib/files/configs/pkgsrc b/graphics/MesaLib/files/configs/pkgsrc
new file mode 100644
index 00000000000..ed2f6c699b7
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc
@@ -0,0 +1,40 @@
+# $NetBSD: pkgsrc,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/default
+
+ifeq ($(USE_XCB), yes)
+include $(TOP)/configs/xcb-defs
+endif
+
+CONFIG_NAME= pkgsrc
+
+DEFINES= -DPTHREADS -DUSE_XSHM -DHZ=$(MESA_HZ) $(XCB_DEFS)
+X11_INCLUDES= -I$(X11BASE)/include $(XCB_X11_INCLUDES)
+
+CFLAGS+= $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) \
+ $(DEFINES) $(X11_INCLUDES)
+CXXFLAGS+= $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) \
+ $(DEFINES) $(X11_INCLUDES)
+
+LIBTOOL?= libtool
+
+GLUT_CFLAGS= -fexceptions # XXX gcc
+GL_LIB_DEPS=\
+ $(EXTRA_LIB_PATH) -lX11 $(XCB_GL_LIB_DEPS) -lXext -lm $(PTHREAD_STUBLIB)
+OSMESA_LIB_DEPS=\
+ $(TOP)/$(LIB_DIR)/lib$(GL_LIB).la
+GLU_LIB_DEPS=\
+ -lGL -lm
+GLUT_LIB_DEPS=\
+ -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
+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
+
+SRC_DIRS= mesa glw glu glut/glx
+DRIVER_DIRS= x11 osmesa
diff --git a/graphics/MesaLib/files/configs/pkgsrc-dri b/graphics/MesaLib/files/configs/pkgsrc-dri
new file mode 100644
index 00000000000..ab3499d00c2
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-dri
@@ -0,0 +1,40 @@
+# $NetBSD: pkgsrc-dri,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc
+
+ifeq ($(USE_XCB), yes)
+include $(TOP)/configs/xcb-defs
+endif
+
+CONFIG_NAME= pkgsrc-dri
+
+DEFINES=\
+ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
+ -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHZ=$(MESA_HZ) \
+ -DHAVE_ALIAS -D_REENTRANT $(XCB_DEFS)
+CFLAGS+=\
+ $(WARN_FLAGS) -Wmissing-prototypes -Wall \
+ $(ASM_FLAGS) $(X11_INCLUDES)
+CXXFLAGS+=\
+ $(WARN_FLAGS) $(COPTS) -Wall $(ASM_FLAGS)
+
+ASM_SOURCES?= # defined
+
+LIBDRM_CFLAGS= `$(PKG_CONFIG) --cflags libdrm`
+LIBDRM_LIB= `$(PKG_CONFIG) --libs libdrm`
+#PCIACCESS_CFLAGS= `$(PKG_CONFIG) --cflags pciaccess`
+#PCIACCESS_LIBS= `$(PKG_CONFIG) --cflags pciaccess`
+
+DRI_LIB_DEPS?= -lm -lexpat $(LIBDRM_LIB)
+GL_LIB_DEPS=\
+ -lX11 -lXext -lXxf86vm -lXdamage \
+ -lXfixes -lm $(LIBDRM_LIB) \
+ $(XCB_GL_LIB_DEPS)
+
+SRC_DIRS= glx/x11 mesa glw
+DRIVER_DIRS= dri
+PROGRAM_DIRS= # defined
+WINDOW_SYSTEM= dri
+
+DRI_DIRS?= i810 i915 i915tex i965 mach64 mga r128 r200 \
+ r300 radeon tdfx unichrome savage sis
diff --git a/graphics/MesaLib/files/configs/pkgsrc-dri-i386 b/graphics/MesaLib/files/configs/pkgsrc-dri-i386
new file mode 100644
index 00000000000..47f0323ad7b
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-dri-i386
@@ -0,0 +1,9 @@
+# $NetBSD: pkgsrc-dri-i386,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc-dri$(MESA_CONFIG_SUFX)
+
+CONFIG_NAME= pkgsrc-dri-i386
+
+ASM_FLAGS= -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
+ASM_SOURCES= $(X86_SOURCES)
+ASM_API= $(X86_API)
diff --git a/graphics/MesaLib/files/configs/pkgsrc-dri-x86_64 b/graphics/MesaLib/files/configs/pkgsrc-dri-x86_64
new file mode 100644
index 00000000000..11d1fa7d1ba
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-dri-x86_64
@@ -0,0 +1,9 @@
+# $NetBSD: pkgsrc-dri-x86_64,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc-dri$(MESA_CONFIG_SUFX)
+
+CONFIG_NAME= pkgsrc-dri-x86_64
+
+ASM_FLAGS= -DUSE_X86_64_ASM
+ASM_SOURCES= $(X86-64_SOURCES)
+ASM_API= $(X86-64_API)
diff --git a/graphics/MesaLib/files/configs/pkgsrc-i386 b/graphics/MesaLib/files/configs/pkgsrc-i386
new file mode 100644
index 00000000000..8fbe266c6ab
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-i386
@@ -0,0 +1,9 @@
+# $NetBSD: pkgsrc-i386,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc
+
+CONFIG_NAME= pkgsrc-i386
+
+ASM_FLAGS?= -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
+ASM_SOURCES= $(X86_SOURCES)
+ASM_API= $(X86_API)
diff --git a/graphics/MesaLib/files/configs/pkgsrc-indirect b/graphics/MesaLib/files/configs/pkgsrc-indirect
new file mode 100644
index 00000000000..fe5f8078a06
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-indirect
@@ -0,0 +1,39 @@
+# $NetBSD: pkgsrc-indirect,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc
+
+ifeq ($(USE_XCB), yes)
+include $(TOP)/configs/xcb-defs
+endif
+
+CONFIG_NAME= pkgsrc-indirect
+
+DEFINES=\
+ -DPTHREADS -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -D_REENTRANT \
+ $(XCB_DEFS)
+CFLAGS+=\
+ $(WARN_FLAGS) $(COPTS) -Wmissing-prototypes -Wall \
+ $(ASM_FLAGS) $(X11_INCLUDES) $(XCB_X11_INCLUDES)
+CXXFLAGS+=\
+ $(WARN_FLAGS) $(COPTS) -Wall $(ASM_FLAGS)
+
+ASM_SOURCES?= # defined
+
+LIBDRM_CFLAGS= `$(PKG_CONFIG) --cflags libdrm`
+LIBDRM_LIB= `$(PKG_CONFIG) --libs libdrm`
+#PCIACCESS_CFLAGS= `$(PKG_CONFIG) --cflags pciaccess`
+#PCIACCESS_LIBS= `$(PKG_CONFIG) --cflags pciaccess`
+
+DRI_LIB_DEPS?= -lm -lexpat $(LIBDRM_LIB)
+GL_LIB_DEPS=\
+ -lX11 -lXext -lXxf86vm -lXdamage \
+ -lXfixes -lm $(LIBDRM_LIB) \
+ $(XCB_GL_LIB_DEPS)
+
+SRC_DIRS= glx/x11 mesa glw
+DRIVER_DIRS= dri
+PROGRAM_DIRS= # defined
+WINDOW_SYSTEM= dri
+
+DRI_DIRS?= i810 i915 i915tex i965 mach64 mga r128 r200 \
+ r300 radeon tdfx unichrome savage sis
diff --git a/graphics/MesaLib/files/configs/pkgsrc-x86_64 b/graphics/MesaLib/files/configs/pkgsrc-x86_64
new file mode 100644
index 00000000000..6340180e14b
--- /dev/null
+++ b/graphics/MesaLib/files/configs/pkgsrc-x86_64
@@ -0,0 +1,9 @@
+# $NetBSD: pkgsrc-x86_64,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+include $(TOP)/configs/pkgsrc
+
+CONFIG_NAME= pkgsrc-dri-x86_64
+
+ASM_FLAGS= -DUSE_X86_64_ASM
+ASM_SOURCES= $(X86-64_SOURCES)
+ASM_API= $(X86-64_API)
diff --git a/graphics/MesaLib/files/configs/xcb-defs b/graphics/MesaLib/files/configs/xcb-defs
new file mode 100644
index 00000000000..34b9a8e2dd3
--- /dev/null
+++ b/graphics/MesaLib/files/configs/xcb-defs
@@ -0,0 +1,15 @@
+# $NetBSD: xcb-defs,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+
+XCB_DEFS= -DUSE_XCB
+
+XCB_X11_INCLUDES=\
+ `pkg-config --cflags-only-I x11` \
+ `pkg-config --cflags-only-I xcb` \
+ `pkg-config --cflags-only-I x11-xcb` \
+ `pkg-config --cflags-only-I xcb-glx`
+
+XCB_GL_LIB_DEPS=\
+ `pkg-config --libs xcb` \
+ `pkg-config --libs x11-xcb` \
+ `pkg-config --libs xcb-glx`
diff --git a/graphics/MesaLib/hacks.mk b/graphics/MesaLib/hacks.mk
index 45955a16a31..5800cbeae3a 100644
--- a/graphics/MesaLib/hacks.mk
+++ b/graphics/MesaLib/hacks.mk
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.4 2007/10/16 23:48:58 tnn Exp $
+# $NetBSD: hacks.mk,v 1.5 2008/04/24 07:40:24 bjs Exp $
.if !defined(MESALIBS_HACKS_MK)
MESALIBS_HACKS_MK= # defined
@@ -7,11 +7,32 @@ MESALIBS_HACKS_MK= # defined
### make sys/types.h not conflict with inttypes.h
### (issue is specific to IRIX 5.3)
###
-.if !empty(MACHINE_PLATFORM:MIRIX-5.3-*)
+. if !empty(MACHINE_PLATFORM:MIRIX-5.3-*)
PKG_HACKS+= sys_types_h-inttypes_h-conflict
post-wrapper:
${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h
# should match int8_t, int16_t, and int32_t (only)
-.endif
+. endif
+
+.include "../../mk/compiler.mk"
+###
+### Ordinarily, this is defined by the build. However, in pkgsrc,
+### policy dictates that we do it here. Let's trust a semi-modern
+### gcc with -ffast-math for now.
+###
+. if !empty(CC_VERSION:Mgcc-[34]*)
+PKG_HACKS+= no-strict-aliasing
+CFLAGS+= -fno-strict-aliasing
+PKG_HACKS+= gcc-fast-math
+CFLAGS+= -ffast-math
+. endif
+
+. if !empty(CC_VERSION:Mgcc-[4-9]*)
+# Don't hide symbols for glut by default, it doesn't know how to unhide them.
+. if empty(PKGNAME:M*glut*)
+PKG_HACKS+= gcc-hidden-visibility
+CFLAGS+= -fvisibility=hidden
+. endif
+. endif
.endif
diff --git a/graphics/MesaLib/options.mk b/graphics/MesaLib/options.mk
new file mode 100644
index 00000000000..791d85c6795
--- /dev/null
+++ b/graphics/MesaLib/options.mk
@@ -0,0 +1,79 @@
+# $NetBSD: options.mk,v 1.1 2008/04/24 07:40:24 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"
+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.
+###
+.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
+ ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "sparc64") && \
+ (${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD")
+PKG_SUPPORTED_OPTIONS+= dri
+.endif
+
+.include "../../mk/bsd.options.mk"
+###
+### XXX Yes, this is a bit overly verbose; with Mesa, that can't hurt much.
+###
+.if !empty(PKG_OPTIONS:Mi386) || !empty(PKG_OPTIONS:Mx86_64)
+BUILD_TARGET_SUFFIX= -${MACHINE_ARCH}
+.else
+BUILD_TARGET_SUFFIX= # empty
+.endif
+
+.if !empty(PKG_OPTIONS:Mdri)
+BUILD_TARGET= pkgsrc-dri${BUILD_TARGET_SUFFIX}
+PLIST.dri= # empty
+. include "../../graphics/MesaLib/dri.mk"
+.else
+BUILD_TARGET= pkgsrc${BUILD_TARGET_SUFFIX}
+PLIST.nodri= # empty
+.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
index faffb125a1a..ddc6cb46bf1 100644
--- a/graphics/MesaLib/patches/patch-aa
+++ b/graphics/MesaLib/patches/patch-aa
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.7 2004/10/26 13:55:37 adam Exp $
+$NetBSD: patch-aa,v 1.8 2008/04/24 07:40:24 bjs Exp $
---- src/mesa/x86/assyntax.h.orig 2004-04-26 10:10:25.000000000 +0000
+--- 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
diff --git a/graphics/MesaLib/patches/patch-ab b/graphics/MesaLib/patches/patch-ab
index 85cb8d57ce9..10e168ae5a3 100644
--- a/graphics/MesaLib/patches/patch-ab
+++ b/graphics/MesaLib/patches/patch-ab
@@ -1,15 +1,22 @@
-$NetBSD: patch-ab,v 1.14 2005/06/17 15:54:07 jlam Exp $
+$NetBSD: patch-ab,v 1.15 2008/04/24 07:40:24 bjs Exp $
---- /dev/null 2004-10-25 16:57:21.000000000 +0000
-+++ configs/pkgsrc
-@@ -0,0 +1,9 @@
-+# Configuration for NetBSD
-+
-+include $(TOP)/configs/default
-+
-+CONFIG_NAME = pkgsrc
-+
-+# Compiler and flags
-+CFLAGS+= -DUSE_XSHM -DPTHREADS
-+APP_LIB_DEPS = -L$(LIB_DIR) -L${PREFIX}/lib -L${X11PREFIX}/lib -lXext -lXmu -lXi -lX11 -lm
-+
+--- 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
+
+ clean:
+ @for dir in $(SUBDIRS) ; do \
diff --git a/graphics/MesaLib/patches/patch-ac b/graphics/MesaLib/patches/patch-ac
index f161beee91c..8cad8670fe6 100644
--- a/graphics/MesaLib/patches/patch-ac
+++ b/graphics/MesaLib/patches/patch-ac
@@ -1,29 +1,45 @@
-$NetBSD: patch-ac,v 1.11 2007/08/13 11:18:44 seb Exp $
+$NetBSD: patch-ac,v 1.12 2008/04/24 07:40:24 bjs Exp $
---- Makefile.orig 2005-11-29 23:38:49.000000000 +0100
+--- Makefile.orig 2008-02-21 18:58:08.000000000 -0500
+++ Makefile
-@@ -2,7 +2,7 @@
+@@ -1,8 +1,8 @@
+ # Top-level Mesa makefile
- TOP = .
+-TOP = .
++TOP= .
-SUBDIRS = src progs
-+SUBDIRS = src
++SUBDIRS?= src
default: $(TOP)/configs/current
-@@ -74,6 +74,7 @@ hpux11-64 \
- hpux11-64-static \
+@@ -90,6 +90,7 @@ hpux11-ia64 \
+ hpux11-ia64-static \
hpux9 \
hpux9-gcc \
+interix3 \
irix6-64 \
irix6-64-static \
irix6-n32 \
-@@ -117,6 +118,7 @@ linux-x86-xcb \
- linux-x86-glide \
- linux-x86-static \
- netbsd \
-+pkgsrc \
+@@ -140,6 +141,10 @@ netbsd \
openbsd \
osf1 \
+ osf1-static \
++pkgsrc \
++pkgsrc-dri \
++pkgsrc-dri-i386 \
++pkgsrc-dri-x86_64 \
solaris-x86 \
+ solaris-x86-gcc \
+ solaris-x86-gcc-static \
+@@ -156,10 +161,6 @@ sunos5-v9 \
+ sunos5-v9-static \
+ sunos5-v9-cc-g++ \
+ ultrix-gcc:
+- @ if test -f configs/current || test -L configs/current ; then \
+- echo "Please run 'make realclean' before changing configs" ; \
+- exit 1 ; \
+- fi
+ (cd configs && rm -f current && ln -s $@ current)
+ $(MAKE) default
+
diff --git a/graphics/MesaLib/patches/patch-ad b/graphics/MesaLib/patches/patch-ad
index afb67572588..9346167b419 100644
--- a/graphics/MesaLib/patches/patch-ad
+++ b/graphics/MesaLib/patches/patch-ad
@@ -1,59 +1,177 @@
-$NetBSD: patch-ad,v 1.10 2007/08/13 11:18:44 seb Exp $
+$NetBSD: patch-ad,v 1.11 2008/04/24 07:40:24 bjs Exp $
---- src/mesa/Makefile.orig 2005-07-26 07:55:56.000000000 +0200
+--- src/mesa/Makefile.orig 2007-12-03 20:00:21.000000000 +0100
+++ src/mesa/Makefile
-@@ -14,13 +14,13 @@ GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$
+@@ -8,19 +8,22 @@ include sources
+
+ GL_MAJOR = 1
+ GL_MINOR = 5
+-GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
++GL_TINY = 0
+
+
.SUFFIXES : .cpp
.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-+ ${LIBTOOL} --mode=compile $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC \
++ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(COPTS) $< -o $(@:.o=.lo)
.cpp.o:
- $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
-+ ${LIBTOOL} --mode=compile $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CXX \
++ $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $(@:.o=.lo)
.S.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-+ ${LIBTOOL} --mode=compile $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC \
++ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(COPTS) $< -o $(@:.o=.lo)
# Figure out what to make here
-@@ -150,25 +150,23 @@ subdirs:
+@@ -51,13 +54,14 @@ beos: depend subdirs libmesa.a
+ # Linux DRI drivers
+
+ # Make archive of core object files
+-libmesa.a: $(SOLO_OBJECTS)
+- @ $(TOP)/bin/mklib -o mesa -static $(SOLO_OBJECTS);
++libmesa.la: $(SOLO_OBJECTS)
++ @ $(LIBTOOL) --mode=link $(CC) \
++ -o $@ $(SOLO_OBJECTS:.o=.lo) -static -avoid-version
+ @if [ "${CONFIG_NAME}" = "beos" ] ; then \
+ mimeset -f "$@" ; \
+ fi
+
+-linux-solo: depend subdirs libmesa.a
++linux-solo: depend subdirs libmesa.la
+ cd drivers/dri ; $(MAKE)
+
+
+@@ -65,10 +69,11 @@ linux-solo: depend subdirs libmesa.a
+ # Stand-alone Mesa libGL, no built-in drivers (DirectFB)
+
+ libgl-core: $(CORE_OBJECTS)
+- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+- -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
+- $(GL_LIB_DEPS)
++ @ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) \
++ $(LDFLAGS) -rpath $(PREFIX)/lib \
++ -version-info $(MESA_MAJOR):$(MESA_MINOR):$(MESA_TINY) \
++ $(CORE_OBJECTS:.o=.lo) $(GL_LIB_DEPS)
+
+ directfb: depend subdirs libgl-core
+ cd drivers/directfb ; $(MAKE)
+@@ -78,12 +83,12 @@ directfb: depend subdirs libgl-core
+ # fbdev Mesa driver (libGL.so)
+
+ fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
+- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+- -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
+- $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \
+- $(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS)
+-
++ @ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) $(LDFLAGS) \
++ -rpath $(PREFIX)/lib $(CORE_OBJECTS:.o=.lo) \
++ -version-info $(MESA_MAJOR):$(MESA_MINOR):$(MESA_TINY) \
++ $(FBDEV_DRIVER_OBJECTS:.o=.lo) \
++ $(COMMON_DRIVER_OBJECTS:.o=.lo) $(GL_LIB_DEPS)
+
+ ######################################################################
+ # Stand-alone Mesa libGL and libOSMesa
+@@ -111,29 +116,30 @@ osmesa-only: depend subdirs $(TOP)/$(LIB
# Make the GL library
- $(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
-- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
+ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
+- @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
-- -install $(LIB_DIR) \
+- -install $(TOP)/$(LIB_DIR) \
- $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS)
-+ ${LIBTOOL} --mode=link ${CC} -o ${GL_LIB_NAME:.so=.la} \
-+ ${STAND_ALONE_OBJECTS:.o=.lo} \
-+ -rpath ${PREFIX}/lib -version-info ${GL_MAJOR}:${GL_MINOR} \
-+ -L${X11BASE}/lib -Wl,-R${X11BASE}/lib ${GL_LIB_DEPS}
++ @ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) \
++ -version-info $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) \
++ -rpath $(PREFIX)/lib $(LDFLAGS) $(GL_LIB_DEPS) \
++ $(STAND_ALONE_OBJECTS:.o=.lo)
++
# Make the OSMesa library
- $(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
+ # Note: version is kept at 6.5.3 to simplify app/linking issues
+ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
@ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
-- -major $(MESA_MAJOR) \
-- -minor $(MESA_MINOR) -patch $(MESA_TINY) \
-- -install $(LIB_DIR) $(MKLIB_OPTIONS) \
+- -ldflags '$(LDFLAGS)' \
+- -major 6 -minor 5 -patch 3 \
+- -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
- $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
-+ ${LIBTOOL} --mode=link ${CC} -o ${OSMESA_LIB_NAME:.so=.la} \
-+ ${OSMESA16_OBJECTS:.o=.lo} -rpath ${PREFIX}/lib \
-+ -version-info ${MESA_MAJOR}:${MESA_MINOR} \
-+ ${OSMESA_LIB_DEPS:S|-lGL|libGL.la|} ; \
++ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la) \
++ $(LDFLAGS) -version-info 6:5:3 -rpath $(PREFIX)/lib \
++ $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS:.o=.lo) ; \
else \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
-- -major $(MESA_MAJOR) \
-- -minor $(MESA_MINOR) -patch $(GL_TINY) \
-- -install $(LIB_DIR) $(MKLIB_OPTIONS) \
+- -ldflags '$(LDFLAGS)' \
+- -major 6 -minor 5 -patch 3 \
+- -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
- $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
-+ ${LIBTOOL} --mode=link ${CC} -o ${OSMESA_LIB_NAME:.so=.la} \
-+ ${OSMESA_DRIVER_OBJECTS:.o=.lo} -rpath ${PREFIX}/lib \
-+ -version-info ${MESA_MAJOR}:${MESA_MINOR} \
-+ ${OSMESA_LIB_DEPS:S|-lGL|libGL.la|} ; \
++ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la) \
++ $(LDFLAGS) -version-info 6:5:3 \
++ -o $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la) \
++ -rpath $(PREFIX)/lib $(OSMESA_LIB_DEPS) \
++ $(OSMESA_DRIVER_OBJECTS:.o=.lo) ; \
fi
+-
+ ######################################################################
+ # libGL pkg-config file
+ pcedit = sed \
+@@ -164,20 +170,26 @@ subdirs:
+
+
+ install: default gl.pc
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+- $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
+- @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
+- $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
+- fi
+- $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+- @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
+- $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/include/GL
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++# @for fn in $(TOP)/include/GL/*.h; do \
++# $(BSD_INSTALL_DATA) $$fn $(DESTDIR)$(INSTALL_DIR)/include/GL; \
++# done
++ @if [ -e "$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la)" ]; then \
++ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) \
++ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
++ fi
++ $(BSD_INSTALL_DATA) gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ @if [ -e "$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la)" ]; then \
++ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) \
++ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME:.so=.la) \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
+ fi
+ @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
+ cd drivers/dri ; $(MAKE) install ; \
+- fi
++ fi
+ ## NOT INSTALLED YET:
+ ## $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES
+@@ -191,7 +203,7 @@ tags:
+ clean:
+ -rm -f */*.o
+ -rm -f */*/*.o
+- -rm -f depend depend.bak libmesa.a
++ -rm -f depend depend.bak libmesa*
+ -rm -f drivers/*/*.o
+ (cd drivers/dri ; $(MAKE) clean)
+ (cd x86 ; $(MAKE) clean)
diff --git a/graphics/MesaLib/patches/patch-ae b/graphics/MesaLib/patches/patch-ae
index 089421c0db8..cb6f278e117 100644
--- a/graphics/MesaLib/patches/patch-ae
+++ b/graphics/MesaLib/patches/patch-ae
@@ -1,28 +1,54 @@
-$NetBSD: patch-ae,v 1.9 2007/08/13 11:18:45 seb Exp $
+$NetBSD: patch-ae,v 1.10 2008/04/24 07:40:24 bjs Exp $
---- src/glw/Makefile.orig 2005-07-26 07:55:56.000000000 +0200
+--- src/glw/Makefile.orig 2007-09-28 20:43:28.000000000 -0400
+++ src/glw/Makefile
-@@ -17,7 +17,7 @@ OBJECTS = $(GLW_SOURCES:.c=.o)
+@@ -17,7 +17,8 @@ OBJECTS = $(GLW_SOURCES:.c=.o)
##### RULES #####
.c.o:
- $(CC) -c $(INCDIRS) $(CFLAGS) $<
-+ ${LIBTOOL} --mode=compile $(CC) -c $(INCDIRS) $(CFLAGS) $<
++ $(LIBTOOL) --mode=compile --tag=CC \
++ $(CC) -c $(INCDIRS) $(CFLAGS) $(COPTS) -o $(@:.o=.lo) $<
-@@ -33,10 +33,10 @@ clean:
+@@ -34,12 +35,16 @@ glw.pc: glw.pc.in
+ $(pcedit) $< > $@
+
+ install: glw.pc
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+- $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_DIR)/include/GL
+- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/include/GL
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ @for fn in *.h; do \
++ $(BSD_INSTALL_DATA) $$fn $(DESTDIR)$(INSTALL_DIR)/include/GL; \
++ done
++ $(LIBTOOL) --mode=install \
++ $(BSD_INSTALL_LIB) $(TOP)/$(LIB_DIR)/libGLw.la \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA) glw.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+
+ clean:
+ -rm depend depend.bak
+@@ -48,10 +53,12 @@ clean:
# Make the library
- $(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
-- $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' \
+ $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
+- $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \
-- $(MKLIB_OPTIONS) -install $(LIB_DIR) \
+- $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
- $(GLW_LIB_DEPS) $(OBJECTS)
-+ ${LIBTOOL} --mode=link ${CC} -o ${GLW_LIB_NAME:.so=.la} \
-+ ${OBJECTS:.o=.lo} -rpath ${PREFIX}/lib \
-+ -version-info ${MAJOR}:${MINOR} -L${X11BASE}/lib \
-+ ${GLW_LIB_DEPS:S|-lGL|../mesa/libGL.la|} -Wl,-R${X11BASE}/lib
++ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME:.so=.la) \
++ -rpath $(PREFIX)/lib $(LDFLAGS) \
++ -version-info $(MAJOR):$(MINOR):$(TINY) \
++ $(GLW_LIB_DEPS) $(OBJECTS:.o=.lo)
++
#
diff --git a/graphics/MesaLib/patches/patch-af b/graphics/MesaLib/patches/patch-af
index b0bae071de1..d24fb5e0911 100644
--- a/graphics/MesaLib/patches/patch-af
+++ b/graphics/MesaLib/patches/patch-af
@@ -1,30 +1,44 @@
-$NetBSD: patch-af,v 1.8 2007/08/13 11:18:45 seb Exp $
+$NetBSD: patch-af,v 1.9 2008/04/24 07:40:24 bjs Exp $
---- src/glu/sgi/Makefile.orig 2005-07-26 07:55:56.000000000 +0200
+--- src/glu/sgi/Makefile.orig 2007-09-28 20:43:28.000000000 -0400
+++ src/glu/sgi/Makefile
-@@ -115,9 +115,11 @@ OBJECTS = $(C_OBJECTS) $(CC_OBJECTS)
+@@ -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:
-+ ${LIBTOOL} --tag=CC --mode=compile \
- $(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -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:
-+ ${LIBTOOL} --tag=CXX --mode=compile \
- $(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
+- $(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(INCDIRS) \
++ $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $(@:.o=.lo)
-@@ -136,10 +138,9 @@ $(LIB_DIR):
+ ##### TARGETS #####
+@@ -136,10 +139,10 @@ $(TOP)/$(LIB_DIR):
# Make the library:
- $(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
-- $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' \
+ $(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 $(LIB_DIR) \
+- -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
- $(GLU_LIB_DEPS) $(OBJECTS)
-+ ${LIBTOOL} --tag=CXX --mode=link ${CXX} -o ${GLU_LIB_NAME:.so=.la} \
-+ ${OBJECTS:.o=.lo} -rpath ${PREFIX}/lib \
-+ -version-info ${GLU_MAJOR}:${GLU_MINOR} ${GLU_LIB_DEPS}
++ $(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-ag b/graphics/MesaLib/patches/patch-ag
index 61065c5a415..b562bf62dae 100644
--- a/graphics/MesaLib/patches/patch-ag
+++ b/graphics/MesaLib/patches/patch-ag
@@ -1,27 +1,55 @@
-$NetBSD: patch-ag,v 1.10 2007/08/13 11:18:46 seb Exp $
+$NetBSD: patch-ag,v 1.11 2008/04/24 07:40:24 bjs Exp $
---- src/glut/glx/Makefile.orig 2005-07-26 07:55:56.000000000 +0200
+--- src/glut/glx/Makefile.orig 2007-11-20 16:12:22.000000000 +0100
+++ src/glut/glx/Makefile
-@@ -79,6 +79,7 @@ OBJECTS = $(SOURCES:.c=.o)
+@@ -80,9 +80,8 @@ OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
-+ ${LIBTOOL} --mode=compile \
- $(CC) -c -I$(TOP)/include $(CFLAGS) $(GLUT_CFLAGS) $<
+- $(CC) -c -I$(TOP)/include $(X11_INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) $<
+-
+-
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c -I$(TOP)/include \
++ $(X11_INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) -o $(@:.o=.lo) $<
+ ##### TARGETS #####
-@@ -90,10 +91,10 @@ default: $(LIB_DIR)/$(GLUT_LIB_NAME)
+@@ -91,10 +90,11 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NA
# Make the library
- $(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
-- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
+- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
-- $(MKLIB_OPTIONS) -install $(LIB_DIR) \
+- $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
- $(GLUT_LIB_DEPS) $(OBJECTS)
-+ ${LIBTOOL} --mode=link ${CC} -o ${GLUT_LIB_NAME:.so=.la} \
-+ ${OBJECTS:.o=.lo} -rpath ${PREFIX}/lib \
-+ -version-info ${GLUT_MAJOR}:${GLUT_MINOR} \
-+ -L${X11BASE}/lib -Wl,-R${X11BASE}/lib ${GLUT_LIB_DEPS}
++ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME:.so=.la) $(LDFLAGS) \
++ -rpath $(PREFIX)/lib $(GLUT_LIB_DEPS) \
++ -version-info $(GLUT_MAJOR):$(GLUT_MINOR):$(GLUT_TINY) \
++ $(GLUT_LIB_DEPS) $(OBJECTS:.o=.lo)
+ # glut pkgconfig file
+@@ -106,13 +106,15 @@ glut.pc: glut.pc.in
+ $(pcedit) $< > $@
+
+ install: glut.pc
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
+- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+- $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+-
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/include/GL
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
++ $(BSD_INSTALL_DATA) $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
++ $(LIBTOOL) --mode=install \
++ $(BSD_INSTALL_LIB) $(TOP)/$(LIB_DIR)/libglut.la \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
++ $(BSD_INSTALL_DATA) glut.pc \
++ $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+
clean:
+ -rm -f *.o *~
diff --git a/graphics/MesaLib/patches/patch-ah b/graphics/MesaLib/patches/patch-ah
index b0d488741dd..60ef2ed02cb 100644
--- a/graphics/MesaLib/patches/patch-ah
+++ b/graphics/MesaLib/patches/patch-ah
@@ -1,33 +1,42 @@
-$NetBSD: patch-ah,v 1.7 2007/08/13 11:18:46 seb Exp $
+$NetBSD: patch-ah,v 1.8 2008/04/24 07:40:24 bjs Exp $
---- configs/default.orig 2005-10-25 01:35:14.000000000 +0200
-+++ configs/default
-@@ -14,10 +14,6 @@ MESA_TINY=1
- DRM_SOURCE_PATH=$(TOP)/../drm
-
- # Compiler and flags
--CC = cc
--CXX = CC
--CFLAGS = -O
--CXXFLAGS = -O
- GLU_CFLAGS =
-
- # Misc tools and flags
-@@ -56,7 +52,7 @@ GLW_SOURCES = GLwDrawA.c
-
- # Directories
- LIB_DIR = $(TOP)/lib
--INSTALL_PREFIX = /usr/local
-+INSTALL_PREFIX = ${PREFIX}
- SRC_DIRS = mesa glu glut/glx glw
- GLU_DIRS = sgi
- DRIVER_DIRS = x11 osmesa
-@@ -66,7 +62,7 @@ PROGRAM_DIRS = demos redbook samples xde
-
- # Library/program dependencies
- EXTRA_LIB_PATH ?=
--GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
-+GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm ${PTHREAD_STUBLIB}
- OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB)
- GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
- GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
+--- src/mesa/drivers/dri/glcore/Makefile.orig 2007-09-28 20:43:28.000000000 -0400
++++ src/mesa/drivers/dri/glcore/Makefile
+@@ -36,7 +36,7 @@ INCLUDE_DIRS = \
+ MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+
+ # Libraries that the driver shared lib depends on
+-LIB_DEPS = -lm -lpthread -lc
++LIB_DEPS = -lm -lc
+ # LIB_DEPS = -lGL -lm -lpthread -lc
+
+
+@@ -49,10 +49,12 @@ OBJECTS = $(C_SOURCES:.c=.o) \
+ ##### RULES #####
+
+ .c.o:
+- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC \
++ $(CC) -c -prefer-pic $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $(@:.o=.lo)
+
+ .S.o:
+- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC \
++ $(CC) -c -prefer-pic $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $(@:.o=.lo)
+
+
+ ##### TARGETS #####
+@@ -61,9 +63,10 @@ default: depend $(TOP)/$(LIB_DIR)/$(LIBN
+
+
+ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+- CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix \
+- -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \
+- $(OBJECTS) $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES)
++ $(LIBTOOL) --mode=link $(CC) -o $(TOP)/$(LIB_DIR)/$(LIB_NAME:.so=.la) \
++ $(LDFLAGS) $(OBJECTS:.o=.lo) $(WINLIB) $(LIB_DEPS) \
++ $(WINOBJ:.o=.lo) $(MESA_MODULES:.a=.la) -rpath $(PREFIX)/lib \
++ -module -avoid-version
+
+
+ depend: $(C_SOURCES) $(ASM_SOURCES)
diff --git a/graphics/MesaLib/patches/patch-ai b/graphics/MesaLib/patches/patch-ai
index 13ad56f4dc5..26963fdc0e5 100644
--- a/graphics/MesaLib/patches/patch-ai
+++ b/graphics/MesaLib/patches/patch-ai
@@ -1,15 +1,62 @@
-$NetBSD: patch-ai,v 1.1 2005/11/08 16:41:30 tv Exp $
+$NetBSD: patch-ai,v 1.2 2008/04/24 07:40:24 bjs Exp $
---- /dev/null 2004-10-25 16:57:21.000000000 +0000
-+++ configs/interix3
-@@ -0,0 +1,9 @@
-+# Configuration for Interix 3.x
-+
-+include $(TOP)/configs/default
-+
-+CONFIG_NAME = pkgsrc
-+
-+# Compiler and flags
-+CFLAGS+= -DUSE_XSHM_HDRONLY -DPTHREADS
-+APP_LIB_DEPS = -L$(LIB_DIR) -L${PREFIX}/lib -L${X11PREFIX}/lib -lXext -lXmu -lXi -lX11 -lm
-+
+--- src/mesa/drivers/dri/Makefile.template.orig 2007-12-18 19:05:46.000000000 -0500
++++ src/mesa/drivers/dri/Makefile.template
+@@ -1,6 +1,6 @@
+ # -*-makefile-*-
+
+-MESA_MODULES = $(TOP)/src/mesa/libmesa.a
++MESA_MODULES = $(TOP)/src/mesa/libmesa.la
+
+ COMMON_SOURCES = \
+ ../../common/driverfuncs.c \
+@@ -61,25 +61,22 @@ SHARED_INCLUDES = \
+ ##### RULES #####
+
+ .c.o:
+- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c -prefer-pic \
++ $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $(@:.o=.lo)
+
+ .S.o:
+- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+-
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c -prefer-pic \
++ $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $(@:.o=.lo)
+
+ ##### TARGETS #####
+
+-default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
+-
+-
+-$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
+- $(TOP)/bin/mklib -ldflags '$(LDFLAGS)' -noprefix -o $@ \
+- $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
+-
++default: depend symlinks $(TOP)/$(LIB_DIR)/$(LIBNAME)
+
+-$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
+
++$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
++ $(LIBTOOL) --mode=link $(CC) -o $(TOP)/$(LIB_DIR)/$(LIBNAME:.so=.la) \
++ $(OBJECTS:.o=.lo) $(WINOBJ:.o=.lo) $(DRI_LIB_DEPS) \
++ $(MESA_MODULES:.a=.la) -rpath $(PREFIX)/lib -module -avoid-version
+
+ depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
+ touch depend
+@@ -98,9 +95,11 @@ clean:
+ -rm -f depend depend.bak
+
+
+-install: $(LIBNAME)
+- $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
+- $(INSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
++install: $(TOP)/$(LIB_DIR)/$(LIBNAME)
++ $(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
++ $(LIBTOOL) --mode=install \
++ $(BSD_INSTALL_LIB) $(TOP)/$(LIB_DIR)/$(LIBNAME:.so=.la) \
++ $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
+
+
+ include depend
diff --git a/graphics/MesaLib/patches/patch-aj b/graphics/MesaLib/patches/patch-aj
index 817f6e3608e..ede93f975fa 100644
--- a/graphics/MesaLib/patches/patch-aj
+++ b/graphics/MesaLib/patches/patch-aj
@@ -1,22 +1,26 @@
-$NetBSD: patch-aj,v 1.4 2007/08/13 11:18:47 seb Exp $
+$NetBSD: patch-aj,v 1.5 2008/04/24 07:40:24 bjs Exp $
---- src/mesa/drivers/x11/xmesaP.h.orig 2005-10-04 23:00:36.000000000 +0200
-+++ src/mesa/drivers/x11/xmesaP.h
-@@ -30,7 +30,7 @@
- #ifdef XFree86Server
- # include "GL/xf86glx.h"
- # include "xf86glx_util.h"
--#elif defined(USE_XSHM)
-+#elif defined(USE_XSHM) || defined(USE_XSHM_HDRONLY)
- # include <X11/extensions/XShm.h>
- #endif
- #include "GL/xmesa.h"
-@@ -218,7 +218,7 @@ struct xmesa_buffer {
- /* 0 = not available */
- /* 1 = XImage support available */
- /* 2 = Pixmap support available too */
--#ifdef USE_XSHM
-+#if defined(USE_XSHM) || defined(USE_XSHM_HDRONLY)
- XShmSegmentInfo shminfo;
- #endif
- #endif
+--- src/mesa/x86/Makefile.orig 2007-06-21 18:10:55.000000000 -0400
++++ src/mesa/x86/Makefile
+@@ -21,11 +21,19 @@ clean:
+
+
+ gen_matypes: gen_matypes.c
+- $(CC) $(INCLUDE_DIRS) $(CFLAGS) gen_matypes.c -o gen_matypes
++ $(LIBTOOL) --mode=link --tag=CC \
++ $(CC) $(INCLUDE_DIRS) $(CFLAGS) -no-install \
++ gen_matypes.c -o gen_matypes
+
+ # need some special rules here, unfortunately
++ifdef CROSS_COMPILING
++matypes.h: ../main/mtypes.h ../tnl/t_context.h gen_matypes.c
++ CFLAGS="${INCLUDE_DIRS} ${CFLAGS}" \
++ $(LIBTOOL) --mode=execute ./gen_matypes.sh > matypes.h
++else
+ matypes.h: ../main/mtypes.h ../tnl/t_context.h gen_matypes
+- ./gen_matypes > matypes.h
++ $(LIBTOOL) --mode=execute ./gen_matypes > matypes.h
++endif
+
+ common_x86_asm.o: matypes.h
+ 3dnow_normal.o: matypes.h
diff --git a/graphics/MesaLib/patches/patch-ak b/graphics/MesaLib/patches/patch-ak
index ab994973c9d..242f8a41962 100644
--- a/graphics/MesaLib/patches/patch-ak
+++ b/graphics/MesaLib/patches/patch-ak
@@ -1,17 +1,22 @@
-$NetBSD: patch-ak,v 1.5 2007/01/24 19:55:01 tv Exp $
+$NetBSD: patch-ak,v 1.6 2008/04/24 07:40:24 bjs Exp $
---- src/mesa/main/glheader.h.orig 2005-11-27 13:16:31.000000000 -0500
-+++ 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
+--- 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
- # include <inttypes.h>
- #endif
+@@ -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
index 336475d77dd..8e45040ab1c 100644
--- a/graphics/MesaLib/patches/patch-al
+++ b/graphics/MesaLib/patches/patch-al
@@ -1,11 +1,8 @@
-$NetBSD: patch-al,v 1.3 2007/08/13 11:18:47 seb Exp $
+$NetBSD: patch-al,v 1.4 2008/04/24 07:40:24 bjs Exp $
-Declarations inside of macros are evil. Even more if they are not preceded
-by an additional opening brace.
-
---- src/mesa/drivers/x11/xm_tri.c.orig Tue Jan 31 22:16:56 2006
-+++ src/mesa/drivers/x11/xm_tri.c Tue Jan 31 22:30:15 2006
-@@ -64,7 +64,7 @@
+--- 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);
@@ -14,7 +11,7 @@ by an additional opening brace.
GLint x = span.x, y = YFLIP(xrb, span.y); \
GLuint i; \
for (i = 0; i < span.end; i++, x++) { \
-@@ -80,7 +80,7 @@
+@@ -82,7 +82,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -23,7 +20,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -99,7 +99,7 @@
+@@ -102,7 +102,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -32,16 +29,16 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -112,7 +112,7 @@
- span.green += span.greenStep; \
+@@ -117,7 +117,7 @@
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
span.z += span.zStep; \
- }
+ } }
#include "swrast/s_tritemp.h"
-@@ -131,7 +131,7 @@
+@@ -137,7 +137,7 @@
#define SETUP_CODE \
GET_XRB(xrb);
@@ -50,16 +47,16 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -144,7 +144,7 @@
- span.green += span.greenStep; \
+@@ -152,7 +152,7 @@
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
span.z += span.zStep; \
- }
+ } }
#include "swrast/s_tritemp.h"
-@@ -163,7 +163,7 @@
+@@ -171,7 +171,7 @@
#define SETUP_CODE \
GET_XRB(xrb);
@@ -68,7 +65,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -176,7 +176,7 @@
+@@ -184,7 +184,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -77,16 +74,16 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -194,7 +194,7 @@
+@@ -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 ) { \
++#define RENDER_SPAN( span ) { \
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -209,7 +209,7 @@
+@@ -217,7 +217,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -95,7 +92,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -224,7 +224,7 @@
+@@ -232,7 +232,7 @@
#define SETUP_CODE \
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb);
@@ -104,7 +101,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -240,7 +240,7 @@
+@@ -248,7 +248,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -113,7 +110,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -257,7 +257,7 @@
+@@ -265,7 +265,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -122,7 +119,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -270,7 +270,7 @@
+@@ -278,7 +278,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -131,7 +128,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -288,7 +288,7 @@
+@@ -296,7 +296,7 @@
#define SETUP_CODE \
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb);
@@ -140,7 +137,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -302,7 +302,7 @@
+@@ -310,7 +310,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -149,7 +146,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -319,7 +319,7 @@
+@@ -327,7 +327,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -158,7 +155,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
XDITHER_SETUP(y); \
-@@ -334,7 +334,7 @@
+@@ -342,7 +342,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -167,7 +164,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -349,7 +349,7 @@
+@@ -357,7 +357,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -176,7 +173,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
XDITHER_SETUP(y); \
-@@ -365,7 +365,7 @@
+@@ -373,7 +373,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -185,7 +182,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -382,7 +382,7 @@
+@@ -390,7 +390,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -194,7 +191,7 @@ by an additional opening brace.
GLuint i; \
LOOKUP_SETUP; \
for (i = 0; i < span.end; i++) { \
-@@ -396,7 +396,7 @@
+@@ -404,7 +404,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -203,7 +200,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -414,7 +414,7 @@
+@@ -422,7 +422,7 @@
#define SETUP_CODE \
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb);
@@ -212,7 +209,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -428,7 +428,7 @@
+@@ -436,7 +436,7 @@
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
@@ -221,7 +218,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -445,7 +445,7 @@
+@@ -453,7 +453,7 @@
XMesaImage *img = xrb->ximage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
@@ -230,7 +227,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -455,7 +455,7 @@
+@@ -463,7 +463,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -239,16 +236,16 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -472,7 +472,7 @@
- #define SETUP_CODE \
+@@ -481,7 +481,7 @@
GET_XRB(xrb); \
- GLuint p = PACK_8B8G8R( v2->color[0], v2->color[1], v2->color[2] );
+ 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); \
-@@ -481,7 +481,7 @@
+@@ -490,7 +490,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -257,16 +254,16 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -498,7 +498,7 @@
- #define SETUP_CODE \
+@@ -508,7 +508,7 @@
GET_XRB(xrb); \
- GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
+ 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); \
-@@ -507,7 +507,7 @@
+@@ -517,7 +517,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -275,7 +272,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -524,7 +524,7 @@
+@@ -534,7 +534,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
@@ -284,7 +281,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -533,7 +533,7 @@
+@@ -543,7 +543,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -293,7 +290,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -551,7 +551,7 @@
+@@ -561,7 +561,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = v2->color;
@@ -302,7 +299,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -563,7 +563,7 @@
+@@ -573,7 +573,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -311,7 +308,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -578,7 +578,7 @@
+@@ -588,7 +588,7 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -320,7 +317,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -591,7 +591,7 @@
+@@ -601,7 +601,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -329,7 +326,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -608,7 +608,7 @@
+@@ -618,7 +618,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
GLushort p = PACK_5R6G5B( v2->color[0], v2->color[1], v2->color[2] );
@@ -338,7 +335,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -617,7 +617,7 @@
+@@ -627,7 +627,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -347,7 +344,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -635,7 +635,7 @@
+@@ -645,7 +645,7 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
const GLubyte *color = v2->color;
@@ -356,7 +353,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -646,7 +646,7 @@
+@@ -656,7 +656,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -365,7 +362,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -663,7 +663,7 @@
+@@ -673,7 +673,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
@@ -374,7 +371,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \
-@@ -674,7 +674,7 @@
+@@ -684,7 +684,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -383,7 +380,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -689,7 +689,7 @@
+@@ -699,7 +699,7 @@
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
@@ -392,7 +389,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
FLAT_DITHER_ROW_SETUP(y); \
-@@ -701,7 +701,7 @@
+@@ -711,7 +711,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -401,7 +398,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -721,7 +721,7 @@
+@@ -731,7 +731,7 @@
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
@@ -410,7 +407,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -731,7 +731,7 @@
+@@ -741,7 +741,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -419,7 +416,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -752,7 +752,7 @@
+@@ -762,7 +762,7 @@
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2]; \
GLubyte p = LOOKUP(r,g,b);
@@ -428,7 +425,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
-@@ -761,7 +761,7 @@
+@@ -771,7 +771,7 @@
zRow[i] = z; \
} \
span.z += span.zStep; \
@@ -437,7 +434,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -775,7 +775,7 @@
+@@ -785,7 +785,7 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -446,7 +443,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -786,7 +786,7 @@
+@@ -796,7 +796,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -455,7 +452,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -801,7 +801,7 @@
+@@ -812,7 +812,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -463,17 +460,17 @@ by an additional opening brace.
+#define RENDER_SPAN( span ) { \
GLuint i; \
for (i = 0; i < span.end; i++) { \
- pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
-@@ -809,7 +809,7 @@
- span.red += span.redStep; \
+ 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"
-@@ -824,7 +824,7 @@
+@@ -838,7 +838,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -481,17 +478,17 @@ by an additional opening brace.
+#define RENDER_SPAN( span ) { \
GLuint i; \
for (i = 0; i < span.end; i++) { \
- pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
-@@ -832,7 +832,7 @@
- span.red += span.redStep; \
+ 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"
-@@ -847,7 +847,7 @@
+@@ -863,7 +863,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -500,7 +497,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
-@@ -855,7 +855,7 @@
+@@ -871,7 +871,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -509,7 +506,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -870,7 +870,7 @@
+@@ -886,7 +886,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -518,7 +515,7 @@ by an additional opening brace.
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
for (i = 0; i < span.end; i++, pixel++) { \
-@@ -880,7 +880,7 @@
+@@ -896,7 +896,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -527,7 +524,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -894,7 +894,7 @@
+@@ -910,7 +910,7 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -536,7 +533,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -905,7 +905,7 @@
+@@ -921,7 +921,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -545,7 +542,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -920,7 +920,7 @@
+@@ -936,7 +936,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -554,7 +551,7 @@ by an additional opening brace.
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) PACK_5R6G5B(FixedToInt(span.red), \
-@@ -928,7 +928,7 @@
+@@ -944,7 +944,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -563,7 +560,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -944,7 +944,7 @@
+@@ -960,7 +960,7 @@
#define SETUP_CODE \
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb);
@@ -572,7 +569,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -953,7 +953,7 @@
+@@ -969,7 +969,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -581,7 +578,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -968,7 +968,7 @@
+@@ -984,7 +984,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -590,7 +587,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
XDITHER_SETUP(y); \
-@@ -978,7 +978,7 @@
+@@ -994,7 +994,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -599,7 +596,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -991,7 +991,7 @@
+@@ -1007,7 +1007,7 @@
#define SETUP_CODE \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -608,7 +605,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
XDITHER_SETUP(y); \
-@@ -1002,7 +1002,7 @@
+@@ -1018,7 +1018,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -617,7 +614,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1017,7 +1017,7 @@
+@@ -1033,7 +1033,7 @@
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb);
@@ -626,7 +623,7 @@ by an additional opening brace.
GLuint i; \
LOOKUP_SETUP; \
for (i = 0; i < span.end; i++) { \
-@@ -1026,7 +1026,7 @@
+@@ -1042,7 +1042,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -635,7 +632,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1042,7 +1042,7 @@
+@@ -1058,7 +1058,7 @@
#define SETUP_CODE \
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb);
@@ -644,7 +641,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -1051,7 +1051,7 @@
+@@ -1067,7 +1067,7 @@
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
@@ -653,7 +650,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1066,12 +1066,12 @@
+@@ -1082,12 +1082,12 @@
XMesaImage *img = xrb->ximage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
@@ -668,7 +665,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1087,11 +1087,11 @@
+@@ -1103,11 +1103,11 @@
GET_XRB(xrb); \
unsigned long p = PACK_8B8G8R( v2->color[0], \
v2->color[1], v2->color[2] );
@@ -682,7 +679,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1107,11 +1107,11 @@
+@@ -1123,11 +1123,11 @@
GET_XRB(xrb); \
unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
@@ -696,7 +693,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1127,11 +1127,11 @@
+@@ -1143,11 +1143,11 @@
GET_XRB(xrb); \
unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
@@ -710,7 +707,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1146,14 +1146,14 @@
+@@ -1162,14 +1162,14 @@
#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = v2->color;
@@ -727,7 +724,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1166,7 +1166,7 @@
+@@ -1182,7 +1182,7 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage;
@@ -736,7 +733,7 @@ by an additional opening brace.
GLuint i; \
GLint x = span.x, y = YFLIP(xrb, span.y); \
for (i = 0; i < span.end; i++, x++) { \
-@@ -1174,7 +1174,7 @@
+@@ -1190,7 +1190,7 @@
PACK_TRUEDITHER(p, x, y, v2->color[0], \
v2->color[1], v2->color[2] ); \
XMesaPutPixel(img, x, y, p); \
@@ -745,7 +742,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1190,11 +1190,11 @@
+@@ -1206,11 +1206,11 @@
GET_XRB(xrb); \
unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
@@ -759,7 +756,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1210,13 +1210,13 @@
+@@ -1226,13 +1226,13 @@
XMesaContext xmesa = XMESA_CONTEXT(ctx); \
GET_XRB(xrb); \
const GLubyte *color = v2->color;
@@ -775,7 +772,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1231,13 +1231,13 @@
+@@ -1247,13 +1247,13 @@
#define SETUP_CODE \
GET_XRB(xrb); \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
@@ -791,7 +788,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1250,14 +1250,14 @@
+@@ -1266,14 +1266,14 @@
GET_XRB(xrb); \
XMesaImage *img = xrb->ximage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
@@ -808,7 +805,7 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1275,12 +1275,12 @@
+@@ -1291,12 +1291,12 @@
GLubyte r = v2->color[0]; \
GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
@@ -823,12 +820,12 @@ by an additional opening brace.
#include "swrast/s_tritemp.h"
-@@ -1299,11 +1299,11 @@
+@@ -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 ) { \
++#define RENDER_SPAN( span ) { \
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) p; \
diff --git a/graphics/MesaLib/patches/patch-am b/graphics/MesaLib/patches/patch-am
index a624269c3c5..0b291372536 100644
--- a/graphics/MesaLib/patches/patch-am
+++ b/graphics/MesaLib/patches/patch-am
@@ -1,26 +1,14 @@
-$NetBSD: patch-am,v 1.7 2007/08/13 11:18:47 seb Exp $
+$NetBSD: patch-am,v 1.8 2008/04/24 07:40:24 bjs Exp $
---- include/GL/glxext.h.orig 2005-11-07 22:20:29.000000000 +0100
-+++ include/GL/glxext.h
-@@ -331,10 +331,10 @@ typedef struct {
- } GLXBufferClobberEventSGIX;
+--- src/mesa/drivers/x11/xmesaP.h.orig 2007-11-01 11:30:52.000000000 -0400
++++ src/mesa/drivers/x11/xmesaP.h
+@@ -228,7 +228,8 @@ struct xmesa_buffer {
+ /* 0 = not available */
+ /* 1 = XImage support available */
+ /* 2 = Pixmap support available too */
+-#if defined(USE_XSHM) && !defined(XFree86Server)
++#if (defined(USE_XSHM) || defined(USE_XSHM_HDRONLY)) && \
++ !defined(XFree86Server)
+ XShmSegmentInfo shminfo;
#endif
--#if defined(__sun__)
-+#if defined(__sun__) || defined(__digital__)
- #include <inttypes.h>
- #if defined(__STDC__)
--#if defined(__arch64__)
-+#if defined(__arch64__) || defined(_LP64)
- typedef long int int64_t;
- #else
- typedef long long int int64_t;
-@@ -343,7 +343,7 @@ typedef long long int int64_t;
- #elif defined(__UNIXOS2__) || defined(__SOL64__)
- typedef long int int32_t;
- typedef long long int int64_t;
--#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-an b/graphics/MesaLib/patches/patch-an
new file mode 100644
index 00000000000..e1d38aa10d2
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-an
@@ -0,0 +1,17 @@
+$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
new file mode 100644
index 00000000000..a313f5a15e0
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-ao
@@ -0,0 +1,28 @@
+$NetBSD: patch-ao,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+--- src/mesa/x86/common_x86.c.orig 2007-07-12 16:49:55.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__)
++#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__NetBSD__))
+ #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
new file mode 100644
index 00000000000..61b7e38a61e
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-ap
@@ -0,0 +1,63 @@
+$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-aq b/graphics/MesaLib/patches/patch-aq
new file mode 100644
index 00000000000..fb0f7f95dd8
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-aq
@@ -0,0 +1,23 @@
+$NetBSD: patch-aq,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+--- src/mesa/main/imports.h.orig 2008-03-19 19:25:18.000000000 -0400
++++ src/mesa/main/imports.h
+@@ -292,7 +292,7 @@ static INLINE int GET_FLOAT_BITS( float
+ *** LDEXPF: multiply value by an integral power of two
+ *** FREXPF: extract mantissa and exponent from value
+ ***/
+-#if defined(__gnu_linux__)
++#if defined(USE_NATIVE_LIBM_FUNCS)
+ /* C99 functions */
+ #define CEILF(x) ceilf(x)
+ #define FLOORF(x) floorf(x)
+@@ -515,7 +515,9 @@ static INLINE int iceil(float f)
+ /* Hardware default: All exceptions masked, extended double precision,
+ * round to nearest (IEEE compliant):
+ */
++#ifndef DEFAULT_X86_FPU
+ #define DEFAULT_X86_FPU 0x037f
++#endif
+ /* All exceptions masked, single precision, round to nearest:
+ */
+ #define FAST_X86_FPU 0x003f
diff --git a/graphics/MesaLib/patches/patch-at b/graphics/MesaLib/patches/patch-at
new file mode 100644
index 00000000000..ad4786d2fe3
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-at
@@ -0,0 +1,33 @@
+$NetBSD: patch-at,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+--- src/glx/x11/Makefile.orig 2007-11-01 11:30:52.000000000 -0400
++++ src/glx/x11/Makefile
+@@ -53,10 +53,12 @@ INCLUDES = -I. \
+ ##### RULES #####
+
+ .c.o:
+- $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(INCLUDES) \
++ $(CFLAGS) $(EXTRA_DEFINES) $< -o $(@:.o=.lo)
+
+ .S.o:
+- $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(INCLUDES) \
++ $(CFLAGS) $(EXTRA_DEFINES) $< -o $(@:.o=.lo)
+
+ ##### TARGETS #####
+
+@@ -64,9 +66,10 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_L
+
+ # Make libGL
+ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
+- $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+- -major 1 -minor 2 $(MKLIB_OPTIONS) \
+- -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
++ $(LIBTOOL) --mode=link $(CC) \
++ -o $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME:.so=.la) \
++ $(LDFLAGS) -version-info 1:2 $(GL_LIB_DEPS) \
++ -rpath $(PREFIX)/lib $(OBJECTS:.o=.lo)
+
+
+ depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile
diff --git a/graphics/MesaLib/patches/patch-au b/graphics/MesaLib/patches/patch-au
new file mode 100644
index 00000000000..284830f9cbe
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-au
@@ -0,0 +1,68 @@
+$NetBSD: patch-au,v 1.1 2008/04/24 07:40:24 bjs Exp $
+
+--- src/mesa/shader/slang/library/Makefile.orig 2007-06-21 18:10:54.000000000 -0400
++++ src/mesa/shader/slang/library/Makefile
+@@ -28,26 +28,26 @@ builtin: builtin_110 builtin_120
+ #
+
+ syn_to_c: syn_to_c.c
+- $(CC) syn_to_c.c -o syn_to_c
++ $(LIBTOOL) --mode=link $(CC) syn_to_c.c -o syn_to_c -no-install
+
+ gc_to_bin: gc_to_bin.c slang_shader_syn.h
+- $(CC) gc_to_bin.c -o gc_to_bin
++ $(LIBTOOL) --mode=link $(CC) gc_to_bin.c -o gc_to_bin -no-install
+
+ #
+ # syntax scripts
+ #
+
+ slang_pp_directives_syn.h: syn_to_c slang_pp_directives.syn
+- ./syn_to_c slang_pp_directives.syn > slang_pp_directives_syn.h
++ $(LIBTOOL) --mode=execute ./syn_to_c slang_pp_directives.syn > slang_pp_directives_syn.h
+
+ slang_pp_expression_syn.h: syn_to_c slang_pp_expression.syn
+- ./syn_to_c slang_pp_expression.syn > slang_pp_expression_syn.h
++ $(LIBTOOL) --mode=execute ./syn_to_c slang_pp_expression.syn > slang_pp_expression_syn.h
+
+ slang_shader_syn.h: syn_to_c slang_shader.syn
+- ./syn_to_c slang_shader.syn > slang_shader_syn.h
++ $(LIBTOOL) --mode=execute ./syn_to_c slang_shader.syn > slang_shader_syn.h
+
+ slang_pp_version_syn.h: syn_to_c slang_pp_version.syn
+- ./syn_to_c slang_pp_version.syn > slang_pp_version_syn.h
++ $(LIBTOOL) --mode=execute ./syn_to_c slang_pp_version.syn > slang_pp_version_syn.h
+
+ #
+ # builtin library sources
+@@ -59,23 +59,23 @@ builtin_120: slang_120_core_gc.h slang_b
+
+
+ slang_120_core_gc.h: gc_to_bin slang_120_core.gc
+- ./gc_to_bin 1 slang_120_core.gc slang_120_core_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_120_core.gc slang_120_core_gc.h
+
+ slang_builtin_120_common_gc.h: gc_to_bin slang_builtin_120_common.gc
+- ./gc_to_bin 1 slang_builtin_120_common.gc slang_builtin_120_common_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_builtin_120_common.gc slang_builtin_120_common_gc.h
+
+ slang_builtin_120_fragment_gc.h: gc_to_bin slang_builtin_120_fragment.gc
+- ./gc_to_bin 1 slang_builtin_120_fragment.gc slang_builtin_120_fragment_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_builtin_120_fragment.gc slang_builtin_120_fragment_gc.h
+
+ slang_common_builtin_gc.h: gc_to_bin slang_common_builtin.gc
+- ./gc_to_bin 1 slang_common_builtin.gc slang_common_builtin_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_common_builtin.gc slang_common_builtin_gc.h
+
+ slang_core_gc.h: gc_to_bin slang_core.gc
+- ./gc_to_bin 1 slang_core.gc slang_core_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_core.gc slang_core_gc.h
+
+ slang_fragment_builtin_gc.h: gc_to_bin slang_fragment_builtin.gc
+- ./gc_to_bin 1 slang_fragment_builtin.gc slang_fragment_builtin_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 1 slang_fragment_builtin.gc slang_fragment_builtin_gc.h
+
+ slang_vertex_builtin_gc.h: gc_to_bin slang_vertex_builtin.gc
+- ./gc_to_bin 2 slang_vertex_builtin.gc slang_vertex_builtin_gc.h
++ $(LIBTOOL) --mode=execute ./gc_to_bin 2 slang_vertex_builtin.gc slang_vertex_builtin_gc.h
+
diff --git a/graphics/MesaLib/patches/patch-cb b/graphics/MesaLib/patches/patch-cb
index 27d6d0c8a0e..11ec516a970 100644
--- a/graphics/MesaLib/patches/patch-cb
+++ b/graphics/MesaLib/patches/patch-cb
@@ -1,15 +1,20 @@
-$NetBSD: patch-cb,v 1.1 2007/08/06 13:47:39 joerg Exp $
+$NetBSD: patch-cb,v 1.2 2008/04/24 07:40:24 bjs Exp $
---- src/mesa/x86-64/Makefile.orig 2007-08-06 05:47:48.000000000 +0200
+--- src/mesa/x86-64/Makefile.orig 2007-06-21 18:10:54.000000000 -0400
+++ src/mesa/x86-64/Makefile
-@@ -23,7 +23,8 @@ clean:
+@@ -23,7 +23,14 @@ clean:
# need some special rules here, unfortunately
--matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/gen_matypes
++ifdef CROSS_COMPILING
+ matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/gen_matypes
- ../x86/gen_matypes | grep -v '#include "assyntax.h' > matypes.h
-+matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/matypes.h
-+ cd ../x86 && ${MAKE} matypes.h
-+ grep -v '#include "assyntax.h' < ../x86/matypes.h > matypes.h
++ CFLAGS="${INCLUDE_DIRS} ${CFLAGS}" $(LIBTOOL) --mode=execute \
++ ../x86/gen_matypes.sh | grep -v '#include "assyntax.h"' > matypes.h
++else
++matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/gen_matypes
++ $(LIBTOOL) --mode=execute ../x86/gen_matypes | \
++ grep -v '#include "assyntax.h"' > matypes.h
++endif
xform4.o: matypes.h
diff --git a/graphics/glu/DESCR b/graphics/glu/DESCR
index 1c9542961f1..469c3f16fc2 100644
--- a/graphics/glu/DESCR
+++ b/graphics/glu/DESCR
@@ -1,11 +1,7 @@
-This is the GLU polygon tessellation facility for Mesa implemented by Bogdan
-Sikorski. The tessellation module is provided under the same terms as the
-Mesa package.
-
-This software tries to be fully compliant with the OpenGL routines. By
-"tries" I mean that up to my knowledge it behaves as OpenGL tessellation
-routines. However, the author makes no claim that Mesa is in any way a
+Mesa is a 3-D graphics library with an API which is very similar to that
+of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax
+or state machine, it is being used with authorization from Silicon Graphics,
+Inc. However, the author makes no claim that Mesa is in any way a
compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
-Those who want a licensed implementation of OpenGL should contact a licensed
-vendor. This software is distributed under the terms of the GNU Library
-General Public License, see the LICENSE file for details.
+
+This is the GLUT part of the MesaDemos distribution.
diff --git a/graphics/glu/Makefile b/graphics/glu/Makefile
index 72c146cc652..53c78da9e60 100644
--- a/graphics/glu/Makefile
+++ b/graphics/glu/Makefile
@@ -1,27 +1,19 @@
-# $NetBSD: Makefile,v 1.50 2007/08/13 11:18:48 seb Exp $
+# $NetBSD: Makefile,v 1.51 2008/04/24 07:40:23 bjs Exp $
-PKGNAME= glu-${MESA_VERSION}
+PKGNAME= glu-${MESA_PKGVERSION}
COMMENT= GLU polygon tessellation facility for Mesa
CONFLICTS+= Mesa-glx-[0-9]*
CONFLICTS+= Mesa<3.2.1
-.include "../../graphics/Mesa/Makefile.lib"
+MESA_HEADERS= glu.h glu_mangle.h
-INSTLIBS= ${WRKSRC}/src/glu/sgi/libGLU.la
+.include "../../graphics/Mesa/Makefile.lib"
BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=${MESA_VERSION}
.include "../../graphics/MesaLib/buildlink3.mk"
pre-build:
- cd ${WRKSRC} && ${RM} -fr src/mesa src/glut src/glw progs
-
-do-install:
- ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
- cd ${WRKSRC}/include/GL; for hdr in \
- glu.h glu_mangle.h; \
- do \
- ${INSTALL_DATA} $${hdr} ${DESTDIR}${PREFIX}/include/GL; \
- done
+ cd ${WRKSRC} && ${RM} -fr src/glx src/mesa src/glut src/glw progs
.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/glu/PLIST b/graphics/glu/PLIST
index 5f58e4a4f14..552e37c8791 100644
--- a/graphics/glu/PLIST
+++ b/graphics/glu/PLIST
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST,v 1.13 2004/09/22 08:09:33 jlam Exp $
+@comment $NetBSD: PLIST,v 1.14 2008/04/24 07:40:23 bjs Exp $
include/GL/glu.h
include/GL/glu_mangle.h
lib/libGLU.la
-@unexec ${RMDIR} %D/include/GL >/dev/null 2>&1 || ${TRUE}
+lib/pkgconfig/glu.pc
+@comment in graphics/MesaLib: @dirrm include/GL
diff --git a/graphics/glu/buildlink3.mk b/graphics/glu/buildlink3.mk
index 1d9d3bd8b3d..254ec529095 100644
--- a/graphics/glu/buildlink3.mk
+++ b/graphics/glu/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.31 2006/07/08 23:10:51 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.32 2008/04/24 07:40:23 bjs Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLU_BUILDLINK3_MK:= ${GLU_BUILDLINK3_MK}+
@@ -12,8 +12,9 @@ BUILDLINK_PACKAGES+= glu
BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}glu
.if !empty(GLU_BUILDLINK3_MK:M+)
-BUILDLINK_API_DEPENDS.glu+= glu>=3.4.2
+BUILDLINK_API_DEPENDS.glu+= glu>=3.4.2
BUILDLINK_ABI_DEPENDS.glu+= glu>=6.4.1nb1
+BUILDLINK_ABI_DEPENDS.glu+= glu>=7.0.3
BUILDLINK_PKGSRCDIR.glu?= ../../graphics/glu
.endif # GLU_BUILDLINK3_MK
diff --git a/graphics/glu/hacks.mk b/graphics/glu/hacks.mk
new file mode 100644
index 00000000000..48306f4ee64
--- /dev/null
+++ b/graphics/glu/hacks.mk
@@ -0,0 +1,6 @@
+# $NetBSD: hacks.mk,v 1.1 2008/04/24 07:40:24 bjs Exp $
+#
+.if !defined(GLU_HACKS_MK)
+GLU_HACKS_MK= # defined
+. include "../../graphics/MesaLib/hacks.mk"
+.endif
diff --git a/graphics/glut/Makefile b/graphics/glut/Makefile
index 4a34d9b819a..9e64f1b33e3 100644
--- a/graphics/glut/Makefile
+++ b/graphics/glut/Makefile
@@ -1,17 +1,17 @@
-# $NetBSD: Makefile,v 1.49 2007/08/13 11:18:48 seb Exp $
+# $NetBSD: Makefile,v 1.50 2008/04/24 07:40:24 bjs Exp $
-PKGNAME= glut-${MESA_VERSION}
+PKGNAME= glut-${MESA_PKGVERSION}
COMMENT= GLUT Graphics library similar to SGI's OpenGL
CONFLICTS+= Mesa-glx-[0-9]*
CONFLICTS+= Mesa<3.2.1
-.include "../../graphics/Mesa/Makefile.lib"
+MESA_HEADERS= glut.h glutf90.h
-BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=${MESA_VERSION}
-BUILDLINK_API_DEPENDS.glu+= glu>=${MESA_VERSION}
+.include "../../graphics/Mesa/Makefile.lib"
-INSTLIBS= ${WRKSRC}/src/glut/glx/libglut.la
+BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=${MESA_PKGVERSION}
+BUILDLINK_API_DEPENDS.glu+= glu>=${MESA_PKGVERSION}
.include "../../graphics/MesaLib/buildlink3.mk"
.include "../../x11/libXmu/buildlink3.mk"
@@ -19,14 +19,8 @@ INSTLIBS= ${WRKSRC}/src/glut/glx/libglut.la
.include "../../graphics/glu/buildlink3.mk"
pre-build:
- cd ${WRKSRC} && ${RM} -fr src/mesa src/glu src/glw progs
-
-do-install:
- ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
- cd ${WRKSRC}/include/GL; for hdr in \
- glut.h glutf90.h; \
- do \
- ${INSTALL_DATA} $${hdr} ${DESTDIR}${PREFIX}/include/GL; \
- done
+ cd ${WRKSRC} && ${RM} -fr src/mesa src/glu src/glx src/glw progs
+### XXX why is this needed?
+ mkdir -p ${WRKSRC}/src/glut/lib
.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/glut/PLIST b/graphics/glut/PLIST
index ad12bebf28f..c26054bec50 100644
--- a/graphics/glut/PLIST
+++ b/graphics/glut/PLIST
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST,v 1.11 2004/09/22 08:09:33 jlam Exp $
+@comment $NetBSD: PLIST,v 1.12 2008/04/24 07:40:24 bjs Exp $
include/GL/glut.h
include/GL/glutf90.h
lib/libglut.la
-@unexec ${RMDIR} %D/include/GL >/dev/null 2>&1 || ${TRUE}
+lib/pkgconfig/glut.pc
+@comment in graphics/MesaLib: @dirrm include/GL
diff --git a/graphics/glut/buildlink3.mk b/graphics/glut/buildlink3.mk
index d2329e4e7a3..b2db4ebcc0d 100644
--- a/graphics/glut/buildlink3.mk
+++ b/graphics/glut/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.15 2007/01/17 16:16:14 drochner Exp $
+# $NetBSD: buildlink3.mk,v 1.16 2008/04/24 07:40:24 bjs Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLUT_BUILDLINK3_MK:= ${GLUT_BUILDLINK3_MK}+
@@ -14,6 +14,7 @@ BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}glut
.if !empty(GLUT_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.glut+= glut>=3.4.2
BUILDLINK_ABI_DEPENDS.glut+= glut>=6.4.1nb1
+BUILDLINK_ABI_DEPENDS.glut+= glut>=7.0.3
BUILDLINK_PKGSRCDIR.glut?= ../../graphics/glut
.endif # GLUT_BUILDLINK3_MK
diff --git a/graphics/glut/hacks.mk b/graphics/glut/hacks.mk
new file mode 100644
index 00000000000..de123b57334
--- /dev/null
+++ b/graphics/glut/hacks.mk
@@ -0,0 +1,6 @@
+# $NetBSD: hacks.mk,v 1.1 2008/04/24 07:40:24 bjs Exp $
+#
+.if !defined(GLUT_HACKS_MK)
+GLUT_HACKS_MK= # defined
+. include "../../graphics/MesaLib/hacks.mk"
+.endif