Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.109 2015/09/15 00:24:26 tnn Exp $
# $NetBSD: Makefile,v 1.128 2016/07/09 13:03:49 wiz Exp $
DISTNAME= mesa-10.6.7
PKGREVISION= 2
DISTNAME= mesa-11.2.2
PKGNAME= ${DISTNAME:S/mesa/MesaLib/}
CATEGORIES= graphics x11
MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
@@ -13,7 +12,7 @@ COMMENT= The Mesa 3D Graphics Library
LICENSE= mit
GNU_CONFIGURE= yes
USE_TOOLS+= pkg-config gmake
USE_TOOLS+= bison pkg-config gmake flex
USE_LANGUAGES= c99 c++
USE_LIBTOOL= yes
@@ -31,6 +30,8 @@ PKGCONFIG_OVERRIDE+= src/mesa/drivers/dri/dri.pc.in
PKGCONFIG_OVERRIDE+= src/mesa/drivers/osmesa/osmesa.pc.in
PKGCONFIG_OVERRIDE+= src/mesa/gl.pc.in
CONFIGURE_ARGS+= --enable-shared-glapi
# Work around a buildlink and/or libtool bug:
# In the libtool install/relink stage, if we want to link with two static
# archives named libglapi.la but in different directories, bad things happen.
@@ -41,13 +42,13 @@ SUBST_FILES.wrapper-bug= src/gbm/Makefile.in
SUBST_FILES.wrapper-bug+= src/glx/Makefile.in
SUBST_FILES.wrapper-bug+= src/mapi/Makefile.in
SUBST_FILES.wrapper-bug+= src/mesa/drivers/x11/Makefile.in
SUBST_SED.wrapper-bug= -e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_shared.la,g'
SUBST_SED.wrapper-bug+= -e 's,libglapi.la,libglapi_static.la,g'
SUBST_SED.wrapper-bug+= -e 's,libglapi_shared.la,libglapi.la,g'
SUBST_SED.wrapper-bug= -e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_tmp_rename.la,g'
SUBST_SED.wrapper-bug+= -e 's,libglapi.la,libglapi_impl.la,g'
SUBST_SED.wrapper-bug+= -e 's,libglapi_tmp_rename.la,libglapi.la,g'
# Replace /etc/drirc with ${PREFIX}/etc/drirc
SUBST_CLASSES+= drirc
SUBST_STAGE.drirc= post-patch
SUBST_STAGE.drirc= pre-configure
SUBST_MESSAGE.drirc= Fixing hardcoded /etc/drirc references
SUBST_FILES.drirc+= src/mesa/drivers/dri/common/xmlconfig.c
SUBST_SED.drirc+= -e 's|/etc/|${PREFIX}/etc/|g'
@@ -67,8 +68,9 @@ SUBST_SED.tr1+= -e 's,include <tr1/,include <,g'
.endif
PYTHON_FOR_BUILD_ONLY= yes
PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # as of 10.6.7
PYTHON_VERSIONS_INCOMPATIBLE= 34 35 # as of 10.6.7
BUILD_DEPENDS+= ${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
CONFIGURE_ENV+= ac_cv_prog_PYTHON2=${PYTHONBIN}
.include "../../lang/python/tool.mk"
# On NetBSD < 6 we need to compile with GCC from pkgsrc.
@@ -85,6 +87,15 @@ CPPFLAGS+= -Dexp2\(x\)=exp\(\(x\)\*M_LN2\)
CPPFLAGS+= -Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
.endif
# Manual patch for FDO bug 90311. Don't apply if not on Darwin as there could
# be side effects.
.if ${OPSYS} == "Darwin"
pre-configure: ${WRKDIR}/.manual_patch_done
${WRKDIR}/.manual_patch_done:
cd ${WRKSRC} && ${TOOLS_PATCH} -z .manual -p0 < ${FILESDIR}/patch-manual_fdo90311
touch ${.TARGET}
.endif
INSTALLATION_DIRS+= share/examples/MesaLib
post-install:

View File

@@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.29 2015/09/11 15:30:35 tnn Exp $
@comment $NetBSD: PLIST,v 1.33 2016/02/23 14:40:36 tnn Exp $
${PLIST.dri}include/EGL/egl.h
${PLIST.dri}include/EGL/eglext.h
${PLIST.dri}include/EGL/eglextchromium.h
@@ -14,12 +14,28 @@ include/GL/glxext.h
${PLIST.dri}include/GL/internal/dri_interface.h
include/GL/osmesa.h
include/GL/wglext.h
${PLIST.dri}include/GLES/egl.h
${PLIST.dri}include/GLES/gl.h
${PLIST.dri}include/GLES/glext.h
${PLIST.dri}include/GLES/glplatform.h
${PLIST.dri}include/GLES2/gl2.h
${PLIST.dri}include/GLES2/gl2ext.h
${PLIST.dri}include/GLES2/gl2platform.h
${PLIST.dri}include/GLES3/gl3.h
${PLIST.dri}include/GLES3/gl31.h
${PLIST.dri}include/GLES3/gl3ext.h
${PLIST.dri}include/GLES3/gl3platform.h
${PLIST.dri}include/KHR/khrplatform.h
${PLIST.dri}include/gbm.h
${PLIST.gbm}include/gbm.h
${PLIST.xatracker}include/xa_composite.h
${PLIST.xatracker}include/xa_context.h
${PLIST.xatracker}include/xa_tracker.h
${PLIST.i915_dri}lib/dri/i915_dri.so
${PLIST.i965_dri}lib/dri/i965_dri.so
${PLIST.ilo}lib/dri/ilo_dri.so
${PLIST.freedreno}lib/dri/kgsl_dri.so
${PLIST.swrast}lib/dri/kms_swrast_dri.so
${PLIST.freedreno}lib/dri/msm_dri.so
${PLIST.nouveau}lib/dri/nouveau_dri.so
${PLIST.nouveau_dri}lib/dri/nouveau_vieux_dri.so
${PLIST.r200_dri}lib/dri/r200_dri.so
@@ -28,13 +44,22 @@ ${PLIST.r600}lib/dri/r600_dri.so
${PLIST.radeon_dri}lib/dri/radeon_dri.so
${PLIST.radeonsi}lib/dri/radeonsi_dri.so
${PLIST.swrast_dri}lib/dri/swrast_dri.so
${PLIST.vc4}lib/dri/vc4_dri.so
${PLIST.svga}lib/dri/vmwgfx_dri.so
${PLIST.dri}lib/libEGL.la
lib/libGL.la
${PLIST.dri}lib/libgbm.la
${PLIST.dri}lib/libglapi.la
${PLIST.dri}lib/libGLESv1_CM.la
${PLIST.dri}lib/libGLESv2.la
${PLIST.gbm}lib/libgbm.la
lib/libglapi.la
${PLIST.wayland}lib/libwayland-egl.la
${PLIST.xatracker}lib/libxatracker.la
${PLIST.dri}lib/pkgconfig/dri.pc
${PLIST.dri}lib/pkgconfig/egl.pc
${PLIST.dri}lib/pkgconfig/gbm.pc
${PLIST.gbm}lib/pkgconfig/gbm.pc
lib/pkgconfig/gl.pc
${PLIST.dri}lib/pkgconfig/glesv1_cm.pc
${PLIST.dri}lib/pkgconfig/glesv2.pc
${PLIST.wayland}lib/pkgconfig/wayland-egl.pc
${PLIST.xatracker}lib/pkgconfig/xatracker.pc
share/examples/MesaLib/drirc

View File

@@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.53 2015/09/16 12:28:53 tnn Exp $
# $NetBSD: buildlink3.mk,v 1.54 2015/09/27 21:58:03 tnn Exp $
BUILDLINK_TREE+= MesaLib
@@ -20,7 +20,7 @@ GCC_REQD+= 4.2
.endif
# See <http://developer.apple.com/qa/qa2007/qa1567.html>.
.if !empty(MACHINE_PLATFORM:MDarwin-[9].*-*)
.if ${X11_TYPE} == "native" && !empty(MACHINE_PLATFORM:MDarwin-[9].*-*)
BUILDLINK_LDFLAGS.MesaLib+= -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
.endif

View File

@@ -1,14 +1,17 @@
$NetBSD: distinfo,v 1.99 2015/09/11 16:27:30 tnn Exp $
$NetBSD: distinfo,v 1.117 2016/05/18 12:55:28 wiz Exp $
SHA1 (mesa-10.6.7.tar.xz) = c63008bf8f2b1022a60a82fa4f2200db6fbd956c
RMD160 (mesa-10.6.7.tar.xz) = cdf2062b98094afdb281da6b040484f66383a17a
Size (mesa-10.6.7.tar.xz) = 7041708 bytes
SHA1 (patch-configure) = 24d1ee6bf62cdea9c9356132f727b490679f0330
SHA1 (patch-include_EGL_eglplatform.h) = a20ee1690b2977d53a60c738e292b07c6f999e8d
SHA1 (mesa-11.2.2.tar.xz) = c3805020be6fef77d3b96a5ddf4ddc256dee16ff
RMD160 (mesa-11.2.2.tar.xz) = 14bca7cc76015e53db2fafcebb8540f451be5aab
SHA512 (mesa-11.2.2.tar.xz) = fd1fcb1bc97e52784a4b3dedfd8c8ba95bc1b03a62b132d2e16154d076be7a6fabbca1bcba705a7916a1507d811d7f3e6c3488aa386d5e63891282fb1713ce52
Size (mesa-11.2.2.tar.xz) = 7860932 bytes
SHA1 (patch-configure) = 87f0f2e60f342c91b3aecab02d3a4d8940eadf0a
SHA1 (patch-include_GL_glxext.h) = 830902f2d38a8395cda682c059fc5223e1b0e89e
SHA1 (patch-src_gallium_auxiliary_util_u__cpu__detect.c) = 5f4c3db54620739da0fe7dfb57c58728ecbbb6e0
SHA1 (patch-src_compiler_glsl_glsl__parser__extras.cpp) = c5046ce848d0b1ea428e29611b6822d4f4ab970d
SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = 99b6dd6739c29551ae2c885eabd7babd159fc3e5
SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 04b6ef8e755f226fbe3e6f2bea6c9e2a56a783ca
SHA1 (patch-src_egl_main_eglglobals.c) = 2d81ae27f09162d23bc684456cc5fef48c042652
SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = 4d5e4677c2825778c43440ab131b8807f6840975
SHA1 (patch-src_gallium_auxiliary_util_u__math.h) = 8dd195b29f6ba598260348194aca149f1ca057f9
SHA1 (patch-src_gallium_auxiliary_util_u__math.h) = 812e4a5291aea47e06505f09891e0434c4d9c34d
SHA1 (patch-src_gallium_auxiliary_util_u__network.c) = 283f505af780071dc9fd7914f8065e3fb7d8a4fd
SHA1 (patch-src_gallium_auxiliary_util_u__network.h) = c6106d67b4fa9db0d790474182d6e0ce0c5da677
SHA1 (patch-src_gallium_drivers_nouveau_codegen_nv50__ir__peephole.cpp) = 5fc2ef7eafac3006896af96bac8176c79b17cfdc
@@ -19,26 +22,30 @@ SHA1 (patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c) = 2358b7d5ea89e
SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen.c) = 4b2ae565377b1a0396c8bf6b2663c261592b8e5e
SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c) = e4b891e8b4ebe5b8e8c7b8c2c1dbed11b9c417df
SHA1 (patch-src_gbm_main_gbm.c) = 70225ab7352f123c9efc68b6d4ff0d9675b6f9dc
SHA1 (patch-src_glsl_ralloc.c) = 7443d00ff05ee1e1dcfa2b76972b55abadebcad8
SHA1 (patch-src_glsl_ralloc.c) = 63c8e40b9f74404033c20c5c9a00c5f6d8df6433
SHA1 (patch-src_glx_apple_apple__glapi.c) = df70afc24759978f954ac3a774a14e6518dde97a
SHA1 (patch-src_glx_glxclient.h) = e15256851559dafb7a86e1eb7e9d6afc86de581b
SHA1 (patch-src_glx_glxcurrent.c) = cad9128925aa68e169c241e3d747ec6e6a9d884e
SHA1 (patch-src_loader_Makefile.in) = b0475273e2fdd3379528a0d8d393236df131bb30
SHA1 (patch-src_loader_loader.c) = 4086fcee5030b6d6624c08894ace67c8889887ce
SHA1 (patch-src_mapi_entry__x86-64__tls.h) = c722ce4a22911d9a3d04e1a4fd6ab1a5ddd81cf0
SHA1 (patch-src_mapi_entry__x86__tls.h) = 51d6ef1aa3db69b23eea6fe145a54c0e7e265190
SHA1 (patch-src_glx_glxcurrent.c) = 713f75bcafb186c7123d19a6aae3deaed9d5fa69
SHA1 (patch-src_loader_Makefile.in) = 30454c207924183c881a84d31458fdc0ddb1680b
SHA1 (patch-src_loader_loader.c) = f99b13451f4f932031e876cd611ab746ec5caf1b
SHA1 (patch-src_mapi_entry__x86-64__tls.h) = e1cc896dd9cf7d77b837104557c0e0bf9d41ff55
SHA1 (patch-src_mapi_entry__x86__tls.h) = 3d6c11281b57c9c713899022bfc8fcea54d07d56
SHA1 (patch-src_mapi_entry__x86__tsd.h) = 62501b6e609fa81e33fd826a694e9d9752a7ba21
SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 53026e520a510e54494760a3fa05af6f15dfb9d8
SHA1 (patch-src_mapi_u__current.c) = 1731375d82119be326b35d141d7879e083d6d620
SHA1 (patch-src_mapi_u__current.h) = 214dd29cb0c4fe127eb1157b04b12ddfc455b4b0
SHA1 (patch-src_mesa_drivers_dri_Makefile.in) = 48032b8f8e6eac59092f68f3c32cfdd44d7ce8bf
SHA1 (patch-src_mesa_drivers_dri_common_Makefile.in) = 5e160f7d92c2e9f3fa36e52a082a496af67e634e
SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = 668cc1d6a58f8f02eb9eb32c1aeffb4bef7beaf4
SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = b87644c5ef5fb5d71c3260026d3afdfbaee749a8
SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fd8436e4e3a69250256c2cddf8138effb16bd7b3
SHA1 (patch-src_mesa_drivers_dri_i965_brw__context.h) = e0db31a3ea077531d922923c300d06d9e265283b
SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 7c1a1e5c549f64d4c390e0c87984c44a88d4abfe
SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = b8a6cca517e1cccbdb2c59cf67a6d2481cdfebd4
SHA1 (patch-src_mesa_main_context.c) = 30c3796865372aa16297c2aaa647ddb49958fa64
SHA1 (patch-src_mesa_main_context.c) = 695b0e04cbd08dfed46b4dae5f9602b35e21f5b3
SHA1 (patch-src_mesa_main_extensions.c) = d650d7ddfe22ddbcd8a4c24b64feb27126521ae0
SHA1 (patch-src_mesa_main_macros.h) = e0e98dff37bbf96fea2f3adf0dc9ef9911b711d9
SHA1 (patch-src_mesa_main_shader__query.cpp) = 6273c74161f045363c58f38adeb672287f6a0898
SHA1 (patch-src_mesa_tnl_t__pipeline.c) = afc7d5f27aeadacc7c6a762e5aa892e01a0c1317
SHA1 (patch-src_mesa_x86_common__x86.c) = bdac91384d67ad0238ecd4cdcf5cfc787952a3d9
SHA1 (patch-src_util_strndup.c) = b8dfae71f1b219e44f884b8fc6f89a86201353c3
SHA1 (patch-src_util_strndup.h) = a48a0ebefbc79a770db4baa590d3f858bb52cacf
SHA1 (patch-src_util_u__atomic.h) = 4a567b6fe5bf67fb7f386fa5f37bedb66d593085

View File

@@ -1,4 +1,4 @@
# $NetBSD: dri.mk,v 1.12 2015/09/11 00:03:36 tnn Exp $
# $NetBSD: dri.mk,v 1.16 2016/03/10 05:29:56 tnn Exp $
#
# Currently, this is for convenience only.
#
@@ -14,29 +14,31 @@ CHECK_BUILTIN.MesaLib:= no
. if !empty(USE_BUILTIN.MesaLib:M[Nn][Oo])
BUILDLINK_API_DEPENDS.dri2proto+= dri2proto>=2.1
BUILDLINK_API_DEPENDS.glproto+= glproto>=1.4.11
BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.24
. if ${OPSYS} != "Darwin"
BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.60
. endif
. if ${OPSYS} == "Linux"
BUILDLINK_API_DEPENDS.libxcb+= libxcb>=1.9.3
. endif
. endif
. include "../../textproc/expat/buildlink3.mk"
. include "../../x11/dri2proto/buildlink3.mk"
# XXX these do not have builtin.mk
. if ${X11_TYPE} == "modular"
. include "../../x11/dri3proto/buildlink3.mk"
. include "../../x11/libxshmfence/buildlink3.mk"
. include "../../x11/presentproto/buildlink3.mk"
. endif
. 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"
. if ${OPSYS} != "Darwin"
. include "../../x11/libdrm/buildlink3.mk"
. endif
. include "../../x11/xf86driproto/buildlink3.mk"
. include "../../x11/xf86vidmodeproto/buildlink3.mk"
# Linux supports dri3
. if ${OPSYS} == "Linux"
. if !empty(USE_BUILTIN.MesaLib:M[Nn][Oo])
BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.56
BUILDLINK_API_DEPENDS.libxcb+= libxcb>=1.9.3
. endif
. include "../../x11/dri3proto/buildlink3.mk"
. include "../../x11/presentproto/buildlink3.mk"
. include "../../x11/libxshmfence/buildlink3.mk"
. endif
. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
. include "../../x11/libxshmfence/buildlink3.mk"
. include "../../devel/libdevq/buildlink3.mk"
. endif
.endif

View File

@@ -0,0 +1,111 @@
$NetBSD: patch-manual_fdo90311,v 1.2 2016/01/18 17:59:01 jperkin Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=90311
Regenerated with autoconf to link with C++ linker using this addition:
libglx_la_LIBADD += $(builddir)/apple/libappleglx.la + $(top_builddir)/src/mesa/libmesa.la
nodist_EXTRA_lib@GL_LIB@_la_SOURCES = dummy.cpp
and then dummy.cpp manuallly edited out.
--- src/glx/Makefile.in.orig 2015-12-15 14:52:32.000000000 +0000
+++ src/glx/Makefile.in
@@ -143,7 +143,7 @@ target_triplet = @target@
@HAVE_APPLEDRI_TRUE@ applegl_glx.c
@HAVE_APPLEDRI_TRUE@am__append_7 = apple
-@HAVE_APPLEDRI_TRUE@am__append_8 = $(builddir)/apple/libappleglx.la
+@HAVE_APPLEDRI_TRUE@am__append_8 = $(builddir)/apple/libappleglx.la $(top_builddir)/src/mesa/libmesa.la
subdir = src/glx
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
@@ -202,10 +202,10 @@ AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
-lib@GL_LIB@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(lib@GL_LIB@_la_LDFLAGS) $(LDFLAGS) -o \
- $@
+lib@GL_LIB@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(lib@GL_LIB@_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
libglx_la_DEPENDENCIES = $(top_builddir)/src/loader/libloader.la \
$(am__append_5) $(am__append_8)
am__libglx_la_SOURCES_DIST = clientattrib.c clientinfo.c compsize.c \
@@ -276,6 +276,24 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
SOURCES = $(lib@GL_LIB@_la_SOURCES) $(libglx_la_SOURCES)
DIST_SOURCES = $(lib@GL_LIB@_la_SOURCES) $(am__libglx_la_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
@@ -696,7 +714,7 @@ lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
all: all-recursive
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .cpp .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/install-lib-links.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -775,7 +793,7 @@ clean-noinstLTLIBRARIES:
}
lib@GL_LIB@.la: $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_DEPENDENCIES) $(EXTRA_lib@GL_LIB@_la_DEPENDENCIES)
- $(AM_V_CCLD)$(lib@GL_LIB@_la_LINK) -rpath $(libdir) $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_LIBADD) $(LIBS)
+ $(AM_V_CXXLD)$(lib@GL_LIB@_la_LINK) -rpath $(libdir) $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_LIBADD) $(LIBS)
libglx.la: $(libglx_la_OBJECTS) $(libglx_la_DEPENDENCIES) $(EXTRA_libglx_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libglx_la_OBJECTS) $(libglx_la_LIBADD) $(LIBS)
@@ -852,6 +870,30 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
mostlyclean-libtool:
-rm -f *.lo

View File

@@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.41 2015/09/18 16:18:47 tnn Exp $
# $NetBSD: options.mk,v 1.49 2016/02/25 13:37:46 jperkin Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
PKG_SUPPORTED_OPTIONS= llvm dri
@@ -10,7 +10,8 @@ PKG_SUGGESTED_OPTIONS=
.if \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-sparc64)
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-sparc64) || \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-*arm*)
PKG_SUGGESTED_OPTIONS+= llvm
.endif
@@ -21,26 +22,40 @@ PKG_SUGGESTED_OPTIONS+= llvm
PKG_SUGGESTED_OPTIONS+= llvm
.endif
.if (${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \
.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \
${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \
${OPSYS} == "SunOS") || ${OPSYS} == "NetBSD"
${OPSYS} == "SunOS" || ${OPSYS} == "NetBSD" || \
${OPSYS} == "Darwin"
PKG_SUGGESTED_OPTIONS+= dri
.endif
.include "../../mk/bsd.options.mk"
# gallium
PLIST_VARS+= swrast svga ilo i915 i965 nouveau r300 r600 radeonsi
PLIST_VARS+= freedreno ilo i915 i965 nouveau r300 r600 radeonsi \
swrast svga vc4 virgl
# classic DRI
PLIST_VARS+= dri swrast_dri i915_dri nouveau_dri i965_dri radeon_dri r200_dri
PLIST_VARS+= dri swrast_dri i915_dri nouveau_dri i965_dri radeon_dri r200_dri
# other features
PLIST_VARS+= gbm wayland xatracker
.if !empty(PKG_OPTIONS:Mdri)
CONFIGURE_ARGS+= --enable-dri
CONFIGURE_ARGS+= --enable-egl
.if ${OPSYS} != "Darwin"
CFLAGS+= -DHAVE_DRI3
CONFIGURE_ARGS+= --enable-dri3
CONFIGURE_ARGS+= --enable-gbm
PLIST.gbm= yes
.endif
CONFIGURE_ARGS+= --enable-gles1
CONFIGURE_ARGS+= --enable-gles2
# Use Thread Local Storage in GLX where it is supported by Mesa and works.
.if \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \
!empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \
!empty(MACHINE_PLATFORM:MLinux-*-i386) || \
!empty(MACHINE_PLATFORM:MLinux-*-x86_64) || \
!empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \
@@ -50,31 +65,30 @@ CONFIGURE_ARGS+= --enable-glx-tls
CONFIGURE_ARGS+= --disable-glx-tls
.endif
# DRI on Linux needs either sysfs or udev
CONFIGURE_ARGS.Linux+= --enable-sysfs
PLIST.dri= yes
.if ${OPSYS} != "Darwin"
BUILDLINK_DEPMETHOD.libpciaccess= full
.include "../../sysutils/libpciaccess/buildlink3.mk"
.endif
.include "../../graphics/MesaLib/dri.mk"
# Linux supports dri3
.if ${OPSYS} == "Linux"
CONFIGURE_ARGS+= --enable-dri3
# DRI on Linux needs either sysfs or udev
CONFIGURE_ARGS+= --enable-sysfs
.else
CONFIGURE_ARGS+= --disable-dri3
.endif
DRI_DRIVERS= #
PLIST.swrast_dri= yes
DRI_DRIVERS+= swrast
GALLIUM_DRIVERS= #
# Software rasterizer
GALLIUM_DRIVERS= #
PLIST.swrast_dri= yes
DRI_DRIVERS+= swrast
.if ${OPSYS} != "Darwin"
PLIST.swrast= yes
GALLIUM_DRIVERS+= swrast
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
# x86 only drivers
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin"
# svga / VMWare driver
PLIST.svga= yes
GALLIUM_DRIVERS+= svga
@@ -93,14 +107,26 @@ PLIST.i965_dri= yes
DRI_DRIVERS+= i965
.endif
# ARM drivers
.if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
# Qualcomm SnapDragon, libdrm_freedreno.pc
# GALLIUM_DRIVERS+= freedreno
GALLIUM_DRIVERS+= freedreno
PLIST.freedreno= yes
# Broadcom VideoCore 4
# GALLIUM_DRIVERS+= vc4
GALLIUM_DRIVERS+= vc4
PLIST.vc4= yes
.endif
.else
# qemu Linux guest driver
.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
# XXX test this
#GALLIUM_DRIVERS+= virgl
#PLIST.virgl= yes
.endif
# theoretically cross platform PCI drivers, but don't build on ARM
.if ${OPSYS} != "Darwin" && empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
# AMD Radeon r600
PLIST.r600= yes
@@ -123,11 +149,23 @@ PLIST.nouveau_dri= yes
DRI_DRIVERS+= nouveau
.endif
.if ${OPSYS} == "Darwin"
CONFIGURE_ARGS+= --with-egl-platforms=x11
#.elif ${OPSYS} == "Linux"
#.include "../../wip/wayland/buildlink3.mk"
#CONFIGURE_ARGS+= --with-egl-platforms=x11,drm,wayland
#PLIST.wayland= yes
.else
CONFIGURE_ARGS+= --with-egl-platforms=x11,drm
.endif
CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,}
CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,}
.if !empty(PKG_OPTIONS:Mllvm)
# XA is useful for accelerating xf86-video-vmware
CONFIGURE_ARGS+= --enable-xa
PLIST.xatracker= yes
# AMD Radeon r300
PLIST.r300= yes
GALLIUM_DRIVERS+= r300
@@ -141,6 +179,7 @@ CPPFLAGS+= -I${BUILDLINK_PREFIX.libelf}/include/libelf
.include "../../lang/libLLVM/buildlink3.mk"
CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH}
.else # !llvm
CONFIGURE_ARGS+= --disable-xa
CONFIGURE_ARGS+= --disable-gallium-llvm
CONFIGURE_ARGS+= --disable-r600-llvm-compiler
.endif # llvm
@@ -150,6 +189,9 @@ CONFIGURE_ARGS+= --with-dri-drivers=
CONFIGURE_ARGS+= --disable-dri
CONFIGURE_ARGS+= --disable-dri3
CONFIGURE_ARGS+= --disable-egl
CONFIGURE_ARGS+= --disable-gbm
CONFIGURE_ARGS+= --disable-gles1
CONFIGURE_ARGS+= --disable-gles2
CONFIGURE_ARGS+= --enable-xlib-glx
.if !empty(PKG_OPTIONS:Mllvm)
PKG_FAIL_REASON+= "The llvm PKG_OPTION must also be disabled when dri is disabled"

View File

@@ -1,11 +1,10 @@
$NetBSD: patch-configure,v 1.2 2015/09/11 00:03:36 tnn Exp $
$NetBSD: patch-configure,v 1.5 2016/02/12 11:49:53 tnn Exp $
Make sure toolchain can assemble SSE stuff in addition to having intrinsics.
Add libdevq support from FreeBSD ports.
--- configure.orig 2015-09-04 22:02:51.000000000 +0000
--- configure.orig 2016-01-13 10:48:25.000000000 +0000
+++ configure
@@ -858,6 +858,8 @@ GLPROTO_LIBS
@@ -860,6 +860,8 @@ GLPROTO_LIBS
GLPROTO_CFLAGS
XLIBGL_LIBS
XLIBGL_CFLAGS
@@ -13,9 +12,9 @@ Add libdevq support from FreeBSD ports.
+LIBDEVQ_CFLAGS
LIBUDEV_LIBS
LIBUDEV_CFLAGS
MESA_LLVM
@@ -1154,6 +1156,8 @@ LIBDRM_CFLAGS
LIBDRM_LIBS
ENABLE_SHADER_CACHE_FALSE
@@ -1174,6 +1176,8 @@ OPENSSL_CFLAGS
OPENSSL_LIBS
LIBUDEV_CFLAGS
LIBUDEV_LIBS
+LIBDEVQ_CFLAGS
@@ -23,24 +22,15 @@ Add libdevq support from FreeBSD ports.
XLIBGL_CFLAGS
XLIBGL_LIBS
GLPROTO_CFLAGS
@@ -5231,6 +5235,7 @@ DRI2PROTO_REQUIRED=2.6
@@ -5287,6 +5291,7 @@ DRI2PROTO_REQUIRED=2.6
DRI3PROTO_REQUIRED=1.0
PRESENTPROTO_REQUIRED=1.0
LIBUDEV_REQUIRED=151
+LIBDEVQ_REQUIRED=0.0.2
GLPROTO_REQUIRED=1.4.14
LIBOMXIL_BELLAGIO_REQUIRED=0.0
LIBVA_REQUIRED=0.35.0
@@ -19694,7 +19699,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
#include <smmintrin.h>
int main () {
__m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
- c = _mm_max_epu32(a, b);
+ c = _mm_max_epu32(a, b); asm volatile ("movntdqa (%esi),%xmm3\n");
return 0;
}
_ACEOF
@@ -20466,7 +20471,7 @@ _ACEOF
LIBVA_REQUIRED=0.38.0
@@ -20727,7 +20732,7 @@ _ACEOF
$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
flag=no
case ${host_os} in
@@ -49,7 +39,7 @@ Add libdevq support from FreeBSD ports.
osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
@@ -21349,6 +21354,89 @@ else
@@ -22087,6 +22092,89 @@ else
fi
@@ -139,7 +129,7 @@ Add libdevq support from FreeBSD ports.
if test "x$enable_dri" = xyes; then
if test "$enable_static" = yes; then
as_fn_error $? "Cannot use static libraries for DRI drivers" "$LINENO" 5
@@ -22060,6 +22148,10 @@ if test "$have_sysfs" = yes; then
@@ -22889,6 +22977,10 @@ if test "$have_sysfs" = yes; then
DEFINES="$DEFINES -DHAVE_SYSFS"
have_pci_id=yes
fi
@@ -150,7 +140,7 @@ Add libdevq support from FreeBSD ports.
# This is outside the case (above) so that it is invoked even for non-GLX
# builds.
@@ -23002,6 +23094,8 @@ fi
@@ -23821,6 +23913,8 @@ fi
if test "x$need_pci_id$have_libudev" = xyesyes; then
GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
@@ -159,7 +149,7 @@ Add libdevq support from FreeBSD ports.
else
GBM_PC_REQ_PRIV=""
fi
@@ -24558,9 +24652,6 @@ fi
@@ -25468,9 +25562,6 @@ fi
CLANG_LIBDIR=${LLVM_LIBDIR}
fi
CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}

View File

@@ -1,15 +0,0 @@
$NetBSD: patch-include_EGL_eglplatform.h,v 1.2 2015/09/11 00:03:36 tnn Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=90249
--- include/EGL/eglplatform.h.orig 2015-09-10 17:40:30.000000000 +0000
+++ include/EGL/eglplatform.h
@@ -104,7 +104,7 @@ typedef struct ANativeWindow *EGL
typedef struct egl_native_pixmap_t *EGLNativePixmapType;
typedef void *EGLNativeDisplayType;
-#elif defined(__unix__)
+#elif defined(__unix__) || defined(__APPLE__)
#if defined(MESA_EGL_NO_X11_HEADERS)

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_compiler_glsl_glsl__parser__extras.cpp,v 1.1 2016/04/17 00:03:00 wiz Exp $
atexit() is not a good idea in a library; use destructor attribute.
--- src/compiler/glsl/glsl_parser_extras.cpp.orig 2016-04-04 10:24:28.000000000 +0000
+++ src/compiler/glsl/glsl_parser_extras.cpp
@@ -1938,7 +1938,7 @@ extern "C" {
* programs would be invalid. So this should happen at approximately
* program exit.
*/
-void
+void __attribute__((__destructor__))
_mesa_destroy_shader_compiler(void)
{
_mesa_destroy_shader_compiler_caches();

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-src_egl_drivers_dri2_platform__drm.c,v 1.2 2016/01/05 13:02:57 tnn Exp $
netbsd-5 build fix
--- src/egl/drivers/dri2/platform_drm.c.orig 2015-12-09 16:10:13.000000000 +0000
+++ src/egl/drivers/dri2/platform_drm.c
@@ -626,7 +626,9 @@ dri2_initialize_drm(_EGLDriver *drv, _EG
if (gbm == NULL)
goto cleanup;
} else {
+#ifdef F_DUPFD_CLOEXEC
fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
+#endif
if (fd < 0)
goto cleanup;
}

View File

@@ -0,0 +1,30 @@
$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.2 2016/05/18 12:55:28 wiz Exp $
Provide compat strndup for older Darwin.
--- src/egl/drivers/dri2/platform_x11.c.orig 2016-05-05 12:59:22.000000000 +0000
+++ src/egl/drivers/dri2/platform_x11.c
@@ -591,6 +591,23 @@ dri2_x11_local_authenticate(struct dri2_
return EGL_TRUE;
}
+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
+static char *
+strndup(const char *s, int length)
+{
+ char *d;
+
+ d = malloc(length + 1);
+ if (d == NULL)
+ return NULL;
+
+ memcpy(d, s, length);
+ d[length] = '\0';
+
+ return d;
+}
+#endif
+
static EGLBoolean
dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
{

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-src_egl_main_eglglobals.c,v 1.1 2016/01/27 07:39:54 wiz Exp $
atexit() is not a good idea in shared libraries.
--- src/egl/main/eglglobals.c.orig 2015-11-28 17:37:59.000000000 +0000
+++ src/egl/main/eglglobals.c
@@ -59,11 +59,16 @@ struct _egl_global _eglGlobal =
" EGL_MESA_platform_gbm"
};
+static EGLBoolean registered = EGL_FALSE;
-static void
+static void __attribute__((__destructor__))
_eglAtExit(void)
{
EGLint i;
+
+ if (!registered)
+ return;
+
for (i = _eglGlobal.NumAtExitCalls - 1; i >= 0; i--)
_eglGlobal.AtExitCalls[i]();
}
@@ -73,14 +78,9 @@ void
_eglAddAtExitCall(void (*func)(void))
{
if (func) {
- static EGLBoolean registered = EGL_FALSE;
-
mtx_lock(_eglGlobal.Mutex);
- if (!registered) {
- atexit(_eglAtExit);
- registered = EGL_TRUE;
- }
+ registered = EGL_TRUE;
assert(_eglGlobal.NumAtExitCalls < ARRAY_SIZE(_eglGlobal.AtExitCalls));
_eglGlobal.AtExitCalls[_eglGlobal.NumAtExitCalls++] = func;

View File

@@ -1,15 +0,0 @@
$NetBSD: patch-src_gallium_auxiliary_util_u__cpu__detect.c,v 1.1 2015/09/11 00:03:36 tnn Exp $
DragonFly support.
--- src/gallium/auxiliary/util/u_cpu_detect.c.orig 2015-07-29 21:10:43.953534000 +0000
+++ src/gallium/auxiliary/util/u_cpu_detect.c
@@ -52,7 +52,7 @@
#include <machine/cpu.h>
#endif
-#if defined(PIPE_OS_FREEBSD)
+#if defined(PIPE_OS_FREEBSD) || defined(PIPE_OS_DRAGONFLY)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif

View File

@@ -1,21 +1,11 @@
$NetBSD: patch-src_gallium_auxiliary_util_u__math.h,v 1.3 2015/09/11 00:03:36 tnn Exp $
$NetBSD: patch-src_gallium_auxiliary_util_u__math.h,v 1.4 2015/09/26 08:45:02 tnn Exp $
The C99 "restrict" keyword is not valid in C++, but most compilers will
understand __restrict.
--- src/gallium/auxiliary/util/u_math.h.orig 2015-09-10 17:40:30.000000000 +0000
--- src/gallium/auxiliary/util/u_math.h.orig 2015-09-11 17:41:47.000000000 +0000
+++ src/gallium/auxiliary/util/u_math.h
@@ -401,6 +401,9 @@ unsigned ffs( unsigned u )
#if defined(__MINGW32__) || defined(PIPE_OS_ANDROID) || \
defined(HAVE___BUILTIN_FFSLL)
#define ffsll __builtin_ffsll
+#elif defined(__NetBSD__)
+#include <sys/bitops.h>
+#define ffsll ffs64
#endif
#endif /* FFSLL_DEFINED */
@@ -690,6 +693,11 @@ util_bswap16(uint16_t n)
@@ -709,6 +712,11 @@ util_bswap16(uint16_t n)
(n << 8);
}
@@ -24,10 +14,10 @@ understand __restrict.
+#define restrict __restrict
+#endif
+
static INLINE void*
static inline void*
util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t n)
{
@@ -708,6 +716,11 @@ util_memcpy_cpu_to_le32(void * restrict
@@ -727,6 +735,11 @@ util_memcpy_cpu_to_le32(void * restrict
#endif
}

View File

@@ -1,10 +1,11 @@
$NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $
$NetBSD: patch-src_glsl_ralloc.c,v 1.4 2016/02/23 11:16:55 jperkin Exp $
* Fix exit time segfault of qt5 application with modular xorg
* Provide compat strnlen for older Darwin.
--- src/util/ralloc.c.orig 2014-10-03 03:59:51.000000000 +0000
--- src/util/ralloc.c.orig 2016-01-29 12:21:30.000000000 +0000
+++ src/util/ralloc.c
@@ -285,7 +285,7 @@ ralloc_parent(const void *ptr)
@@ -312,7 +312,7 @@ ralloc_parent(const void *ptr)
static void *autofree_context = NULL;
@@ -13,7 +14,7 @@ $NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $
autofree(void)
{
ralloc_free(autofree_context);
@@ -296,7 +296,6 @@ ralloc_autofree_context(void)
@@ -323,7 +323,6 @@ ralloc_autofree_context(void)
{
if (unlikely(autofree_context == NULL)) {
autofree_context = ralloc_context(NULL);
@@ -21,3 +22,18 @@ $NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $
}
return autofree_context;
}
@@ -360,7 +359,14 @@ ralloc_strndup(const void *ctx, const ch
if (unlikely(str == NULL))
return NULL;
+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
+ for (n = 0; n < max; n++, str++) {
+ if (!*str)
+ break;
+ }
+#else
n = strnlen(str, max);
+#endif
ptr = ralloc_array(ctx, char, n + 1);
memcpy(ptr, str, n);
ptr[n] = '\0';

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-src_glx_apple_apple__glapi.c,v 1.1 2015/09/27 21:58:03 tnn Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=90311
See also hacks.mk.
--- src/glx/apple/apple_glapi.c.orig 2015-08-07 17:36:03.000000000 +0000
+++ src/glx/apple/apple_glapi.c
@@ -39,6 +39,7 @@
#include <GL/gl.h>
#include "main/glheader.h"
+#include "main/remap.h"
#include "glapi.h"
#include "glapitable.h"
#include "main/dispatch.h"
@@ -54,6 +55,8 @@ static void _apple_glapi_create_table(vo
if (__applegl_api)
return;
+ _mesa_init_remap_table();
+
__ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
assert(__ogl_framework_api);

View File

@@ -1,11 +1,32 @@
$NetBSD: patch-src_glx_glxcurrent.c,v 1.1 2015/09/11 16:27:30 tnn Exp $
$NetBSD: patch-src_glx_glxcurrent.c,v 1.2 2015/09/26 08:45:02 tnn Exp $
Interim fix for toolchain/50277.
NetBSD only supports zero-initialized initial-exec tls variables in conjuction
with dlopen(3) at the moment.
--- src/glx/glxcurrent.c.orig 2015-09-02 17:06:23.000000000 +0000
+++ src/glx/glxcurrent.c
@@ -77,7 +77,11 @@ _X_HIDDEN pthread_mutex_t __glXmutex = P
@@ -40,6 +40,18 @@
#include "glapi.h"
/*
+ * MASSIVE KLUDGE!
+ * We need these to not be extern in libGL.so because of
+ * PR toolchain/50277
+ */
+#if defined(GLX_USE_TLS) && defined(__NetBSD__)
+_X_EXPORT __thread struct _glapi_table * _glapi_tls_Dispatch
+ __attribute__((tls_model("initial-exec"))) = NULL;
+_X_EXPORT __thread void * _glapi_tls_Context
+ __attribute__((tls_model("initial-exec")));
+#endif
+
+/*
** We setup some dummy structures here so that the API can be used
** even if no context is current.
*/
@@ -77,7 +89,11 @@ _X_HIDDEN pthread_mutex_t __glXmutex = P
* \c __glXGetCurrentContext can be implemented as trivial macro.
*/
__thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec")))

View File

@@ -1,10 +1,10 @@
$NetBSD: patch-src_loader_Makefile.in,v 1.1 2015/09/11 00:03:36 tnn Exp $
$NetBSD: patch-src_loader_Makefile.in,v 1.4 2016/01/27 07:39:54 wiz Exp $
FreeBSD & DragonFly support for libdevq.
--- src/loader/Makefile.in.orig 2015-08-12 00:50:19.110973000 +0000
--- src/loader/Makefile.in.orig 2016-01-13 10:48:30.000000000 +0000
+++ src/loader/Makefile.in
@@ -319,6 +319,8 @@ LEXLIB = @LEXLIB@
@@ -320,6 +320,8 @@ LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBCLC_INCLUDEDIR = @LIBCLC_INCLUDEDIR@
LIBCLC_LIBEXECDIR = @LIBCLC_LIBEXECDIR@
@@ -12,13 +12,13 @@ FreeBSD & DragonFly support for libdevq.
+LIBDEVQ_LIBS = @LIBDEVQ_LIBS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBOBJS = @LIBOBJS@
@@ -508,7 +510,7 @@ EXTRA_DIST = SConscript
noinst_LTLIBRARIES = libloader.la
libloader_la_CPPFLAGS = $(DEFINES) -I$(top_srcdir)/include \
-I$(top_srcdir)/src $(VISIBILITY_CFLAGS) $(LIBUDEV_CFLAGS) \
- $(am__append_1) $(am__append_3) $(am__append_4)
+ $(LIBDEVQ_CFLAGS) $(am__append_1) $(am__append_3) $(am__append_4)
LIBELF_CFLAGS = @LIBELF_CFLAGS@
@@ -532,7 +534,7 @@ AM_CPPFLAGS = \
$(LIBDRM_CFLAGS) \
$(LIBUDEV_CFLAGS)
-libloader_la_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1)
+libloader_la_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1) $(LIBDEVQ_CFLAGS)
libloader_la_SOURCES = $(LOADER_C_FILES)
libloader_la_LIBADD = $(am__append_2) $(am__append_5)
all: all-am
libloader_la_LIBADD = $(am__append_2) $(am__append_3)
@HAVE_DRI3_TRUE@libloader_dri3_helper_la_SOURCES = \

View File

@@ -1,10 +1,10 @@
$NetBSD: patch-src_loader_loader.c,v 1.1 2015/09/11 00:03:36 tnn Exp $
$NetBSD: patch-src_loader_loader.c,v 1.2 2015/09/26 08:45:02 tnn Exp $
FreeBSD & DragonFly support for libdevq. From FreeBSD ports(?)
--- src/loader/loader.c.orig 2015-07-26 13:32:59.000000000 +0000
--- src/loader/loader.c.orig 2015-09-10 18:07:21.000000000 +0000
+++ src/loader/loader.c
@@ -68,7 +68,7 @@
@@ -70,7 +70,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
@@ -12,8 +12,8 @@ FreeBSD & DragonFly support for libdevq. From FreeBSD ports(?)
+#if defined(HAVE_LIBUDEV) || defined(HAVE_LIBDEVQ)
#include <assert.h>
#include <dlfcn.h>
#include <fcntl.h>
@@ -501,6 +501,53 @@ sysfs_get_pci_id_for_fd(int fd, int *ven
#include <unistd.h>
@@ -505,6 +505,53 @@ sysfs_get_pci_id_for_fd(int fd, int *ven
}
#endif
@@ -64,10 +64,10 @@ FreeBSD & DragonFly support for libdevq. From FreeBSD ports(?)
+
+#endif
+
#if !defined(__NOT_HAVE_DRM_H)
#if defined(HAVE_LIBDRM)
/* for i915 */
#include <i915_drm.h>
@@ -584,6 +631,12 @@ loader_get_pci_id_for_fd(int fd, int *ve
@@ -588,6 +635,12 @@ loader_get_pci_id_for_fd(int fd, int *ve
if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1;
#endif
@@ -77,6 +77,6 @@ FreeBSD & DragonFly support for libdevq. From FreeBSD ports(?)
+ return 1;
+#endif
+
#if !defined(__NOT_HAVE_DRM_H)
#if HAVE_LIBDRM
if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1;

View File

@@ -1,10 +1,33 @@
$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.1 2015/04/25 11:19:18 tnn Exp $
$NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.2 2015/09/26 08:45:02 tnn Exp $
NetBSD only supports zero-initialized initial-exec tls variables in conjuction
with dlopen(3) at the moment.
Fix --enable-glx-tls with clang. From FreeBSD.
--- src/mapi/entry_x86-64_tls.h.orig 2015-03-28 18:20:39.000000000 +0000
--- src/mapi/entry_x86-64_tls.h.orig 2015-09-11 17:41:47.000000000 +0000
+++ src/mapi/entry_x86-64_tls.h
@@ -62,8 +62,8 @@ entry_patch_public(void)
@@ -36,10 +36,19 @@ __asm__(".text\n"
".balign 32\n" \
func ":"
+#ifdef __NetBSD__
#define STUB_ASM_CODE(slot) \
"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
"movq %fs:(%rax), %r11\n\t" \
+ "testq %r11, %r11\n\t" \
+ "cmoveq table_noop_array@GOTPCREL(%rip), %r11\n\t" \
"jmp *(8 * " slot ")(%r11)"
+#else
+#define STUB_ASM_CODE(slot) \
+ "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
+ "movq %fs:(%rax), %r11\n\t" \
+ "jmp *(8 * " slot ")(%r11)"
+#endif
#define MAPI_TMP_STUB_ASM_GCC
#include "mapi_tmp.h"
@@ -61,8 +70,8 @@ entry_patch_public(void)
{
}

View File

@@ -1,10 +1,41 @@
$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.1 2015/04/25 11:19:18 tnn Exp $
$NetBSD: patch-src_mapi_entry__x86__tls.h,v 1.2 2015/09/26 08:45:02 tnn Exp $
NetBSD only supports zero-initialized initial-exec tls variables in conjuction
with dlopen(3) at the moment.
Fix --enable-glx-tls with clang. From FreeBSD.
--- src/mapi/entry_x86_tls.h.orig 2015-03-28 18:20:39.000000000 +0000
--- src/mapi/entry_x86_tls.h.orig 2015-09-02 17:06:23.000000000 +0000
+++ src/mapi/entry_x86_tls.h
@@ -72,8 +72,8 @@ __asm__(".text");
@@ -50,10 +50,27 @@ __asm__(".balign 16\n"
".balign 16\n" \
func ":"
+#ifdef __NetBSD__
+extern const mapi_func table_noop_array[];
#define STUB_ASM_CODE(slot) \
"call x86_current_tls\n\t" \
"movl %gs:(%eax), %eax\n\t" \
+ "testl %eax, %eax\n\t" \
+ "je 1f\n\t" \
+ "jmp *(4 * " slot ")(%eax)\n\t" \
+ "1:\n\t" \
+ "call 2f\n" \
+ "2:\n\t" \
+ "popl %eax\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" \
+ "movl table_noop_array@GOT(%eax), %eax\n\t" \
"jmp *(4 * " slot ")(%eax)"
+#else
+#define STUB_ASM_CODE(slot) \
+ "call x86_current_tls\n\t" \
+ "movl %gs:(%eax), %eax\n\t" \
+ "jmp *(4 * " slot ")(%eax)"
+#endif
#define MAPI_TMP_STUB_ASM_GCC
#include "mapi_tmp.h"
@@ -71,8 +88,8 @@ __asm__(".text");
extern unsigned long
x86_current_tls();

View File

@@ -1,8 +1,9 @@
$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.2 2015/09/11 00:03:36 tnn Exp $
$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.3 2016/02/23 11:16:55 jperkin Exp $
PR pkg/50202.
Provide compat strndup for older Darwin.
--- src/mesa/drivers/dri/common/xmlconfig.c.orig 2015-07-14 18:10:47.000000000 +0000
--- src/mesa/drivers/dri/common/xmlconfig.c.orig 2016-01-29 12:21:30.000000000 +0000
+++ src/mesa/drivers/dri/common/xmlconfig.c
@@ -50,12 +50,17 @@ extern char *program_invocation_name, *p
# define GET_PROGRAM_NAME() program_invocation_short_name
@@ -22,3 +23,28 @@ PR pkg/50202.
#elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
@@ -111,6 +116,24 @@ static const char *__getProgramName () {
# endif
#endif
+#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
+static char *
+strndup(const char *str, size_t n)
+{
+ size_t len;
+ char *copy;
+
+ for (len = 0; len < n && str[len]; len++)
+ continue;
+
+ if ((copy = (char *)malloc(len + 1)) == NULL)
+ return (NULL);
+ memcpy(copy, str, len);
+ copy[len] = '\0';
+ return (copy);
+}
+#endif
+
/** \brief Find an option in an option cache with the name as key */
static uint32_t findOption (const driOptionCache *cache, const char *name) {
uint32_t len = strlen (name);

View File

@@ -1,20 +0,0 @@
$NetBSD: patch-src_mesa_drivers_dri_i965_brw__context.h,v 1.1 2015/09/11 12:38:27 tnn Exp $
Fix build on NetBSD 5.x.
The ALIGN macro in Mesa conflicts with machine/param.h. It is easier to
avoid it than attempting to fix the include order here.
--- src/mesa/drivers/dri/i965/brw_context.h.orig 2015-09-10 17:40:31.000000000 +0000
+++ src/mesa/drivers/dri/i965/brw_context.h
@@ -1912,7 +1912,11 @@ brw_compute_program(struct gl_compute_pr
static inline int
brw_register_blocks(int reg_count)
{
+#if 0
return ALIGN(reg_count, 16) / 16 - 1;
+#else
+ return (((reg_count + 0xF) & ~0xF) >> 4) - 1;
+#endif
}
static inline uint32_t

View File

@@ -1,14 +1,28 @@
$NetBSD: patch-src_mesa_main_context.c,v 1.2 2015/04/25 11:19:18 tnn Exp $
$NetBSD: patch-src_mesa_main_context.c,v 1.3 2015/09/26 08:45:02 tnn Exp $
* Fix exit time segfault of qt5 application with modular xorg
--- src/mesa/main/context.c.orig 2015-03-28 18:20:39.000000000 +0000
--- src/mesa/main/context.c.orig 2015-09-11 17:41:47.000000000 +0000
+++ src/mesa/main/context.c
@@ -378,10 +378,10 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
*
* \sa _math_init().
@@ -350,11 +350,14 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
* Calls all the various one-time-fini functions in Mesa
*/
-static void
+static GLbitfield api_init_mask = 0x0;
+static void __attribute__((__destructor__))
one_time_fini(void)
{
- _mesa_destroy_shader_compiler();
- _mesa_locale_fini();
+ if (api_init_mask) {
+ _mesa_destroy_shader_compiler();
+ _mesa_locale_fini();
+ }
}
/**
@@ -369,7 +372,6 @@ one_time_fini(void)
static void
one_time_init( struct gl_context *ctx )
{
@@ -16,25 +30,12 @@ $NetBSD: patch-src_mesa_main_context.c,v 1.2 2015/04/25 11:19:18 tnn Exp $
mtx_lock(&OneTimeLock);
@@ -428,14 +428,16 @@ one_time_init( struct gl_context *ctx )
@@ -394,8 +396,6 @@ one_time_init( struct gl_context *ctx )
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
mtx_unlock(&OneTimeLock);
- /* Hopefully atexit() is widely available. If not, we may need some
- * #ifdef tests here.
- */
- atexit(_mesa_destroy_shader_compiler);
- atexit(one_time_fini);
-
dummy_enum_func();
}
+static void __attribute__((__destructor__))
+one_time_fini(void)
+{
+ if (api_init_mask)
+ _mesa_destroy_shader_compiler();
+}
+
/**
* Initialize fields of gl_current_attrib (aka ctx->Current.*)
#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
if (MESA_VERBOSE != 0) {
_mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-src_mesa_main_extensions.c,v 1.1 2016/01/27 07:39:54 wiz Exp $
atexit() is not a good idea in shared libraries.
--- src/mesa/main/extensions.c.orig 2016-01-07 16:17:53.000000000 +0000
+++ src/mesa/main/extensions.c
@@ -256,7 +256,7 @@ get_extension_override( struct gl_contex
* These strings are allocated early during the first context creation by
* _mesa_one_time_init_extension_overrides.
*/
-static void
+static void __attribute__((__destructor__))
free_unknown_extensions_strings(void)
{
free(extra_extensions);
@@ -277,7 +277,7 @@ _mesa_one_time_init_extension_overrides(
int len;
size_t offset;
- atexit(free_unknown_extensions_strings);
+ /* atexit(free_unknown_extensions_strings); */
memset(&_mesa_extension_override_enables, 0, sizeof(struct gl_extensions));
memset(&_mesa_extension_override_disables, 0, sizeof(struct gl_extensions));

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-src_mesa_main_macros.h,v 1.1 2016/01/05 13:02:57 tnn Exp $
ALIGN is also defined in sys/param.h on NetBSD.
--- src/mesa/main/macros.h.orig 2015-12-09 16:10:13.000000000 +0000
+++ src/mesa/main/macros.h
@@ -690,6 +690,9 @@ minify(unsigned value, unsigned levels)
*
* \sa ROUND_DOWN_TO()
*/
+#if defined(__NetBSD__)
+#undef ALIGN
+#endif
static inline uintptr_t
ALIGN(uintptr_t value, int32_t alignment)
{

View File

@@ -0,0 +1,30 @@
$NetBSD: patch-src_util_strndup.c,v 1.1 2016/02/23 11:16:55 jperkin Exp $
Provide compat strndup for older Darwin.
--- src/util/strndup.c.orig 2016-01-22 15:44:31.000000000 +0000
+++ src/util/strndup.c
@@ -21,7 +21,7 @@
* IN THE SOFTWARE.
*/
-#if defined(_WIN32)
+#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
#include <stdlib.h>
#include <string.h>
#include "strndup.h"
@@ -35,7 +35,14 @@ strndup(const char *str, size_t max)
if (!str)
return NULL;
+#if defined(__APPLE__)
+ for (n = 0; n < max; n++, str++) {
+ if (!*str)
+ break;
+ }
+#else
n = strnlen(str, max);
+#endif
ptr = (char *) calloc(n + 1, sizeof(char));
if (!ptr)
return NULL;

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_util_strndup.h,v 1.1 2016/02/23 11:16:55 jperkin Exp $
Provide compat strndup for older Darwin.
--- src/util/strndup.h.orig 2016-01-22 15:44:31.000000000 +0000
+++ src/util/strndup.h
@@ -25,7 +25,7 @@
#include <stdlib.h> // size_t
-#if defined(_WIN32)
+#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
#ifdef __cplusplus
extern "C" {