Index: graphics/dri/Makefile =================================================================== --- graphics/dri/Makefile +++ graphics/dri/Makefile @@ -3,6 +3,7 @@ PORTNAME= dri PORTVERSION= ${MESAVERSION} +PORTREVISION= 3 PORTEPOCH= 2 CATEGORIES= graphics @@ -13,11 +14,16 @@ USES= ssl USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto \ - presentproto xvmc xshmfence + presentproto xvmc xshmfence dri3proto OPTIONS_DEFINE= TEXTURE OPTIONS_DEFAULT=TEXTURE +OPTIONS_DEFINE_amd64= DRI3 +OPTIONS_DEFINE_i386= DRI3 +DRI3_DESC= Experimental: Enable DRI3 support. +OPTIONS_DEFAULT_amd64= DRI3 + TEXTURE_DESC= Enable texture-float support (patent encumbered) VDPAU_DESC= VDPAU (GPU video acceleration) support (needs Gallium) Index: graphics/dri/pkg-plist =================================================================== --- graphics/dri/pkg-plist +++ graphics/dri/pkg-plist @@ -20,6 +20,7 @@ @comment include/GLES2/gl2platform.h @comment include/GLES3/gl3.h @comment include/GLES3/gl31.h +@comment include/GLES3/gl32.h @comment include/GLES3/gl3ext.h @comment include/GLES3/gl3platform.h @comment include/KHR/khrplatform.h @@ -64,6 +65,9 @@ @comment lib/libglapi.so @comment lib/libglapi.so.0 @comment lib/libglapi.so.0.0.0 +@comment lib/libwayland-egl.so +@comment lib/libwayland-egl.so.1 +@comment lib/libwayland-egl.so.1.0.0 %%VDPAU%%lib/vdpau/libvdpau_r300.so %%VDPAU%%lib/vdpau/libvdpau_r300.so.1 %%VDPAU%%lib/vdpau/libvdpau_r300.so.1.0 @@ -82,3 +86,4 @@ @comment libdata/pkgconfig/gl.pc @comment libdata/pkgconfig/glesv2.pc @comment libdata/pkgconfig/osmesa.pc +@comment libdata/pkgconfig/wayland-egl.pc Index: graphics/gbm/Makefile =================================================================== --- graphics/gbm/Makefile +++ graphics/gbm/Makefile @@ -3,7 +3,7 @@ PORTNAME= gbm PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 5 CATEGORIES= graphics COMMENT= gbm library @@ -17,12 +17,12 @@ # stuff not needed by gbm but configure wants it USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \ - xshmfence + xshmfence dri3proto .include .include "${.CURDIR}/../../graphics/libGL/Makefile.common" -MESA_BUILD_WRKSRC= src/mapi src/gbm +MESA_BUILD_WRKSRC= src/egl/wayland/wayland-drm src/mapi src/gbm MESA_INSTALL_WRKSRC= src/gbm .include "${.CURDIR}/../../graphics/libGL/Makefile.targets" Index: graphics/libEGL/Makefile =================================================================== --- graphics/libEGL/Makefile +++ graphics/libEGL/Makefile @@ -3,7 +3,7 @@ PORTNAME= libEGL PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 6 CATEGORIES= graphics COMMENT= OpenEGL library @@ -10,21 +10,26 @@ LIB_DEPENDS+= libpthread-stubs.so:devel/libpthread-stubs \ libexpat.so:textproc/expat2 \ - libdevq.so:devel/libdevq \ libdrm.so:graphics/libdrm +OPTIONS_DEFINE_amd64= DRI3 +OPTIONS_DEFINE_i386= DRI3 +DRI3_DESC= Experimental: Enable DRI3 support. +OPTIONS_DEFAULT_amd64= DRI3 + USE_GL= gbm USE_XORG= x11 xau xcb xdmcp # stuff not needed by libEGL but configure wants it USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \ - xshmfence + xshmfence dri3proto .include .include "${.CURDIR}/../../graphics/libGL/Makefile.common" -MESA_BUILD_WRKSRC= src/mapi src/gbm src/egl/ -MESA_INSTALL_WRKSRC= src/egl +MESA_BUILD_WRKSRC= src/mapi src/egl/wayland/wayland-egl \ + src/egl/wayland/wayland-drm src/gbm src/egl +MESA_INSTALL_WRKSRC= src/egl src/egl/wayland/wayland-egl .include "${.CURDIR}/../../graphics/libGL/Makefile.targets" Index: graphics/libEGL/pkg-plist =================================================================== --- graphics/libEGL/pkg-plist +++ graphics/libEGL/pkg-plist @@ -7,4 +7,8 @@ lib/.mesa/libEGL.so lib/.mesa/libEGL.so.1 lib/.mesa/libEGL.so.1.0.0 +lib/libwayland-egl.so +lib/libwayland-egl.so.1 +lib/libwayland-egl.so.1.0.0 libdata/pkgconfig/egl.pc +libdata/pkgconfig/wayland-egl.pc Index: graphics/libGL/Makefile =================================================================== --- graphics/libGL/Makefile +++ graphics/libGL/Makefile @@ -3,7 +3,7 @@ PORTNAME= libGL PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 6 CATEGORIES= graphics COMMENT= OpenGL library that renders using GLX or DRI @@ -12,8 +12,14 @@ libglapi.so:graphics/libglapi \ libexpat.so:textproc/expat2 +OPTIONS_DEFINE_amd64= DRI3 +OPTIONS_DEFINE_i386= DRI3 +DRI3_DESC= Experimental: Enable DRI3 support + +OPTIONS_DEFAULT_amd64= DRI3 + USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto:both \ - presentproto xshmfence + presentproto xshmfence xcb .include .include "${.CURDIR}/Makefile.common" @@ -27,7 +33,8 @@ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/.mesa @${MV} ${STAGEDIR}${PREFIX}/lib/libGL* \ ${STAGEDIR}${PREFIX}/lib/.mesa/ - @cd ${WRKSRC}/src/mesa && ${SETENV} DESTDIR=${STAGEDIR} \ - ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS + @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \ + ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS \ + install-glxHEADERS .include Index: graphics/libGL/Makefile.common =================================================================== --- graphics/libGL/Makefile.common +++ graphics/libGL/Makefile.common @@ -18,25 +18,28 @@ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 11.2.2 +MESABASEVERSION= 17.0.0 # if there is a subversion, don't include the '-' between 7.11-rc2. -MESASUBVERSION= +MESASUBVERSION= rc3 -MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/ +#MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/ +MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/ DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX} MAINTAINER= x11@FreeBSD.org -BUILD_DEPENDS+= makedepend:devel/makedepend -LIB_DEPENDS+= libdevq.so:devel/libdevq +BUILD_DEPENDS+= makedepend:devel/makedepend \ + libudev-devd>=0:devel/libudev-devd \ + clang${MESA_LLVM_VER}:devel/llvm${MESA_LLVM_VER} \ + clang++${MESA_LLVM_VER}:devel/llvm${MESA_LLVM_VER} \ + clang-cpp${MESA_LLVM_VER}:devel/llvm${MESA_LLVM_VER} -USES+= compiler:c++11-lib bison gettext-tools gmake libtool \ - pathfix pkgconfig python:2,build shebangfix tar:xz +USES+= bison gettext-tools gmake libtool \ + localbase pathfix pkgconfig python:2,build shebangfix tar:xz USE_LDCONFIG= yes GNU_CONFIGURE= yes -CPPFLAGS+= -isystem${LOCALBASE}/include -LDFLAGS+= -Wl,-Y/usr/lib:${LOCALBASE}/lib +LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib PKGINSTALL= ${.CURDIR}/pkg-install PKGDEINSTALL= ${.CURDIR}/pkg-deinstall @@ -46,6 +49,20 @@ PORTSCOUT= ignore:1 .endif +.if ${OSVERSION} < 1000033 +BUILD_DEPENDS+= ${LOCALBASE}/bin/flex:textproc/flex +CONFIGURE_ENV+= ac_cv_prog_LEX=${LOCALBASE}/bin/flex +.endif + +BUILD_DEPENDS+= binutils>=0:devel/binutils +CONFIGURE_ENV+= LD=${LOCALBASE}/bin/ld \ + AR=${LOCALBASE}/bin/ar \ + RANLIB=${LOCALBASE}/bin/ranlib \ + CC=${LOCALBASE}/bin/clang${MESA_LLVM_VER} \ + CXX=${LOCALBASE}/bin/clang++${MESA_LLVM_VER} \ + CPP=${LOCALBASE}/bin/clang-cpp${MESA_LLVM_VER} + + python_OLD_CMD= "/usr/bin/env[[:space:]]python" python_CMD= ${LOCALBASE}/bin/python2 SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \ @@ -62,12 +79,20 @@ COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} -MESA_LLVM_VER=37 +MESA_LLVM_VER=40 CONFIGURE_ARGS+= --with-sha1=libcrypto -# DRI3 needs PRIME support in the kernel to work +# XXX this needs propper OSVERSION checks +.if ${OPSYS} == FreeBSD # && \ +# (${OSVERSION} >= 1001000 && ${ARCH} == amd64 || \ +# ${OSVERSION} >= 1001000 && ${ARCH} == i386)) +USE_XORG+= dri3proto presentproto xshmfence +LIB_DEPENDS+= libxcb.so:x11/libxcb +CONFIGURE_ARGS+= --enable-dri3 +.else CONFIGURE_ARGS+= --disable-dri3 +.endif CONFIGURE_ARGS+= --enable-gbm @@ -77,11 +102,17 @@ # pthread_setspecific which it uses now by default. But since this # configure switch is going away ... # https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html -#CONFIGURE_ARGS+= --enable-glx-tls +CONFIGURE_ARGS+= --enable-glx-tls # libEGL, dri and clover need gallium enabled. + +# XXX revise this to a BUILD_DEPENDS and only LIBS_DEPEND for ports that need it. +LIB_DEPENDS+= libwayland-client.so:graphics/wayland \ + libwayland-server.so:graphics/wayland \ + libudev.so:devel/libudev-devd + # the third option in --with-egl-platforms is wayland. -CONFIGURE_ARGS+= --enable-egl --with-egl-platforms=x11,drm +CONFIGURE_ARGS+= --enable-egl --with-egl-platforms=x11,drm,wayland # we don't care about GLes v1 CONFIGURE_ARGS+= --disable-gles1 @@ -89,10 +120,11 @@ CONFIGURE_ARGS+= --enable-gles2 # Clover (OpenCL). -.if ${OPSYS} == DragonFly || \ - (${OPSYS} == FreeBSD && \ - (${ARCH} == amd64 || \ - ${ARCH} == i386)) +#temp disable opencl until I can find out why llvm breaks +#.if ${OPSYS} == DragonFly || \ +# (${OPSYS} == FreeBSD && \ +# (${OSVERSION} >= 1001000 && ${ARCH} == amd64 || \ +# ${OSVERSION} >= 1001000 && ${ARCH} == i386)) BUILD_DEPENDS+= libclc>=0.0.r222830:devel/libclc @@ -108,7 +140,6 @@ ${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not build with clang support, which is required."; \ ${FALSE}; \ fi -.endif CONFIGURE_ARGS+= --enable-opencl \ --enable-opencl-icd @@ -119,9 +150,9 @@ CONFIGURE_ARGS+= --enable-osmesa # gallium -BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.7.1_1:devel/llvm${MESA_LLVM_VER} +BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} .if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != "" -RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.7.1_1:devel/llvm${MESA_LLVM_VER} +RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} .endif CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} @@ -134,7 +165,7 @@ .endif # only support on DragonFly. FreeBSD's drm doesn't support it. -.if ${OPSYS} == DragonFly && ${COMPONENT:Mdri} != "" +.if ${COMPONENT:Mdri} != "" CONFIGURE_ARGS+=--enable-vdpau LIB_DEPENDS+= libvdpau.so:multimedia/libvdpau PLIST_SUB+= VDPAU="" @@ -143,9 +174,6 @@ PLIST_SUB+= VDPAU="@comment " .endif -# VAAPI support? -CONFIGURE_ARGS+=--disable-va - ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST ALL_GALLIUM_DRIVERS=R300 R600 RADEONSI SVGA SWRAST @@ -191,4 +219,3 @@ .if ${OPSYS} == DragonFly LIB_DEPENDS+= libelf.so:devel/libelf .endif - Index: graphics/libGL/distinfo =================================================================== --- graphics/libGL/distinfo +++ graphics/libGL/distinfo @@ -1,2 +1,3 @@ -SHA256 (mesa-11.2.2.tar.xz) = 40e148812388ec7c6d7b6657d5a16e2e8dabba8b97ddfceea5197947647bdfb4 -SIZE (mesa-11.2.2.tar.xz) = 7860932 +TIMESTAMP = 1486401476 +SHA256 (mesa-17.0.0-rc3.tar.xz) = e60e50b186159c0140e4bb9141d16933f6cf15cf2039d284a8fb5461b49ec99e +SIZE (mesa-17.0.0-rc3.tar.xz) = 9440336 Index: graphics/libGL/files/configure.ac =================================================================== --- graphics/libGL/files/configure.ac +++ graphics/libGL/files/configure.ac @@ -1,102 +0,0 @@ ---- configure.ac.orig 2015-12-21 10:05:52.000000000 +0100 -+++ configure.ac 2015-12-22 17:04:25.728359000 +0100 -@@ -78,6 +78,7 @@ - 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 -@@ -743,7 +744,7 @@ - [enable_dri=yes]) - - case "$host_os" in --linux*) -+linux*|freebsd*) - dri3_default=yes - ;; - *) -@@ -1000,6 +1001,9 @@ - PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED], - have_libudev=yes, have_libudev=no) - -+PKG_CHECK_MODULES([LIBDEVQ], [libdevq-1.0 >= $LIBDEVQ_REQUIRED], -+ have_libdevq=yes, have_libdevq=no) -+ - AC_ARG_ENABLE([sysfs], - [AS_HELP_STRING([--enable-sysfs], - [enable /sys PCI identification @<:@default=disabled@:>@])], -@@ -1096,6 +1100,10 @@ - DEFINES="$DEFINES -DHAVE_LIBUDEV" - have_pci_id=yes - fi -+if test "$have_libdevq" = yes; then -+ DEFINES="$DEFINES -DHAVE_LIBDEVQ" -+ have_pci_id=yes -+fi - - if test "$have_sysfs" = yes; then - DEFINES="$DEFINES -DHAVE_SYSFS" -@@ -1228,6 +1236,23 @@ - ;; - gnu*) - DEFINES="$DEFINES -DHAVE_ALIAS" -+dnl not sure about dri3 support, just enable it for now. -+ if test "x$enable_dri3" = xyes; then -+ DEFINES="$DEFINES -DHAVE_DRI3" -+ fi -+ -+ if test "x$have_libdevq" != xyes; then -+ AC_MSG_ERROR([libdevq required for building DRI]) -+ fi -+ -+ case "$host_cpu" in -+ powerpc* | sparc*) -+ # Build only the drivers for cards that exist on PowerPC/sparc -+ if test "x$with_dri_drivers" = "xyes"; then -+ with_dri_drivers="r200 radeon swrast" -+ fi -+ ;; -+ esac - ;; - cygwin*) - if test "x$with_dri_drivers" = "xyes"; then -@@ -1384,6 +1409,8 @@ - AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes) - if test "x$need_pci_id$have_libudev" = xyesyes; then - GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED" -+elif test "x$need_libdevq" = xyes; then -+ GBM_PC_REQ_PRIV="libdevq-1.0 >= $LIBDEVQ_REQUIRED" - else - GBM_PC_REQ_PRIV="" - fi -@@ -1545,9 +1572,19 @@ - AC_MSG_ERROR([cannot enable OpenCL without Gallium]) - fi - -+ if test "x$acv_mesa_CLANG" = xno; then -+ -+ GCC_VERSION=`$CC -dumpversion` -+ if test $? -eq 0; then -+ GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` -+ GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` -+ fi -+ - if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then - AC_MSG_ERROR([gcc >= 4.7 is required to build clover]) - fi -+# end of clang test. -+ fi - - if test "x$have_libclc" = xno; then - AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover. -@@ -1815,8 +1852,6 @@ - CLANG_LIBDIR=${LLVM_LIBDIR} - fi - CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} -- AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"], -- [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])]) - fi - else - MESA_LLVM=0 Index: graphics/libGL/files/patch-configure =================================================================== --- graphics/libGL/files/patch-configure +++ graphics/libGL/files/patch-configure @@ -1,45 +1,337 @@ ---- configure.orig 2015-12-22 17:04:20.271630000 +0100 -+++ configure 2015-12-22 17:05:17.669976000 +0100 -@@ -858,6 +858,8 @@ - GLPROTO_CFLAGS - XLIBGL_LIBS - XLIBGL_CFLAGS -+LIBDEVQ_LIBS -+LIBDEVQ_CFLAGS - LIBUDEV_LIBS - LIBUDEV_CFLAGS - MESA_LLVM -@@ -1156,6 +1158,8 @@ - LIBDRM_LIBS - LIBUDEV_CFLAGS - LIBUDEV_LIBS -+LIBDEVQ_CFLAGS -+LIBDEVQ_LIBS - XLIBGL_CFLAGS - XLIBGL_LIBS - GLPROTO_CFLAGS -@@ -1966,6 +1970,10 @@ - C compiler flags for LIBUDEV, overriding pkg-config - LIBUDEV_LIBS - linker flags for LIBUDEV, overriding pkg-config -+ LIBDEVQ_CFLAGS -+ C compiler flags for LIBDEVQ, overriding pkg-config -+ LIBDEVQ_LIBS -+ linker flags for LIBDEVQ, overriding pkg-config - XLIBGL_CFLAGS - C compiler flags for XLIBGL, overriding pkg-config - XLIBGL_LIBS linker flags for XLIBGL, overriding pkg-config -@@ -5246,6 +5254,7 @@ - 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 -@@ -21035,7 +21044,7 @@ +--- configure.orig 2017-01-25 13:26:43 UTC ++++ configure +@@ -1956,7 +1956,7 @@ Optional Features: + Disable writable .text section on x86 (decreases + performance) [default=disabled] + --enable-gallium-llvm build gallium LLVM support [default=enabled on +- x86/x86_64] ++ x86/amd64] + --enable-valgrind Build mesa with valgrind support (default: auto) + Optional Packages: +@@ -9620,7 +9620,7 @@ mips64*-*linux*) + rm -rf conftest* + ;; +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ ++amd64-*kfreebsd*-gnu|amd64-*linux*|powerpc*-*linux*| \ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the +@@ -9637,13 +9637,13 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in +- x86_64-*kfreebsd*-gnu) ++ amd64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; +- x86_64-*linux*) ++ amd64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) +- LD="${LD-ld} -m elf32_x86_64" ++ LD="${LD-ld} -m elf32_amd64" + ;; + *) + LD="${LD-ld} -m elf_i386" +@@ -9666,11 +9666,11 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* + ;; + *64-bit*) + case $host in +- x86_64-*kfreebsd*-gnu) +- LD="${LD-ld} -m elf_x86_64_fbsd" ++ amd64-*kfreebsd*-gnu) ++ LD="${LD-ld} -m elf_amd64_fbsd" + ;; +- x86_64-*linux*) +- LD="${LD-ld} -m elf_x86_64" ++ amd64-*linux*) ++ LD="${LD-ld} -m elf_amd64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" +@@ -9752,8 +9752,8 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } + case $lt_cv_prog_gnu_ld in + yes*) + case $host in +- i?86-*-solaris*|x86_64-*-solaris*) +- LD="${LD-ld} -m elf_x86_64" ++ i?86-*-solaris*|amd64-*-solaris*) ++ LD="${LD-ld} -m elf_amd64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" +@@ -11462,7 +11462,7 @@ lt_prog_compiler_static= + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in +- # old Intel for x86_64, which still supported -KPIC. ++ # old Intel for amd64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' +@@ -11905,7 +11905,7 @@ $as_echo_n "checking whether the $compil + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no +- link_all_deplibs=unknown ++ link_all_deplibs=no + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= +@@ -12204,7 +12204,7 @@ _LT_EOF + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + fi + ;; + +@@ -12223,7 +12223,7 @@ _LT_EOF + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + else + ld_shlibs=no + fi +@@ -12252,7 +12252,7 @@ _LT_EOF + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + else + ld_shlibs=no + fi +@@ -12270,7 +12270,7 @@ _LT_EOF + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + else + ld_shlibs=no + fi +@@ -12918,7 +12918,7 @@ $as_echo "$lt_cv_irix_exported_symbol" > + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' ++ archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-version-script,$lib-ver' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else +@@ -13767,7 +13767,7 @@ freebsd* | dragonfly*) + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no +@@ -14899,7 +14899,7 @@ striplib= + old_striplib= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 + $as_echo_n "checking whether stripping libraries is possible... " >&6; } +-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then ++if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +@@ -15151,7 +15151,7 @@ hardcode_automatic_CXX=no + inherit_rpath_CXX=no + module_cmds_CXX= + module_expsym_cmds_CXX= +-link_all_deplibs_CXX=unknown ++link_all_deplibs_CXX=no + old_archive_cmds_CXX=$old_archive_cmds + reload_flag_CXX=$reload_flag + reload_cmds_CXX=$reload_cmds +@@ -15362,7 +15362,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' +@@ -16054,7 +16054,7 @@ fi + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= +@@ -16062,7 +16062,7 @@ fi + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no +@@ -16094,7 +16094,7 @@ fi + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$lib-ver -o $lib' + ;; + esac + +@@ -16105,7 +16105,7 @@ fi + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-version-script $wl$lib-ver' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' +@@ -16139,7 +16139,7 @@ fi + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-version-script $wl$lib-ver' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes +@@ -16207,7 +16207,7 @@ fi + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then +- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-version-script,$lib-ver -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi +@@ -16842,7 +16842,7 @@ lt_prog_compiler_static_CXX= + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) +- # old Intel C++ for x86_64, which still supported -KPIC. ++ # old Intel C++ for amd64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' +@@ -17729,7 +17729,7 @@ freebsd* | dragonfly*) + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no +@@ -20377,7 +20377,7 @@ if ac_fn_c_try_compile "$LINENO"; then : + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in +- i?86 | x86_64 | ppc | ppc64) ++ i?86 | amd64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else +@@ -20960,10 +20960,10 @@ asm_arch="" + $as_echo_n "checking whether to enable assembly... " >&6; } + test "x$enable_asm" = xno && { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } +-# disable if cross compiling on x86/x86_64 since we must run gen_matypes ++# disable if cross compiling on x86/amd64 since we must run gen_matypes + if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then + case "$host_cpu" in +- i?86 | x86_64 | amd64) ++ i?86 | amd64 | amd64) + if test "x$host_cpu" != "x$target_cpu"; then + enable_asm=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cross compiling" >&5 +@@ -20982,10 +20982,10 @@ if test "x$enable_asm" = xyes; then + ;; + esac + ;; +- x86_64|amd64) ++ amd64|amd64) + case "$host_os" in + linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*) +- asm_arch=x86_64 ++ asm_arch=amd64 + ;; + esac + ;; +@@ -21004,10 +21004,10 @@ if test "x$enable_asm" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, x86" >&5 + $as_echo "yes, x86" >&6; } + ;; +- x86_64|amd64) ++ amd64|amd64) + DEFINES="$DEFINES -DUSE_X86_64_ASM" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, x86_64" >&5 +-$as_echo "yes, x86_64" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, amd64" >&5 ++$as_echo "yes, amd64" >&6; } + ;; + sparc) + DEFINES="$DEFINES -DUSE_SPARC_ASM" +@@ -22308,26 +22308,26 @@ llvm_add_target() { + strip_unwanted_llvm_flags() { + # Use \> (marks the end of the word) + echo `$1` | sed \ +- -e 's/-march=\S*//g' \ +- -e 's/-mtune=\S*//g' \ +- -e 's/-mcpu=\S*//g' \ +- -e 's/-DNDEBUG\>//g' \ +- -e 's/-D_GNU_SOURCE\>//g' \ +- -e 's/-pedantic\>//g' \ +- -e 's/-Wcovered-switch-default\>//g' \ +- -e 's/-O.\>//g' \ +- -e 's/-g\>//g' \ +- -e 's/-Wall\>//g' \ +- -e 's/-Wcast-qual\>//g' \ +- -e 's/-Woverloaded-virtual\>//g' \ +- -e 's/-fcolor-diagnostics\>//g' \ +- -e 's/-fdata-sections\>//g' \ +- -e 's/-ffunction-sections\>//g' \ +- -e 's/-fno-exceptions\>//g' \ +- -e 's/-fomit-frame-pointer\>//g' \ +- -e 's/-fvisibility-inlines-hidden\>//g' \ +- -e 's/-fPIC\>//g' \ +- -e 's/-fstack-protector-strong\>//g' ++ -e 's/-march=[:graph:]* //g' \ ++ -e 's/-mtune=[:graph:]* //g' \ ++ -e 's/-mcpu=[:graph:]* //g' \ ++ -e 's/-DNDEBUG[[:>:]]//g' \ ++ -e 's/-D_GNU_SOURCE[[:>:]]//g' \ ++ -e 's/-pedantic[[:>:]]//g' \ ++ -e 's/-Wcovered-switch-default[[:>:]]//g' \ ++ -e 's/-O.[[:>:]]//g' \ ++ -e 's/-g[[:>:]]//g' \ ++ -e 's/-Wall[[:>:]]//g' \ ++ -e 's/-Wcast-qual[[:>:]]//g' \ ++ -e 's/-Woverloaded-virtual[[:>:]]//g' \ ++ -e 's/-fcolor-diagnostics[[:>:]]//g' \ ++ -e 's/-fdata-sections[[:>:]]//g' \ ++ -e 's/-ffunction-sections[[:>:]]//g' \ ++ -e 's/-fno-exceptions[[:>:]]//g' \ ++ -e 's/-fomit-frame-pointer[[:>:]]//g' \ ++ -e 's/-fvisibility-inlines-hidden[[:>:]]//g' \ ++ -e 's/-fPIC[[:>:]]//g' \ ++ -e 's/-fstack-protector-strong[[:>:]]//g' + } + + llvm_set_environment_variables() { +@@ -22526,7 +22526,7 @@ fi + + case "$host_os" in -linux*) +linux*|freebsd*) @@ -46,108 +338,15 @@ dri3_default=yes ;; *) -@@ -21543,6 +21552,78 @@ - have_libudev=yes - fi - -+ -+pkg_failed=no -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDEVQ" >&5 -+$as_echo_n "checking for LIBDEVQ... " >&6; } -+ -+if test -n "$LIBDEVQ_CFLAGS"; then -+ pkg_cv_LIBDEVQ_CFLAGS="$LIBDEVQ_CFLAGS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0 >= \$LIBDEVQ_REQUIRED\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libdevq-1.0 >= $LIBDEVQ_REQUIRED") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_LIBDEVQ_CFLAGS=`$PKG_CONFIG --cflags "libdevq-1.0 >= $LIBDEVQ_REQUIRED" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+if test -n "$LIBDEVQ_LIBS"; then -+ pkg_cv_LIBDEVQ_LIBS="$LIBDEVQ_LIBS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdevq-1.0 >= \$LIBDEVQ_REQUIRED\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libdevq-1.0 >= $LIBDEVQ_REQUIRED") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_LIBDEVQ_LIBS=`$PKG_CONFIG --libs "libdevq-1.0 >= $LIBDEVQ_REQUIRED" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+ -+ -+ -+if test $pkg_failed = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi -+ if test $_pkg_short_errors_supported = yes; then -+ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdevq-1.0 >= $LIBDEVQ_REQUIRED" 2>&1` -+ else -+ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdevq-1.0 >= $LIBDEVQ_REQUIRED" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$LIBDEVQ_PKG_ERRORS" >&5 -+ -+ have_libdevq=no -+elif test $pkg_failed = untried; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ have_libdevq=no -+else -+ LIBDEVQ_CFLAGS=$pkg_cv_LIBDEVQ_CFLAGS -+ LIBDEVQ_LIBS=$pkg_cv_LIBDEVQ_LIBS -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ have_libdevq=yes -+fi -+ - # Check whether --enable-sysfs was given. - if test "${enable_sysfs+set}" = set; then : - enableval=$enable_sysfs; have_sysfs="$enableval" -@@ -22258,6 +22339,10 @@ - DEFINES="$DEFINES -DHAVE_LIBUDEV" - have_pci_id=yes - fi -+if test "$have_libdevq" = yes; then -+ DEFINES="$DEFINES -DHAVE_LIBDEVQ" -+ have_pci_id=yes -+fi - - if test "$have_sysfs" = yes; then - DEFINES="$DEFINES -DHAVE_SYSFS" -@@ -22396,6 +22481,22 @@ +@@ -24074,6 +24074,20 @@ if test "x$enable_dri" = xyes; then + with_dri_drivers="swrast" + fi ;; - gnu*) - DEFINES="$DEFINES -DHAVE_ALIAS" ++ *freebsd*) + if test "x$enable_dri3" = xyes; then + DEFINES="$DEFINES -DHAVE_DRI3" + fi + -+ if test "x$have_libdevq" != xyes; then -+ as_fn_error $? "libdevq required for building DRI" "$LINENO" 5 -+ fi -+ + case "$host_cpu" in + powerpc* | sparc*) + # Build only the drivers for cards that exist on PowerPC/sparc @@ -156,45 +355,60 @@ + fi + ;; + esac - ;; - cygwin*) - if test "x$with_dri_drivers" = "xyes"; then -@@ -23195,6 +23296,8 @@ ++ ;; + esac - if test "x$need_pci_id$have_libudev" = xyesyes; then - GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED" -+elif test "x$need_libdevq" = xyes; then -+ GBM_PC_REQ_PRIV="libdevq-1.0 >= $LIBDEVQ_REQUIRED" - else - GBM_PC_REQ_PRIV="" - fi -@@ -24018,9 +24121,19 @@ + # default drivers +@@ -25794,6 +25808,14 @@ if test "x$enable_opencl" = xyes; then as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5 fi + if test "x$acv_mesa_CLANG" = xno; then -+ -+ GCC_VERSION=`$CC -dumpversion` -+ if test $? -eq 0; then -+ GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` -+ GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` ++ GCC_VERSION=`$CC -dumpversion` ++ if test $? -eq 0; then ++ GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` ++ GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` ++ fi + fi + if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5 fi -+# end of clang test. -+ fi - - if test "x$have_libclc" = xno; then - as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover. -@@ -24835,9 +24948,6 @@ - CLANG_LIBDIR=${LLVM_LIBDIR} - fi - CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} -- if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then : +@@ -25837,10 +25859,6 @@ if test "x$enable_opencl" = xyes; then + if test -z "$CLANG_LIBDIR"; then + CLANG_LIBDIR=${LLVM_LIBDIR} + fi +- CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} +- if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then : - as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5 -fi - fi - else - MESA_LLVM=0 + fi + if test "x$enable_opencl" = xyes; then + HAVE_CLOVER_TRUE= +@@ -26389,7 +26407,7 @@ if test -z "$with_gallium_drivers"; then + fi + if test "x$enable_gallium_llvm" = xauto; then + case "$host_cpu" in +- i*86|x86_64|amd64) enable_gallium_llvm=yes;; ++ i*86|amd64|amd64) enable_gallium_llvm=yes;; + esac + fi + +@@ -28005,7 +28023,7 @@ else + fi + + +- if test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64; then ++ if test "x$asm_arch" = xx86 -o "x$asm_arch" = xamd64; then + HAVE_X86_ASM_TRUE= + HAVE_X86_ASM_FALSE='#' + else +@@ -28013,7 +28031,7 @@ else + HAVE_X86_ASM_FALSE= + fi + +- if test "x$asm_arch" = xx86_64; then ++ if test "x$asm_arch" = xamd64; then + HAVE_X86_64_ASM_TRUE= + HAVE_X86_64_ASM_FALSE='#' + else Index: graphics/libGL/files/patch-include__GL__internal__dri_interface.h =================================================================== --- graphics/libGL/files/patch-include__GL__internal__dri_interface.h +++ graphics/libGL/files/patch-include__GL__internal__dri_interface.h @@ -1,8 +1,8 @@ GCC on 9.x doesn't allow types to be overwritten, these types are defined in drm.h also, which causes build issues in xorg-server. ---- include/GL/internal/dri_interface.h.orig 2015-12-05 10:55:50.545108000 +0100 -+++ include/GL/internal/dri_interface.h 2015-12-05 10:56:03.408589000 +0100 +--- include/GL/internal/dri_interface.h.orig 2017-01-25 13:26:33 UTC ++++ include/GL/internal/dri_interface.h @@ -40,13 +40,7 @@ #ifndef DRI_INTERFACE_H #define DRI_INTERFACE_H Index: graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c =================================================================== --- graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c +++ graphics/libGL/files/patch-src__gallium__auxiliary__pipe-loader__pipe_loader_drm.c @@ -25,9 +25,9 @@ Reviewed-by: Francisco Jerez ---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2015-12-21 10:05:52.000000000 +0100 -+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c 2015-12-22 20:18:18.734280000 +0100 -@@ -90,6 +90,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa +--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-01-25 13:26:33 UTC ++++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +@@ -225,6 +225,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa } static int @@ -42,7 +42,7 @@ open_drm_render_node_minor(int minor) { char path[PATH_MAX]; -@@ -101,8 +109,15 @@ open_drm_render_node_minor(int minor) +@@ -236,8 +244,15 @@ open_drm_render_node_minor(int minor) int pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev) { @@ -58,8 +58,8 @@ + /* Look for render nodes first */ for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0; i <= DRM_RENDER_NODE_MAX_MINOR; i++) { - fd = open_drm_render_node_minor(i); -@@ -115,6 +130,9 @@ pipe_loader_drm_probe(struct pipe_loader + struct pipe_loader_device *dev; +@@ -251,6 +266,9 @@ pipe_loader_drm_probe(struct pipe_loader continue; } @@ -69,7 +69,7 @@ if (j < ndev) { devs[j] = dev; } else { -@@ -124,6 +142,46 @@ pipe_loader_drm_probe(struct pipe_loader +@@ -260,6 +278,46 @@ pipe_loader_drm_probe(struct pipe_loader j++; } Index: graphics/libGL/files/patch-src__gallium__auxiliary__util__u_network.c =================================================================== --- graphics/libGL/files/patch-src__gallium__auxiliary__util__u_network.c +++ graphics/libGL/files/patch-src__gallium__auxiliary__util__u_network.c @@ -0,0 +1,12 @@ +--- src/gallium/auxiliary/util/u_network.c.orig 2017-01-25 13:26:33 UTC ++++ src/gallium/auxiliary/util/u_network.c +@@ -7,7 +7,8 @@ + # include + # include + #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \ +- defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) ++ defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) || \ ++ defined(PIPE_OS_BSD) + # include + # include + # include Index: graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h =================================================================== --- graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h +++ graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h @@ -1,7 +1,7 @@ ---- src/gallium/include/pipe/p_config.h.orig 2015-11-29 13:40:59 UTC +--- src/gallium/include/pipe/p_config.h.orig 2017-01-25 13:26:34 UTC +++ src/gallium/include/pipe/p_config.h -@@ -81,6 +81,13 @@ - #define PIPE_CC_SUNPRO +@@ -76,6 +76,13 @@ + #define PIPE_CC_ICL #endif +#if defined(__sparc__) || defined(__sparc64__) @@ -14,7 +14,7 @@ /* * Processor architecture -@@ -171,7 +178,7 @@ +@@ -130,7 +137,7 @@ #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64) #define PIPE_ARCH_LITTLE_ENDIAN @@ -23,7 +23,7 @@ #define PIPE_ARCH_BIG_ENDIAN #endif -@@ -200,6 +207,12 @@ +@@ -159,6 +166,12 @@ #define PIPE_OS_ANDROID #endif Index: graphics/libGL/files/patch-src__gallium__state_trackers__clover__util__range.hpp =================================================================== --- graphics/libGL/files/patch-src__gallium__state_trackers__clover__util__range.hpp +++ graphics/libGL/files/patch-src__gallium__state_trackers__clover__util__range.hpp @@ -5,13 +5,7 @@ See: https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3 ---- - src/gallium/state_trackers/clover/util/range.hpp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/gallium/state_trackers/clover/util/range.hpp b/src/gallium/state_trackers/clover/util/range.hpp -index afa5f77..359edda 100644 ---- src/gallium/state_trackers/clover/util/range.hpp +--- src/gallium/state_trackers/clover/util/range.hpp.orig 2017-01-25 13:26:34 UTC +++ src/gallium/state_trackers/clover/util/range.hpp @@ -362,6 +362,12 @@ namespace clover { return { i, i + n }; @@ -35,6 +29,3 @@ map(F &&f, Rs &&... rs) { return { std::forward(f), std::forward(rs)... }; } --- -1.8.5.4 - Index: graphics/libGL/files/patch-src__gallium__winsys__svga__drm__vmw_screen_ioctl.c =================================================================== --- graphics/libGL/files/patch-src__gallium__winsys__svga__drm__vmw_screen_ioctl.c +++ graphics/libGL/files/patch-src__gallium__winsys__svga__drm__vmw_screen_ioctl.c @@ -1,8 +1,8 @@ ---- ./src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig 2014-01-06 22:15:40.000000000 +0100 -+++ ./src/gallium/winsys/svga/drm/vmw_screen_ioctl.c 2014-02-23 22:01:50.000000000 +0100 -@@ -66,6 +66,11 @@ - */ - #define SVGA3D_SURFACE_HINT_SCANOUT (1 << 9) +--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig 2017-01-25 13:26:34 UTC ++++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +@@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio + return region->size; + } +#if defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__NetBSD__) || defined(__OpenBSD__) Index: graphics/libGL/files/patch-src__loader__Makefile.in =================================================================== --- graphics/libGL/files/patch-src__loader__Makefile.in +++ graphics/libGL/files/patch-src__loader__Makefile.in @@ -1,8 +1,8 @@ ---- src/loader/Makefile.in.orig 2015-12-04 10:21:50.951759000 +0100 -+++ src/loader/Makefile.in 2015-12-04 10:27:14.391665000 +0100 -@@ -531,7 +531,7 @@ - $(LIBDRM_CFLAGS) \ - $(LIBUDEV_CFLAGS) +--- src/loader/Makefile.in.orig 2017-02-04 23:43:32 UTC ++++ src/loader/Makefile.in +@@ -538,7 +538,7 @@ AM_CPPFLAGS = \ + $(XCB_DRI3_CFLAGS) \ + $(LIBDRM_CFLAGS) -libloader_la_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1) +libloader_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDEVQ_CFLAGS) $(am__append_1) Index: graphics/libGL/files/patch-src__loader__loader.c =================================================================== --- graphics/libGL/files/patch-src__loader__loader.c +++ graphics/libGL/files/patch-src__loader__loader.c @@ -1,91 +1,320 @@ ---- src/loader/loader.c.orig 2015-08-22 12:01:00.000000000 +0200 -+++ src/loader/loader.c 2015-08-24 10:50:05.251081000 +0200 -@@ -70,7 +70,7 @@ - #include +--- src/loader/loader.c.orig 2017-01-25 13:26:34 UTC ++++ src/loader/loader.c +@@ -33,6 +33,16 @@ #include + #include #include --#ifdef HAVE_LIBUDEV -+#if defined(HAVE_LIBUDEV) || defined(HAVE_LIBDEVQ) - #include - #include - #include -@@ -505,6 +505,54 @@ sysfs_get_pci_id_for_fd(int fd, int *ven ++ ++ ++#include ++#include ++#include ++#include ++ ++#undef HAVE_LIBDRM ++#define HAVE_LIBUDEV 1 ++ + #ifdef MAJOR_IN_MKDEV + #include + #endif +@@ -82,6 +92,231 @@ loader_open_device(const char *device_na + return fd; } - #endif -+#if defined(HAVE_LIBDEVQ) -+#include ++#ifdef HAVE_LIBUDEV ++#include + -+static void *devq_handle = NULL; ++static void *udev_handle = NULL; + +static void * -+devq_dlopen_handle(void) ++udev_dlopen_handle(void) +{ -+ if (!devq_handle) { -+ devq_handle = dlopen("libdevq.so.0", RTLD_LOCAL | RTLD_LAZY); -+ } ++ char name[80]; ++ unsigned flags = RTLD_NOLOAD | RTLD_LOCAL | RTLD_LAZY; ++ int version; + -+ return devq_handle; ++ /* libudev.so.1 changed the return types of the two unref functions ++ * from voids to pointers. We don't use those return values, and the ++ * only ABI I've heard that cares about this kind of change (calling ++ * a function with a void * return that actually only returns void) ++ * might be ia64. ++ */ ++ ++ /* First try opening an already linked libudev, then try loading one */ ++ do { ++ for (version = 1; version >= 0; version--) { ++ snprintf(name, sizeof(name), "libudev.so.%d", version); ++ udev_handle = dlopen(name, flags); ++ if (udev_handle) ++ return udev_handle; ++ } ++ ++ if ((flags & RTLD_NOLOAD) == 0) ++ break; ++ ++ flags &= ~RTLD_NOLOAD; ++ } while (1); ++ ++ log_(_LOADER_WARNING, ++ "Couldn't dlopen libudev.so.1 or " ++ "libudev.so.0, driver detection may be broken.\n"); ++ return NULL; +} + ++static int dlsym_failed = 0; ++ +static void * -+asserted_dlsym(void *dlopen_handle, const char *name) ++checked_dlsym(void *dlopen_handle, const char *name) +{ + void *result = dlsym(dlopen_handle, name); -+ assert(result); ++ if (!result) ++ dlsym_failed = 1; + return result; +} + -+#define DEVQ_SYMBOL(ret, name, args) \ -+ ret (*name) args = asserted_dlsym(devq_dlopen_handle(), #name); ++#define UDEV_SYMBOL(ret, name, args) \ ++ ret (*name) args = checked_dlsym(udev_dlopen_handle(), #name); + ++ ++static inline struct udev_device * ++udev_device_new_from_fd(struct udev *udev, int fd) ++{ ++ struct udev_device *device; ++ struct stat buf; ++ UDEV_SYMBOL(struct udev_device *, udev_device_new_from_devnum, ++ (struct udev *udev, char type, dev_t devnum)); ++ ++ if (dlsym_failed) ++ return NULL; ++ ++ if (fstat(fd, &buf) < 0) { ++ log_(_LOADER_WARNING, "MESA-LOADER: failed to stat fd %d\n", fd); ++ return NULL; ++ } ++ ++ device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev); ++ if (device == NULL) { ++ log_(_LOADER_WARNING, ++ "MESA-LOADER: could not create udev device for fd %d\n", fd); ++ return NULL; ++ } ++ ++ return device; ++} ++ +static int -+devq_get_pci_id_from_fd(int fd, int *vendor_id, int *chip_id) ++libudev_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id) +{ -+ int ret; -+ DEVQ_SYMBOL(int, devq_device_get_pciid_from_fd, -+ (int fd, int *vendor_id, int *chip_id)); ++ struct udev *udev = NULL; ++ struct udev_device *device = NULL, *parent; ++ const char *pci_id; ++ UDEV_SYMBOL(struct udev *, udev_new, (void)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_get_parent, ++ (struct udev_device *)); ++ UDEV_SYMBOL(const char *, udev_device_get_property_value, ++ (struct udev_device *, const char *)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_unref, ++ (struct udev_device *)); ++ UDEV_SYMBOL(struct udev *, udev_unref, (struct udev *)); + + *chip_id = -1; + -+ ret = devq_device_get_pciid_from_fd(fd, vendor_id, chip_id); -+ if (ret < 0) { -+ log_(_LOADER_WARNING, "MESA-LOADER: could not get PCI ID\n"); ++ if (dlsym_failed) ++ return 0; ++ ++ udev = udev_new(); ++ device = udev_device_new_from_fd(udev, fd); ++ if (!device) + goto out; ++ ++ parent = udev_device_get_parent(device); ++ if (parent == NULL) { ++ log_(_LOADER_WARNING, "MESA-LOADER: could not get parent device\n"); ++ goto out; + } + ++ pci_id = udev_device_get_property_value(parent, "PCI_ID"); ++ if (pci_id == NULL) { ++ log_(_LOADER_INFO, "MESA-LOADER: no PCI ID\n"); ++ *chip_id = -1; ++ goto out; ++ } else if (sscanf(pci_id, "%x:%x", vendor_id, chip_id) != 2) { ++ log_(_LOADER_WARNING, "MESA-LOADER: malformed PCI ID\n"); ++ *chip_id = -1; ++ goto out; ++ } ++ +out: ++ if (device) ++ udev_device_unref(device); ++ if (udev) ++ udev_unref(udev); ++ + return (*chip_id >= 0); +} + ++static char * ++get_render_node_from_id_path_tag(struct udev *udev, ++ char *id_path_tag, ++ char another_tag) ++{ ++ struct udev_device *device; ++ struct udev_enumerate *e; ++ struct udev_list_entry *entry; ++ const char *path, *id_path_tag_tmp; ++ char *path_res; ++ char found = 0; ++ UDEV_SYMBOL(struct udev_enumerate *, udev_enumerate_new, ++ (struct udev *)); ++ UDEV_SYMBOL(int, udev_enumerate_add_match_subsystem, ++ (struct udev_enumerate *, const char *)); ++ UDEV_SYMBOL(int, udev_enumerate_add_match_sysname, ++ (struct udev_enumerate *, const char *)); ++ UDEV_SYMBOL(int, udev_enumerate_scan_devices, ++ (struct udev_enumerate *)); ++ UDEV_SYMBOL(struct udev_list_entry *, udev_enumerate_get_list_entry, ++ (struct udev_enumerate *)); ++ UDEV_SYMBOL(void, udev_enumerate_unref, ++ (struct udev_enumerate *)); ++ UDEV_SYMBOL(struct udev_list_entry *, udev_list_entry_get_next, ++ (struct udev_list_entry *)); ++ UDEV_SYMBOL(const char *, udev_list_entry_get_name, ++ (struct udev_list_entry *)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_new_from_syspath, ++ (struct udev *, const char *)); ++ UDEV_SYMBOL(const char *, udev_device_get_property_value, ++ (struct udev_device *, const char *)); ++ UDEV_SYMBOL(const char *, udev_device_get_devnode, ++ (struct udev_device *)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_unref, ++ (struct udev_device *)); ++ ++ e = udev_enumerate_new(udev); ++ udev_enumerate_add_match_subsystem(e, "drm"); ++ udev_enumerate_add_match_sysname(e, "render*"); ++ ++ udev_enumerate_scan_devices(e); ++ udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { ++ path = udev_list_entry_get_name(entry); ++ device = udev_device_new_from_syspath(udev, path); ++ if (!device) ++ continue; ++ id_path_tag_tmp = udev_device_get_property_value(device, "ID_PATH_TAG"); ++ if (id_path_tag_tmp) { ++ if ((!another_tag && !strcmp(id_path_tag, id_path_tag_tmp)) || ++ (another_tag && strcmp(id_path_tag, id_path_tag_tmp))) { ++ found = 1; ++ break; ++ } ++ } ++ udev_device_unref(device); ++ } ++ ++ udev_enumerate_unref(e); ++ ++ if (found) { ++ path_res = strdup(udev_device_get_devnode(device)); ++ udev_device_unref(device); ++ return path_res; ++ } ++ return NULL; ++} ++ ++static char * ++get_id_path_tag_from_fd(struct udev *udev, int fd) ++{ ++ struct udev_device *device; ++ const char *id_path_tag_tmp; ++ char *id_path_tag; ++ UDEV_SYMBOL(const char *, udev_device_get_property_value, ++ (struct udev_device *, const char *)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_unref, ++ (struct udev_device *)); ++ ++ device = udev_device_new_from_fd(udev, fd); ++ if (!device) ++ return NULL; ++ ++ id_path_tag_tmp = udev_device_get_property_value(device, "ID_PATH_TAG"); ++ if (!id_path_tag_tmp) ++ return NULL; ++ ++ id_path_tag = strdup(id_path_tag_tmp); ++ ++ udev_device_unref(device); ++ return id_path_tag; ++} +#endif + -+ #if defined(HAVE_LIBDRM) - /* for i915 */ - #include -@@ -588,6 +636,10 @@ loader_get_pci_id_for_fd(int fd, int *ve - if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id)) + #ifdef USE_DRICONF + static const char __driConfigOptionsLoader[] = +@@ -304,9 +539,48 @@ loader_get_pci_id_for_fd(int fd, int *ve + if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id)) return 1; #endif -+#if HAVE_LIBDEVQ -+ if (devq_get_pci_id_from_fd(fd, vendor_id, chip_id)) ++#if HAVE_LIBUDEV ++ if (libudev_get_pci_id_for_fd(fd, vendor_id, chip_id)) + return 1; ++#endif + return 0; + } + ++#ifdef HAVE_LIBUDEV ++static char * ++libudev_get_device_name_for_fd(int fd) ++{ ++ char *device_name = NULL; ++ struct udev *udev; ++ struct udev_device *device; ++ const char *const_device_name; ++ UDEV_SYMBOL(struct udev *, udev_new, (void)); ++ UDEV_SYMBOL(const char *, udev_device_get_devnode, ++ (struct udev_device *)); ++ UDEV_SYMBOL(struct udev_device *, udev_device_unref, ++ (struct udev_device *)); ++ UDEV_SYMBOL(struct udev *, udev_unref, (struct udev *)); ++ ++ if (dlsym_failed) ++ return NULL; ++ ++ udev = udev_new(); ++ device = udev_device_new_from_fd(udev, fd); ++ if (device == NULL) ++ return NULL; ++ ++ const_device_name = udev_device_get_devnode(device); ++ if (!const_device_name) ++ goto out; ++ device_name = strdup(const_device_name); ++ ++out: ++ udev_device_unref(device); ++ udev_unref(udev); ++ return device_name; ++} +#endif ++ + + #if defined(HAVE_LIBDRM) + static char * +@@ -332,6 +606,10 @@ loader_get_device_name_for_fd(int fd) + { + char *result = NULL; + ++#if HAVE_LIBUDEV ++ if ((result = libudev_get_device_name_for_fd(fd))) ++ return result; ++#endif #if HAVE_LIBDRM - if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id)) - return 1; -@@ -685,6 +737,13 @@ loader_get_device_name_for_fd(int fd) - if ((result = sysfs_get_device_name_for_fd(fd))) + if ((result = drm_get_device_name_for_fd(fd))) return result; - #endif -+#if HAVE_LIBDEVQ -+#if 0 -+/* XXX implement this function in libdevq */ -+ if ((result = devq_device_get_name_for_fd(fd))) -+ return result; -+#endif -+#endif - return result; +@@ -386,7 +664,7 @@ loader_get_driver_for_fd(int fd) + + out: + log_(driver ? _LOADER_DEBUG : _LOADER_WARNING, +- "pci id for fd %d: %04x:%04x, driver %s\n", ++ "UGH....pci id for fd %d: %04x:%04x, driver %s\n", + fd, vendor_id, chip_id, driver); + return driver; } - Index: graphics/libGL/files/patch-src__mapi__entry_x86-64_tls.h =================================================================== --- graphics/libGL/files/patch-src__mapi__entry_x86-64_tls.h +++ graphics/libGL/files/patch-src__mapi__entry_x86-64_tls.h @@ -1,13 +0,0 @@ ---- src/mapi/entry_x86-64_tls.h.orig 2013-10-05 05:59:22.000000000 +0200 -+++ src/mapi/entry_x86-64_tls.h 2014-07-29 20:28:05.000000000 +0200 -@@ -63,8 +63,8 @@ entry_patch_public(void) - { - } - --static char --x86_64_entry_start[]; -+extern char -+x86_64_entry_start[] __attribute__((visibility("hidden"))); - - mapi_func - entry_get_public(int slot) Index: graphics/libGL/files/patch-src__mapi__entry_x86_tls.h =================================================================== --- graphics/libGL/files/patch-src__mapi__entry_x86_tls.h +++ graphics/libGL/files/patch-src__mapi__entry_x86_tls.h @@ -1,13 +0,0 @@ ---- src/mapi/entry_x86_tls.h.orig 2013-10-05 05:59:22.000000000 +0200 -+++ src/mapi/entry_x86_tls.h 2014-07-29 20:28:05.000000000 +0200 -@@ -73,8 +73,8 @@ __asm__(".text"); - extern unsigned long - x86_current_tls(); - --static char x86_entry_start[]; --static char x86_entry_end[]; -+extern char x86_entry_start[] __attribute__((visibility("hidden"))); -+extern char x86_entry_end[] __attribute__((visibility("hidden"))); - - void - entry_patch_public(void) Index: graphics/libGL/files/patch-src__mapi__entry_x86_tsd.h =================================================================== --- graphics/libGL/files/patch-src__mapi__entry_x86_tsd.h +++ graphics/libGL/files/patch-src__mapi__entry_x86_tsd.h @@ -1,13 +0,0 @@ ---- src/mapi/entry_x86_tsd.h.orig 2013-10-05 05:59:22.000000000 +0200 -+++ src/mapi/entry_x86_tsd.h 2014-07-29 20:28:05.000000000 +0200 -@@ -60,8 +60,8 @@ __asm__(".balign 32\n" - #include - #include "u_execmem.h" - --static const char x86_entry_start[]; --static const char x86_entry_end[]; -+extern const char x86_entry_start[] __attribute__((visibility("hidden"))); -+extern const char x86_entry_end[] __attribute__((visibility("hidden"))); - - void - entry_patch_public(void) Index: graphics/libGL/files/patch-src__mapi__glapi__gen__gl_gentable.py =================================================================== --- graphics/libGL/files/patch-src__mapi__glapi__gen__gl_gentable.py +++ graphics/libGL/files/patch-src__mapi__glapi__gen__gl_gentable.py @@ -1,6 +1,6 @@ ---- src/mapi/glapi/gen/gl_gentable.py.orig 2014-11-21 13:09:28.624910062 +0100 -+++ src/mapi/glapi/gen/gl_gentable.py 2014-11-21 13:10:48.294268333 +0100 -@@ -42,7 +42,7 @@ +--- src/mapi/glapi/gen/gl_gentable.py.orig 2017-02-04 23:43:32 UTC ++++ src/mapi/glapi/gen/gl_gentable.py +@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used #endif #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\ Index: graphics/libGL/files/patch-src__mesa__main__compiler.h =================================================================== --- graphics/libGL/files/patch-src__mesa__main__compiler.h +++ graphics/libGL/files/patch-src__mesa__main__compiler.h @@ -1,6 +1,6 @@ ---- src/mesa/main/compiler.h.orig 2015-06-07 06:45:48.000000000 -0400 -+++ src/mesa/main/compiler.h 2015-06-16 05:04:53.967546000 -0400 -@@ -70,6 +70,9 @@ +--- src/mesa/main/compiler.h.orig 2017-01-25 13:26:34 UTC ++++ src/mesa/main/compiler.h +@@ -56,6 +56,9 @@ extern "C" { #if defined(__linux__) #include #define CPU_TO_LE32( x ) bswap_32( x ) Index: graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp =================================================================== --- graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp +++ graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp @@ -0,0 +1,14 @@ +--- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2017-02-06 13:49:09 UTC ++++ src/gallium/state_trackers/clover/llvm/invocation.cpp +@@ -105,8 +105,9 @@ namespace { + // Parse the compiler options. A file name should be present at the end + // and must have the .cl extension in order for the CompilerInvocation + // class to recognize it as an OpenCL source file. +- const std::vector copts = +- map(std::mem_fn(&std::string::c_str), opts); ++ std::vector copts; ++ std::transform(opts.begin(), opts.end(), std::back_inserter(copts), std::mem_fn(&std::string::c_str)); ++// map(std::mem_fn(&std::string::c_str), opts); + + if (!clang::CompilerInvocation::CreateFromArgs( + c->getInvocation(), copts.data(), copts.data() + copts.size(), diag)) Index: graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp =================================================================== --- graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp +++ graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp @@ -0,0 +1,11 @@ +--- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig 2017-01-25 13:26:34 UTC ++++ src/gallium/state_trackers/clover/llvm/metadata.hpp +@@ -42,7 +42,7 @@ namespace clover { + get_kernel_nodes(const ::llvm::Module &mod) { + if (const ::llvm::NamedMDNode *n = + mod.getNamedMetadata("opencl.kernels")) +- return { n->op_begin(), n->op_end() }; ++ return { n->getOperand(0), n->getOperand(n->getNumOperands()) }; + else + return {}; + } Index: graphics/libGL/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__winsys.c =================================================================== --- graphics/libGL/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__winsys.c +++ graphics/libGL/files/patch-src_gallium_winsys_amdgpu_drm_amdgpu__winsys.c @@ -0,0 +1,18 @@ +--- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c.orig 2017-01-25 13:26:34 UTC ++++ src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +@@ -107,6 +107,7 @@ static bool do_winsys_init(struct amdgpu + int r, i, j; + drmDevicePtr devinfo; + ++#ifdef NEED_REDUNDANT_PCIINFO + /* Get PCI info. */ + r = drmGetDevice(fd, &devinfo); + if (r) { +@@ -118,6 +119,7 @@ static bool do_winsys_init(struct amdgpu + ws->info.pci_dev = devinfo->businfo.pci->dev; + ws->info.pci_func = devinfo->businfo.pci->func; + drmFreeDevice(&devinfo); ++#endif + + /* Query hardware and driver information. */ + r = amdgpu_query_gpu_info(ws->dev, &ws->amdinfo); Index: graphics/libGL/files/patch-src_intel_tools_aubinator.c =================================================================== --- graphics/libGL/files/patch-src_intel_tools_aubinator.c +++ graphics/libGL/files/patch-src_intel_tools_aubinator.c @@ -0,0 +1,13 @@ +Not sure if these mmap() flags are right ... + +--- src/intel/tools/aubinator.c.orig 2017-01-25 13:26:34 UTC ++++ src/intel/tools/aubinator.c +@@ -1299,7 +1299,7 @@ int main(int argc, char *argv[]) + /* mmap a terabyte for our gtt space. */ + gtt_size = 1ull << 40; + gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE, +- MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); ++ MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0); + if (gtt == MAP_FAILED) { + fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno)); + exit(EXIT_FAILURE); Index: graphics/libGL/files/patch-src_util_ralloc.c =================================================================== --- graphics/libGL/files/patch-src_util_ralloc.c +++ graphics/libGL/files/patch-src_util_ralloc.c @@ -1,6 +1,6 @@ ---- src/util/ralloc.c.orig 2015-08-07 17:36:03 UTC +--- src/util/ralloc.c.orig 2017-01-25 13:26:34 UTC +++ src/util/ralloc.c -@@ -311,6 +311,7 @@ ralloc_parent(const void *ptr) +@@ -325,6 +325,7 @@ ralloc_parent(const void *ptr) static void *autofree_context = NULL; @@ -8,7 +8,7 @@ static void autofree(void) { -@@ -322,7 +323,6 @@ ralloc_autofree_context(void) +@@ -336,7 +337,6 @@ ralloc_autofree_context(void) { if (unlikely(autofree_context == NULL)) { autofree_context = ralloc_context(NULL); Index: graphics/libGL/files/patch-src_util_u__endian.h =================================================================== --- graphics/libGL/files/patch-src_util_u__endian.h +++ graphics/libGL/files/patch-src_util_u__endian.h @@ -0,0 +1,12 @@ +--- src/util/u_endian.h.orig 2017-01-25 13:26:34 UTC ++++ src/util/u_endian.h +@@ -54,7 +54,8 @@ + # define PIPE_ARCH_BIG_ENDIAN + #endif + +-#elif defined(__OpenBSD__) || defined(__NetBSD__) ++#elif defined(__OpenBSD__) || defined(__NetBSD__)|| \ ++ defined(__FreeBSD__) || defined(__DragonFly__) + #include + #include + Index: graphics/libGL/files/src__loader__Makefile.am =================================================================== --- graphics/libGL/files/src__loader__Makefile.am +++ graphics/libGL/files/src__loader__Makefile.am @@ -1,12 +0,0 @@ ---- src/loader/Makefile.am.orig 2015-02-13 11:41:50.497483000 +0100 -+++ src/loader/Makefile.am 2015-02-13 11:42:02.748812000 +0100 -@@ -30,7 +30,8 @@ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ - $(VISIBILITY_CFLAGS) \ -- $(LIBUDEV_CFLAGS) -+ $(LIBUDEV_CFLAGS) \ -+ $(LIBDEVQ_CFLAGS) - - libloader_la_SOURCES = $(LOADER_C_FILES) - libloader_la_LIBADD = Index: graphics/libGL/pkg-plist =================================================================== --- graphics/libGL/pkg-plist +++ graphics/libGL/pkg-plist @@ -5,8 +5,6 @@ include/GL/glx.h include/GL/glx_mangle.h include/GL/glxext.h -@comment include/GL/osmesa.h -include/GL/wglext.h lib/.mesa/libGL.so lib/.mesa/libGL.so.1 lib/.mesa/libGL.so.1.2.0 Index: graphics/libglapi/Makefile =================================================================== --- graphics/libglapi/Makefile +++ graphics/libglapi/Makefile @@ -3,7 +3,7 @@ PORTNAME= libglapi PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 5 CATEGORIES= graphics COMMENT= Common GL api library used by Mesa based ports @@ -14,7 +14,7 @@ # stuff not needed by libglapi but configure wants it USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \ - xshmfence + xshmfence dri3proto LIB_DEPENDS+= libexpat.so:textproc/expat2 \ libdrm.so:graphics/libdrm Index: graphics/libglesv2/Makefile =================================================================== --- graphics/libglesv2/Makefile +++ graphics/libglesv2/Makefile @@ -3,7 +3,7 @@ PORTNAME= libglesv2 PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 5 CATEGORIES= graphics COMMENT= OpenGL ES v2 library @@ -14,7 +14,7 @@ # stuff not needed by libglesv2 but configure wants it USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \ - xshmfence + xshmfence dri3proto .include .include "${.CURDIR}/../../graphics/libGL/Makefile.common" Index: graphics/libglesv2/pkg-plist =================================================================== --- graphics/libglesv2/pkg-plist +++ graphics/libglesv2/pkg-plist @@ -3,6 +3,7 @@ include/GLES2/gl2platform.h include/GLES3/gl3.h include/GLES3/gl31.h +include/GLES3/gl32.h include/GLES3/gl3ext.h include/GLES3/gl3platform.h lib/.mesa/libGLESv2.so Index: graphics/libosmesa/Makefile =================================================================== --- graphics/libosmesa/Makefile +++ graphics/libosmesa/Makefile @@ -3,7 +3,7 @@ PORTNAME= libosmesa PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 5 CATEGORIES= graphics COMMENT= Off-Screen Mesa implementation of the OpenGL API @@ -12,7 +12,7 @@ libglapi.so:graphics/libglapi USES= ssl -USE_XORG= x11 xau xcb xdmcp xvmc +USE_XORG= x11 xau xcb xdmcp xvmc presentproto # libosmesa doesn't link agains libGL but osmesa.h needs GL/gl.h # and both headers are intalled by libGL .... USE_GL= gl Index: lang/clover/Makefile =================================================================== --- lang/clover/Makefile +++ lang/clover/Makefile @@ -2,7 +2,7 @@ PORTNAME= clover PORTVERSION= ${MESAVERSION} -PORTREVISION= 0 +PORTREVISION= 4 CATEGORIES= lang COMMENT= Mesa "Clover" OpenCL library @@ -15,7 +15,7 @@ USES= ssl USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto \ - presentproto xvmc xshmfence + presentproto xvmc xshmfence dri3proto ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= Clover needs a graphics driver supported by the Radeon KMS driver @@ -23,11 +23,13 @@ .include .include "${.CURDIR}/../../graphics/libGL/Makefile.common" -#MESA_BUILD_WRKSRC= src/util src/glsl src/mesa src/gallium MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/gallium/targets/pipe-loader .include "${.CURDIR}/../../graphics/libGL/Makefile.targets" +post-configure: + @${CP} ${.CURDIR}/files/git_sha1.h ${WRKSRC}/src/gallium/state_trackers/clover/. + post-install: @${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/ Index: lang/clover/files/git_sha1.h =================================================================== --- lang/clover/files/git_sha1.h +++ lang/clover/files/git_sha1.h @@ -0,0 +1 @@ +/*empty*/