diff options
author | linimon <linimon@FreeBSD.org> | 2012-07-30 12:36:31 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2012-07-30 12:36:31 +0800 |
commit | c5275c16b1ab5132d6b7a848907e83c5d986338f (patch) | |
tree | e8f640ad2bf216ca5fa2c68413b7ce89f78d578e /graphics/libGL | |
parent | 975e0da534b6cb87a40464d9719c1f1aeaa77933 (diff) | |
download | freebsd-ports-gnome-c5275c16b1ab5132d6b7a848907e83c5d986338f.tar.gz freebsd-ports-gnome-c5275c16b1ab5132d6b7a848907e83c5d986338f.tar.zst freebsd-ports-gnome-c5275c16b1ab5132d6b7a848907e83c5d986338f.zip |
Attempt to fix build of dri, libGL, and libdrm on tier-2 archs.
PR: ports/169874
Submitted by: marius, linimon
Tested on: amd64, arm, i386, powerpc, sparc
Thanks to: bz, andyt
Diffstat (limited to 'graphics/libGL')
-rw-r--r-- | graphics/libGL/Makefile | 9 | ||||
-rw-r--r-- | graphics/libGL/bsd.mesalib.mk | 18 | ||||
-rw-r--r-- | graphics/libGL/files/extra-configure | 42 | ||||
-rw-r--r-- | graphics/libGL/files/extra-configure-old | 43 | ||||
-rw-r--r-- | graphics/libGL/files/extra-mach64_context.h-old | 20 | ||||
-rw-r--r-- | graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h | 25 | ||||
-rw-r--r-- | graphics/libGL/files/extra-src__mesa__drivers__dri__radeon__radeon_span.c | 15 |
7 files changed, 168 insertions, 4 deletions
diff --git a/graphics/libGL/Makefile b/graphics/libGL/Makefile index f3f054a1a859..b1f0d35b7d19 100644 --- a/graphics/libGL/Makefile +++ b/graphics/libGL/Makefile @@ -21,4 +21,11 @@ do-install: cd ${WRKSRC}/src/mesa; ${GMAKE} install-libgl .include "${.CURDIR}/bsd.mesalib.mk" -.include <bsd.port.mk> + +.include <bsd.port.pre.mk> + +.if ${ARCH} != "amd64" || ${ARCH} != "i386" +CONFIGURE_ARGS+=--disable-gallium-intel +.endif + +.include <bsd.port.post.mk> diff --git a/graphics/libGL/bsd.mesalib.mk b/graphics/libGL/bsd.mesalib.mk index 102de0e79b24..09a5d91bf694 100644 --- a/graphics/libGL/bsd.mesalib.mk +++ b/graphics/libGL/bsd.mesalib.mk @@ -53,13 +53,18 @@ CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers \ --disable-egl .if defined(WITH_NEW_XORG) -EXTRA_PATCHES+= ${PATCHDIR}/extra-mach64_context.h \ +EXTRA_PATCHES+= ${PATCHDIR}/extra-configure \ + ${PATCHDIR}/extra-mach64_context.h \ ${PATCHDIR}/extra-sis_context.h \ ${PATCHDIR}/extra-src-glsl_ir_constant_expression.cpp \ + ${PATCHDIR}/extra-src__gallium__include__pipe__p_config.h \ ${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c \ - ${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c + ${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c \ + ${PATCHDIR}/extra-src__mesa__drivers__dri__radeon__radeon_span.c .else -EXTRA_PATCHES+= ${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \ +EXTRA_PATCHES+= ${PATCHDIR}/extra-configure-old \ + ${PATCHDIR}/extra-mach64_context.h-old \ + ${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \ ${PATCHDIR}/extra-src__mesa__x86-64__xform4.S \ ${PATCHDIR}/extra-src__mesa__x86__glapi_x86.S \ ${PATCHDIR}/extra-src__mesa__x86__read_rgba_span_x86.S @@ -110,6 +115,13 @@ post-patch: ${WRKSRC}/src/glw/Makefile \ ${WRKSRC}/src/mesa/Makefile \ ${WRKSRC}/src/mesa/drivers/dri/Makefile +.if defined(WITH_NEW_XORG) +# replace hardlinks with patched radeon_span.c +.for i in r200 r300 r600 + @${CP} -fp ${WRKSRC}/src/mesa/drivers/dri/radeon/radeon_span.c \ + ${WRKSRC}/src/mesa/drivers/dri/${i}/ +.endfor +.endif .if ${COMPONENT:Mglut} != "" @${REINPLACE_CMD} -e 's|[$$](INSTALL_LIB_DIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|' \ ${WRKSRC}/src/glut/glx/Makefile diff --git a/graphics/libGL/files/extra-configure b/graphics/libGL/files/extra-configure new file mode 100644 index 000000000000..fc1a68f41695 --- /dev/null +++ b/graphics/libGL/files/extra-configure @@ -0,0 +1,42 @@ +--- configure.orig 2011-11-17 19:46:34.000000000 +0000 ++++ configure 2012-06-28 12:53:09.000000000 +0000 +@@ -7817,10 +7817,35 @@ + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi + +- if test "x$DRI_DIRS" = "xyes"; then +- DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \ +- radeon tdfx unichrome savage sis swrast" +- fi ++ case "$host_cpu" in ++ x86_64) ++ # i810 is missing because there is no x86-64 system where it ++ # could *ever* be used. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \ ++ radeon savage tdfx unichrome sis swrast" ++ fi ++ ;; ++ i*86) ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 \ ++ r600 radeon savage tdfx unichrome sis swrast" ++ fi ++ ;; ++ powerpc*) ++ # Build only the drivers for cards that exist on PowerPC. ++ # At some point MGA will be added, but not yet. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast" ++ fi ++ ;; ++ sparc*) ++ # Build only the drivers for cards that exist on SPARC. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast" ++ fi ++ ;; ++ esac + ;; + gnu*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" diff --git a/graphics/libGL/files/extra-configure-old b/graphics/libGL/files/extra-configure-old new file mode 100644 index 000000000000..b2e156de3b6b --- /dev/null +++ b/graphics/libGL/files/extra-configure-old @@ -0,0 +1,43 @@ +--- configure.orig 2009-12-22 03:31:30.000000000 +0100 ++++ configure 2012-06-27 19:49:26.000000000 +0200 +@@ -6946,12 +6946,35 @@ + CXXFLAGS="$CXXFLAGS -ansi -pedantic" + fi + +- # ffb and gamma are missing because they have not been converted +- # to use the new interface. +- if test "x$DRI_DIRS" = "xyes"; then +- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ ++ case "$host_cpu" in ++ x86_64) ++ # i810 is missing because there is no x86-64 system where it ++ # could *ever* be used. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ + unichrome savage sis swrast" +- fi ++ fi ++ ;; ++ i*86) ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ ++ unichrome savage sis swrast" ++ fi ++ ;; ++ powerpc*) ++ # Build only the drivers for cards that exist on PowerPC. ++ # At some point MGA will be added, but not yet. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast" ++ fi ++ ;; ++ sparc*) ++ # Build only the drivers for cards that exist on SPARC. ++ if test "x$DRI_DIRS" = "xyes"; then ++ DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast" ++ fi ++ ;; ++ esac + ;; + gnu*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" diff --git a/graphics/libGL/files/extra-mach64_context.h-old b/graphics/libGL/files/extra-mach64_context.h-old new file mode 100644 index 000000000000..9e3b38e357cd --- /dev/null +++ b/graphics/libGL/files/extra-mach64_context.h-old @@ -0,0 +1,20 @@ +--- src/mesa/drivers/dri/mach64/mach64_context.h.orig 2012-06-27 19:59:32.000000000 +0200 ++++ src/mesa/drivers/dri/mach64/mach64_context.h 2012-06-27 20:08:30.000000000 +0200 +@@ -294,11 +294,14 @@ + #define LE32_OUT( x, y ) do { *(GLuint *)(x) = (y); } while (0) + #define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0) + #else +-#ifndef __OpenBSD__ +-#include <byteswap.h> +-#else ++#if defined(__OpenBSD__) + #include <machine/endian.h> + #define bswap_32 bswap32 ++#elif defined(__FreeBSD__) ++#include <sys/endian.h> ++#define bswap_32 bswap32 ++#else ++#include <byteswap.h> + #endif + + #define LE32_IN( x ) bswap_32( *(GLuint *)(x) ) diff --git a/graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h b/graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h new file mode 100644 index 000000000000..41f38a9663bb --- /dev/null +++ b/graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h @@ -0,0 +1,25 @@ +--- src/gallium/include/pipe/p_config.h.orig 2011-10-15 02:43:58.000000000 +0200 ++++ src/gallium/include/pipe/p_config.h 2012-06-28 21:27:06.000000000 +0200 +@@ -106,6 +106,13 @@ + #endif + #endif + ++#if defined(__sparc__) || defined(__sparc64__) ++#define PIPE_ARCH_SPARC ++#if defined(__sparc64__) ++#define PIPE_ARCH_SPARC_64 ++#endif ++#endif ++ + + /* + * Endian detection. +@@ -133,7 +140,7 @@ + + #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) + #define PIPE_ARCH_LITTLE_ENDIAN +-#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) ++#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64) + #define PIPE_ARCH_BIG_ENDIAN + #endif + diff --git a/graphics/libGL/files/extra-src__mesa__drivers__dri__radeon__radeon_span.c b/graphics/libGL/files/extra-src__mesa__drivers__dri__radeon__radeon_span.c new file mode 100644 index 000000000000..3a186e98d644 --- /dev/null +++ b/graphics/libGL/files/extra-src__mesa__drivers__dri__radeon__radeon_span.c @@ -0,0 +1,15 @@ +--- src/mesa/drivers/dri/radeon/radeon_span.c.orig 2011-07-09 03:37:10.000000000 +0200 ++++ src/mesa/drivers/dri/radeon/radeon_span.c 2012-06-28 21:44:07.000000000 +0200 +@@ -55,7 +55,11 @@ + #include <byteswap.h> + #define CPU_TO_LE16( x ) bswap_16( x ) + #define LE16_TO_CPU( x ) bswap_16( x ) +-#endif /* __linux__ */ ++#elif defined(__FreeBSD__) ++#include <sys/endian.h> ++#define CPU_TO_LE16( x ) bswap16( x ) ++#define LE16_TO_CPU( x ) bswap16( x ) ++#endif + #else + #define CPU_TO_LE16( x ) ( x ) + #define LE16_TO_CPU( x ) ( x ) |