From 7b43fca244be19bbb50d585a3fa7ecff33d80f61 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Sun, 22 Jul 2012 13:13:22 +0000 Subject: [PATCH] lib32-mesa updated, nouveau removed(bug https://bugs.freedesktop.org/show_bug.cgi?id=50280) --- lib32-mesa/PKGBUILD | 164 ++-- lib32-mesa/mesa-8.0.3-llvm-3.1-fixes.patch | 44 + lib32-mesa/nouveau-fix-header.patch | 810 ++++++++++++++++-- .../PKGBUILD | 0 4 files changed, 825 insertions(+), 193 deletions(-) create mode 100644 lib32-mesa/mesa-8.0.3-llvm-3.1-fixes.patch rename {lib32-util-linux-ng => lib32-util-linux}/PKGBUILD (100%) diff --git a/lib32-mesa/PKGBUILD b/lib32-mesa/PKGBUILD index a514419..daf1873 100644 --- a/lib32-mesa/PKGBUILD +++ b/lib32-mesa/PKGBUILD @@ -4,45 +4,48 @@ # maintainer (x86_64): Anke Boersma pkgbase=lib32-mesa -pkgname=('lib32-mesa' 'lib32-libgl' 'lib32-libgles' 'lib32-libegl' 'lib32-ati-dri' 'lib32-intel-dri' 'lib32-unichrome-dri' 'lib32-mach64-dri' 'lib32-mga-dri' 'lib32-r128-dri' 'lib32-savage-dri' 'lib32-sis-dri' 'lib32-tdfx-dri' 'lib32-nouveau-dri') +pkgname=('lib32-mesa' 'lib32-libgl' 'lib32-libglapi' 'lib32-libgles' 'lib32-libegl' 'lib32-ati-dri' 'lib32-intel-dri' 'lib32-svga-dri') -pkgver=7.10.2 +pkgver=8.0.3 pkgrel=2 arch=(x86_64) -makedepends=('glproto>=1.4.12' 'pkgconfig' 'lib32-libdrm>=2.4.23' 'lib32-libxxf86vm>=1.1.0' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-libx11>=1.3.5' 'lib32-libxt>=1.0.8' 'lib32-gcc-libs>=4.5' 'dri2proto=2.3' 'python2' 'libxml2' 'gcc-multilib' imake 'lib32-udev') +makedepends=('glproto>=1.4.12' 'pkgconfig' 'lib32-libdrm>=2.4.37' 'lib32-libxxf86vm>=1.1.0' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-libx11>=1.3.5' 'lib32-libxt>=1.0.8' 'lib32-gcc-libs>=4.5' 'lib32-llvm>=3.0' 'dri2proto>=2.6' 'python2' 'libxml2' 'gcc-multilib' imake 'lib32-udev') url="http://mesa3d.sourceforge.net" license=('custom') source=("ftp://ftp.freedesktop.org/pub/mesa/${pkgver}/MesaLib-${pkgver}.tar.bz2" - nouveau-fix-header.patch) -md5sums=('f5de82852f1243f42cc004039e10b771' - '67c87b77cc2236b52a3b47dad3fbb5d4') - + 'mesa-8.0.3-llvm-3.1-fixes.patch') +md5sums=('cc5ee15e306b8c15da6a478923797171' + '0082f4d17674155aa13bc611a5687788') build() { export CC="gcc -m32" export CXX="g++ -m32" export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + # for our llvm-config for 32 bit + export LLVM_CONFIG=/usr/bin/llvm-config32 cd "${srcdir}/Mesa-${pkgver}" - patch -Np1 -i "${srcdir}/nouveau-fix-header.patch" + patch -Np1 -i "${srcdir}/mesa-8.0.3-llvm-3.1-fixes.patch" - ./configure --prefix=/usr \ + autoreconf -vfi + + ./autogen.sh --prefix=/usr \ --with-dri-driverdir=/usr/lib32/xorg/modules/dri \ - --enable-gallium-radeon \ - --enable-gallium-r600 \ - --enable-gallium-nouveau \ - --enable-gallium-swrast \ - --enable-glx-tls \ - --with-driver=dri \ - --enable-xcb \ - --with-state-trackers=dri,glx \ - --disable-glut \ - --enable-gles1 \ - --enable-gles2 \ - --enable-egl \ - --disable-gallium-egl \ + --with-gallium-drivers=r300,r600,svga,swrast, \ + --with-dri-drivers=i915,i965,r200,radeon,swrast \ + --enable-gallium-llvm \ + --enable-gallium-egl \ + --enable-shared-glapi\ + --enable-glx-tls \ + --enable-dri \ + --enable-glx \ + --enable-gles1 \ + --enable-gles2 \ + --enable-egl \ + --enable-texture-float \ + --enable-shared-dricore \ --enable-32-bit \ --libdir=/usr/lib32 @@ -50,7 +53,7 @@ build() { } package_lib32-libgl() { - depends=('lib32-libdrm>=2.4.23' 'lib32-libxxf86vm>=1.1.0' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-gcc-libs>=4.5' 'libgl') + depends=('lib32-libdrm>=2.4.33' 'lib32-libxxf86vm>=1.1.0' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-gcc-libs>=4.5' 'libgl') pkgdesc="Mesa 3-D graphics library and DRI software rasterizer (32-bit)" cd "${srcdir}/Mesa-${pkgver}" @@ -61,7 +64,6 @@ package_lib32-libgl() { bin/minstall lib32/libGL.so* "${pkgdir}/usr/lib32/" make -C ${srcdir}/Mesa-${pkgver}/src/gallium/targets/dri-swrast DESTDIR="${pkgdir}" install - ln -s swrastg_dri.so "${pkgdir}/usr/lib32/xorg/modules/dri/swrast_dri.so" ln -s libglx.xorg "${pkgdir}/usr/lib32/xorg/modules/extensions/libglx.so" rm -rf "${pkgdir}"/usr/{include,share,bin} @@ -69,6 +71,18 @@ package_lib32-libgl() { ln -s libgl "$pkgdir/usr/share/licenses/libgl/lib32-libgl" } +package_lib32-libglapi() { + depends=('glibc') + pkgdesc="free implementation of the GL API -- shared library. The Mesa GL API module is responsible for dispatching all the gl* functions" + + cd ${srcdir}/?esa-* + install -m755 -d "${pkgdir}/usr/lib32" + bin/minstall lib32/libglapi.so* "${pkgdir}/usr/lib32/" + + install -m755 -d "${pkgdir}/usr/share/licenses/libglapi" + ln -s libglapi "${pkgdir}/usr/share/licenses/libglapi/lib32-libglapi" +} + package_lib32-libgles() { depends=('libgles') pkgdesc="Mesa GLES libraries (32-bit)" @@ -127,105 +141,25 @@ package_lib32-ati-dri() { pkgdesc="Mesa DRI + Gallium3D for r300 and later chipsets drivers for AMD/ATI Radeon (32-bit)" conflicts=('xf86-video-ati<6.9.0-6') - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - + cd ${srcdir}/?esa-*/src/mesa/drivers/dri + # classic mesa drivers for radeon,r200 make -C radeon DESTDIR="${pkgdir}" install make -C r200 DESTDIR="${pkgdir}" install - - # DRI drivers for r300 and r600 are removed # gallium3D driver for R300 and R600 r300_dri.so/r600_dri.so - make -C ${srcdir}/Mesa-${pkgver}/src/gallium/targets/dri-r300 DESTDIR="${pkgdir}" install - make -C ${srcdir}/Mesa-${pkgver}/src/gallium/targets/dri-r600 DESTDIR="${pkgdir}" install + make -C ${srcdir}/?esa-*/src/gallium/targets/dri-r300 DESTDIR="${pkgdir}" install + make -C ${srcdir}/?esa-*/src/gallium/targets/dri-r600 DESTDIR="${pkgdir}" install } package_lib32-intel-dri() { depends=("lib32-libgl=${pkgver}") pkgdesc="Mesa DRI drivers for Intel (32-bit)" - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C i810 DESTDIR="${pkgdir}" install - make -C i915 DESTDIR="${pkgdir}" install - make -C i965 DESTDIR="${pkgdir}" install + make -C ${srcdir}/?esa-*/src/mesa/drivers/dri/i915 DESTDIR="${pkgdir}" install + make -C ${srcdir}/?esa-*/src/mesa/drivers/dri/i965 DESTDIR="${pkgdir}" install } +package_lib32-svga-dri() { + depends=("mesa=${pkgver}") + pkgdesc="Gallium3D VMware guest GL driver" -package_lib32-unichrome-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for S3 Graphics/VIA Unichrome (32-bit)" - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C unichrome DESTDIR="${pkgdir}" install -} - -package_lib32-mach64-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for ATI Mach64 (32-bit)" - conflicts=('xf86-video-mach64<6.8.2') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C mach64 DESTDIR="${pkgdir}" install -} - -package_lib32-mga-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for Matrox (32-bit)" - conflicts=('xf86-video-mga<1.4.11') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C mga DESTDIR="${pkgdir}" install -} - -package_lib32-r128-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for ATI Rage128 (32-bit)" - conflicts=('xf86-video-r128<6.8.1') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C r128 DESTDIR="${pkgdir}" install -} - -package_lib32-savage-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for S3 Sraphics/VIA Savage (32-bit)" - conflicts=('xf86-video-savage<2.3.1') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C savage DESTDIR="${pkgdir}" install -} - -package_lib32-sis-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for SiS (32-bit)" - conflicts=('xf86-video-sis<0.10.2') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C sis DESTDIR="${pkgdir}" install -} - -package_lib32-tdfx-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa DRI drivers for 3dfx (32-bit)" - conflicts=('xf86-video-tdfx<1.4.3') - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - make -C tdfx DESTDIR="${pkgdir}" install -} - -package_lib32-nouveau-dri() { - depends=("lib32-libgl=${pkgver}") - pkgdesc="Mesa classic DRI + Gallium3D drivers for Nouveau (32-bit)" - - cd "${srcdir}/Mesa-${pkgver}/src/mesa/drivers/dri" - - # classic mesa driver for nv10 , nv20 nouveau_vieux_dri.so - make -C nouveau DESTDIR="${pkgdir}" install - # gallium3D driver for nv30 - nv40 - nv50 nouveau_dri.so - make -C ${srcdir}/Mesa-${pkgver}/src/gallium/targets/dri-nouveau DESTDIR="${pkgdir}" install -} + make -C ${srcdir}/?esa-*/src/gallium/targets/dri-vmwgfx DESTDIR="${pkgdir}" install +} \ No newline at end of file diff --git a/lib32-mesa/mesa-8.0.3-llvm-3.1-fixes.patch b/lib32-mesa/mesa-8.0.3-llvm-3.1-fixes.patch new file mode 100644 index 0000000..922577a --- /dev/null +++ b/lib32-mesa/mesa-8.0.3-llvm-3.1-fixes.patch @@ -0,0 +1,44 @@ +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +index a50a51d..f1bb4d9 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +@@ -235,7 +235,24 @@ lp_disassemble(const void* func) + int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); + #endif + +-#if HAVE_LLVM >= 0x0300 ++#if HAVE_LLVM >= 0x0301 ++ OwningPtr MRI(T->createMCRegInfo(Triple)); ++ if (!MRI) { ++ debug_printf("error: no register info for target %s\n", Triple.c_str()); ++ return; ++ } ++ ++ OwningPtr MII(T->createMCInstrInfo()); ++ if (!MII) { ++ debug_printf("error: no instruction info for target %s\n", Triple.c_str()); ++ return; ++ } ++#endif ++ ++#if HAVE_LLVM >= 0x0301 ++ OwningPtr Printer( ++ T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); ++#elif HAVE_LLVM == 0x0300 + OwningPtr Printer( + T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI)); + #elif HAVE_LLVM >= 0x0208 +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index fe7616b..68f8808 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -62,7 +62,11 @@ + extern "C" void + lp_register_oprofile_jit_event_listener(LLVMExecutionEngineRef EE) + { ++#if HAVE_LLVM >= 0x0301 ++ llvm::unwrap(EE)->RegisterJITEventListener(llvm::JITEventListener::createOProfileJITEventListener()); ++#else + llvm::unwrap(EE)->RegisterJITEventListener(llvm::createOProfileJITEventListener()); ++#endif + } diff --git a/lib32-mesa/nouveau-fix-header.patch b/lib32-mesa/nouveau-fix-header.patch index 38aa996..c1f7cfe 100644 --- a/lib32-mesa/nouveau-fix-header.patch +++ b/lib32-mesa/nouveau-fix-header.patch @@ -1,86 +1,740 @@ -From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001 -From: Ben Skeggs -Date: Mon, 20 Dec 2010 03:39:36 +0000 -Subject: nouveau: fix includes for latest libdrm - -Signed-off-by: Ben Skeggs ---- -diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h -index ab480ca..747b084 100644 ---- a/src/gallium/drivers/nouveau/nouveau_winsys.h -+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h -@@ -10,7 +10,7 @@ - #include "nouveau/nouveau_grobj.h" - #include "nouveau/nouveau_notifier.h" - #include "nouveau/nouveau_resource.h" --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" +diff --git a/configs/autoconf.in b/configs/autoconf.in +index 4e931a3..c674f7d 100644 +--- a/configs/autoconf.in ++++ b/configs/autoconf.in +@@ -26,6 +26,8 @@ LDFLAGS = @LDFLAGS@ + EXTRA_LIB_PATH = @EXTRA_LIB_PATH@ + RADEON_CFLAGS = @RADEON_CFLAGS@ + RADEON_LDFLAGS = @RADEON_LDFLAGS@ ++NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@ ++NOUVEAU_LIBS = @NOUVEAU_LIBS@ + INTEL_LIBS = @INTEL_LIBS@ + INTEL_CFLAGS = @INTEL_CFLAGS@ + X11_LIBS = @X11_LIBS@ +diff --git a/configs/linux-dri b/configs/linux-dri +index 7ee007e..6f2b39d 100644 +--- a/configs/linux-dri ++++ b/configs/linux-dri +@@ -63,11 +63,16 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965 + GALLIUM_TARGET_DIRS = + GALLIUM_STATE_TRACKERS_DIRS = egl - #ifndef NV04_PFIFO_MAX_PACKET_LEN - #define NV04_PFIFO_MAX_PACKET_LEN 2047 -diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c -index ce48022..a99df76 100644 ---- a/src/gallium/drivers/nv50/nv50_surface.c -+++ b/src/gallium/drivers/nv50/nv50_surface.c -@@ -22,7 +22,7 @@ +-DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ ++DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \ + savage sis tdfx unichrome swrast - #define __NOUVEAU_PUSH_H__ - #include --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" - #include "nv50_context.h" - #include "nv50_resource.h" - #include "pipe/p_defines.h" -diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c -index e0e65e7..e2fadd3 100644 ---- a/src/gallium/drivers/nvfx/nv04_2d.c -+++ b/src/gallium/drivers/nvfx/nv04_2d.c -@@ -34,11 +34,11 @@ - #include - #include - #include --#include - #include - #include - #include - #include -+#include - #include "nv04_2d.h" +-INTEL_LIBS = `pkg-config --libs libdrm_intel` +-INTEL_CFLAGS = `pkg-config --cflags libdrm_intel` ++INTEL_LIBS = $(shell pkg-config --libs libdrm_intel) ++INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel) - #include "nouveau/nv_object.xml.h" -diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c -index 597664e..339b317 100644 ---- a/src/gallium/drivers/nvfx/nvfx_vbo.c -+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c -@@ -9,8 +9,7 @@ - #include "nvfx_resource.h" +-RADEON_LIBS = `pkg-config --libs libdrm_radeon` +-RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon` ++NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau) ++NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau) ++ ++LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon) ++LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon) ++RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)" ++RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS) +diff --git a/configure.ac b/configure.ac +index c705d45..22e880b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -21,6 +21,7 @@ dnl Versions for external dependencies + LIBDRM_REQUIRED=2.4.24 + LIBDRM_RADEON_REQUIRED=2.4.24 + LIBDRM_INTEL_REQUIRED=2.4.24 ++LIBDRM_NOUVEAU_REQUIRED=0.6 + DRI2PROTO_REQUIRED=2.1 + GLPROTO_REQUIRED=1.4.11 + LIBDRM_XORG_REQUIRED=2.4.24 +@@ -998,8 +999,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then + # the new interface. i810 are missing because there is no + # x86-64 system where they could *ever* be used. + if test "x$DRI_DIRS" = "xyes"; then +- DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \ +- savage tdfx unichrome swrast" ++ DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \ ++ radeon savage tdfx unichrome swrast" + fi + ;; + powerpc*) +@@ -1026,8 +1027,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then + fi - #include "nouveau/nouveau_channel.h" + if test "x$DRI_DIRS" = "xyes"; then +- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ +- unichrome savage sis swrast" ++ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \ ++ radeon tdfx unichrome savage sis swrast" + fi + ;; + gnu*) +@@ -1055,7 +1056,7 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then + + # default drivers + if test "x$DRI_DIRS" = "xyes"; then +- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ ++ DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \ + savage sis tdfx unichrome swrast" + fi + +@@ -1092,6 +1093,12 @@ case $DRI_DIRS in + esac + + case $DRI_DIRS in ++*nouveau*) ++ PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED]) ++ ;; ++esac ++ ++case $DRI_DIRS in + *radeon*|*r200*|*r300*|*r600*) + if test "x$HAVE_LIBDRM_RADEON" = xyes; then + RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS" +diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri +index 3fb4cc6..6c6ad18 100644 +--- a/src/gallium/targets/Makefile.dri ++++ b/src/gallium/targets/Makefile.dri +@@ -75,7 +75,7 @@ LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) + default: depend symlinks $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING) + + $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \ +- $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o ++ $(TOP)/src/mesa/drivers/dri/Makefile.targets $(TOP)/src/mesa/drivers/dri/common/dri_test.o + $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ + $(OBJECTS) $(PIPE_DRIVERS) \ + -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \ +diff --git a/src/mesa/drivers/dri/Makefile.defines b/src/mesa/drivers/dri/Makefile.defines +new file mode 100644 +index 0000000..19b6de8 +--- /dev/null ++++ b/src/mesa/drivers/dri/Makefile.defines +@@ -0,0 +1,34 @@ ++# -*-makefile-*- ++ ++COMMON_GALLIUM_SOURCES = \ ++ ../common/utils.c \ ++ ../common/vblank.c \ ++ ../common/dri_util.c \ ++ ../common/xmlconfig.c ++ ++COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \ ++ ../../common/driverfuncs.c \ ++ ../common/texmem.c \ ++ ../common/drirenderbuffer.c ++ ++INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) ++ ++OBJECTS = $(C_SOURCES:.c=.o) \ ++ $(CXX_SOURCES:.cpp=.o) \ ++ $(ASM_SOURCES:.S=.o) ++ ++ ++### Include directories ++SHARED_INCLUDES = \ ++ -I. \ ++ -I$(TOP)/src/mesa/drivers/dri/common \ ++ -Iserver \ ++ -I$(TOP)/include \ ++ -I$(TOP)/src/mapi \ ++ -I$(TOP)/src/mesa \ ++ -I$(TOP)/src/egl/main \ ++ -I$(TOP)/src/egl/drivers/dri \ ++ $(LIBDRM_CFLAGS) ++ ++INCLUDES += $(API_DEFINES) ++CXXFLAGS += $(API_DEFINES) +diff --git a/src/mesa/drivers/dri/Makefile.targets b/src/mesa/drivers/dri/Makefile.targets +new file mode 100644 +index 0000000..436b2a3 +--- /dev/null ++++ b/src/mesa/drivers/dri/Makefile.targets +@@ -0,0 +1,78 @@ ++# -*-makefile-*- ++ ++##### RULES ##### ++ ++.c.o: ++ $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ ++ ++.cpp.o: ++ $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@ ++ ++.S.o: ++ $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ ++ ++ ++#### TARGETS ##### ++ ++default: subdirs lib ++ ++ ++.PHONY: lib ++lib: symlinks subdirs depend ++ @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) ++ ++$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \ ++ $(TOP)/src/mesa/drivers/dri/Makefile.targets $(TOP)/src/mesa/drivers/dri/common/dri_test.o ++ $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ ++ $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS) ++ $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) ++ @rm -f $@.test ++ mv -f $@.tmp $@ ++ ++ ++$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) ++ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) ++ ++ ++# If the Makefile defined SUBDIRS, run make in each ++.PHONY: subdirs ++subdirs: ++ @if test -n "$(SUBDIRS)" ; then \ ++ for dir in $(SUBDIRS) ; do \ ++ if [ -d $$dir ] ; then \ ++ (cd $$dir && $(MAKE)) || exit 1; \ ++ fi \ ++ done \ ++ fi ++ ++ ++.PHONY: symlinks ++symlinks: ++ ++ ++depend: $(C_SOURCES) $(CXX_SOURCES) $(ASM_SOURCES) $(SYMLINKS) ++ @ echo "running $(MKDEP)" ++ @ rm -f depend ++ @ touch depend ++ @ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) \ ++ $(C_SOURCES) $(CXX_SOURCES) \ ++ $(ASM_SOURCES) > /dev/null 2>/dev/null ++ ++ ++# Emacs tags ++tags: ++ etags `find . -name \*.[ch]` `find ../include` ++ ++ ++# Remove .o and backup files ++clean: ++ -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) ++ -rm -f depend depend.bak ++ ++ ++install: $(LIBNAME) ++ $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) ++ $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) ++ ++ ++-include depend +diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template +deleted file mode 100644 +index d1a1193..0000000 +--- a/src/mesa/drivers/dri/Makefile.template ++++ /dev/null +@@ -1,111 +0,0 @@ +-# -*-makefile-*- - --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" +-COMMON_GALLIUM_SOURCES = \ +- ../common/utils.c \ +- ../common/vblank.c \ +- ../common/dri_util.c \ +- ../common/xmlconfig.c +- +-COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \ +- ../../common/driverfuncs.c \ +- ../common/texmem.c \ +- ../common/drirenderbuffer.c +- +-INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) +- +-OBJECTS = $(C_SOURCES:.c=.o) \ +- $(CXX_SOURCES:.cpp=.o) \ +- $(ASM_SOURCES:.S=.o) +- +- +-### Include directories +-SHARED_INCLUDES = \ +- -I. \ +- -I$(TOP)/src/mesa/drivers/dri/common \ +- -Iserver \ +- -I$(TOP)/include \ +- -I$(TOP)/src/mapi \ +- -I$(TOP)/src/mesa \ +- -I$(TOP)/src/egl/main \ +- -I$(TOP)/src/egl/drivers/dri \ +- $(LIBDRM_CFLAGS) +- +-CFLAGS += $(API_DEFINES) +-CXXFLAGS += $(API_DEFINES) +- +-##### RULES ##### +- +-.c.o: +- $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ +- +-.cpp.o: +- $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@ +- +-.S.o: +- $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ +- +- +-##### TARGETS ##### +- +-default: subdirs lib +- +- +-.PHONY: lib +-lib: symlinks subdirs depend +- @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) +- +-$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \ +- $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o +- $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ +- $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS) +- $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) +- @rm -f $@.test +- mv -f $@.tmp $@ +- +- +-$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) +- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) +- +- +-# If the Makefile defined SUBDIRS, run make in each +-.PHONY: subdirs +-subdirs: +- @if test -n "$(SUBDIRS)" ; then \ +- for dir in $(SUBDIRS) ; do \ +- if [ -d $$dir ] ; then \ +- (cd $$dir && $(MAKE)) || exit 1; \ +- fi \ +- done \ +- fi +- +- +-.PHONY: symlinks +-symlinks: +- +- +-depend: $(C_SOURCES) $(CXX_SOURCES) $(ASM_SOURCES) $(SYMLINKS) +- @ echo "running $(MKDEP)" +- @ rm -f depend +- @ touch depend +- @ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) \ +- $(C_SOURCES) $(CXX_SOURCES) \ +- $(ASM_SOURCES) > /dev/null 2>/dev/null +- +- +-# Emacs tags +-tags: +- etags `find . -name \*.[ch]` `find ../include` +- +- +-# Remove .o and backup files +-clean: +- -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) +- -rm -f depend depend.bak +- +- +-install: $(LIBNAME) +- $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) +- $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) +- +- +--include depend +diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile +index 54a837d..edc6dd2 100644 +--- a/src/mesa/drivers/dri/i810/Makefile ++++ b/src/mesa/drivers/dri/i810/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current - static inline unsigned - util_guess_unique_indices_count(unsigned mode, unsigned indices) -diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h -index 8036b18..c5ac128 100644 ---- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h -+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h -@@ -38,7 +38,6 @@ - #include + LIBNAME = i810_dri.so - #include "nouveau_device.h" --#include "nouveau_pushbuf.h" - #include "nouveau_grobj.h" - #include "nouveau_channel.h" - #include "nouveau_bo.h" -@@ -46,6 +45,7 @@ - #include "nouveau_screen.h" - #include "nouveau_state.h" - #include "nouveau_surface.h" -+#include "nv04_pushbuf.h" ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + i810context.c \ + i810ioctl.c \ +@@ -24,5 +26,5 @@ C_SOURCES = \ - #define DRIVER_DATE "20091015" - #define DRIVER_AUTHOR "Nouveau" --- -cgit v0.8.3-6-g21f6 + ASM_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile +index 65fd658..79e03f2 100644 +--- a/src/mesa/drivers/dri/i915/Makefile ++++ b/src/mesa/drivers/dri/i915/Makefile +@@ -4,6 +4,8 @@ include $(TOP)/configs/current + + LIBNAME = i915_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + i830_context.c \ + i830_state.c \ +@@ -63,7 +65,7 @@ DRIVER_DEFINES = -I../intel -DI915 \ + INCLUDES += $(INTEL_CFLAGS) + DRI_LIB_DEPS += $(INTEL_LIBS) + +-include ../Makefile.template ++include ../Makefile.targets + + intel_decode.o: ../intel/intel_decode.c + +diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile +index 849018b..e656779 100644 +--- a/src/mesa/drivers/dri/i965/Makefile ++++ b/src/mesa/drivers/dri/i965/Makefile +@@ -4,6 +4,8 @@ include $(TOP)/configs/current + + LIBNAME = i965_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + intel_batchbuffer.c \ + intel_blit.c \ +@@ -117,7 +119,7 @@ DRIVER_DEFINES = -I../intel + INCLUDES += $(INTEL_CFLAGS) + DRI_LIB_DEPS += $(INTEL_LIBS) + +-include ../Makefile.template ++include ../Makefile.targets + + intel_decode.o: ../intel/intel_decode.c + intel_tex_layout.o: ../intel/intel_tex_layout.c +diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile +index c20fdec..0474c1a 100644 +--- a/src/mesa/drivers/dri/mach64/Makefile ++++ b/src/mesa/drivers/dri/mach64/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = mach64_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + mach64_context.c \ + mach64_ioctl.c \ +@@ -25,5 +27,5 @@ C_SOURCES = \ + + ASM_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile +index 92533bc..9948ee7 100644 +--- a/src/mesa/drivers/dri/mga/Makefile ++++ b/src/mesa/drivers/dri/mga/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = mga_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + mgadd.c \ + mgaioctl.c \ +@@ -27,5 +29,5 @@ C_SOURCES = \ + + ASM_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/nouveau/Makefile b/src/mesa/drivers/dri/nouveau/Makefile +index 3b506a9..e485a98 100644 +--- a/src/mesa/drivers/dri/nouveau/Makefile ++++ b/src/mesa/drivers/dri/nouveau/Makefile +@@ -3,11 +3,10 @@ + TOP = ../../../../.. + include $(TOP)/configs/current + +-CFLAGS += $(shell pkg-config libdrm libdrm_nouveau --cflags) +-DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) +- + LIBNAME = nouveau_vieux_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + nouveau_screen.c \ + nouveau_context.c \ +@@ -51,7 +50,9 @@ C_SOURCES = \ + + ASM_SOURCES = + ++INCLUDES += $(NOUVEAU_CFLAGS) ++DRI_LIB_DEPS += $(NOUVEAU_LIBS) + +-include ../Makefile.template ++include ../Makefile.targets + + symlinks: +diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile +index 8144c9b..8b23ccc 100644 +--- a/src/mesa/drivers/dri/r128/Makefile ++++ b/src/mesa/drivers/dri/r128/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = r128_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + r128_context.c \ + r128_lock.c \ +@@ -25,5 +27,5 @@ C_SOURCES = \ + ASM_SOURCES = + + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile +index 8013768..4547f7e 100644 +--- a/src/mesa/drivers/dri/r200/Makefile ++++ b/src/mesa/drivers/dri/r200/Makefile +@@ -3,10 +3,10 @@ + TOP = ../../../../.. + include $(TOP)/configs/current + +-CFLAGS += $(RADEON_CFLAGS) +- + LIBNAME = r200_dri.so + ++include ../Makefile.defines ++ + ifeq ($(RADEON_LDFLAGS),) + CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c + endif +@@ -55,12 +55,13 @@ X86_SOURCES = + + DRIVER_DEFINES = -DRADEON_R200 + ++INCLUDES += $(RADEON_CFLAGS) + DRI_LIB_DEPS += $(RADEON_LDFLAGS) + + ##### TARGETS ##### + + +-include ../Makefile.template ++include ../Makefile.targets + + #INCLUDES += -I../radeon/server + +diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile +index 2245998..9f23a84 100644 +--- a/src/mesa/drivers/dri/r300/Makefile ++++ b/src/mesa/drivers/dri/r300/Makefile +@@ -3,17 +3,17 @@ + TOP = ../../../../.. + include $(TOP)/configs/current + +-CFLAGS += $(RADEON_CFLAGS) +- + LIBNAME = r300_dri.so + ++include ../Makefile.defines ++ + ifeq ($(RADEON_LDFLAGS),) + CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c + endif + + COMMON_SOURCES = \ + ../../common/driverfuncs.c \ +- ../common/mm.c \ ++ ../common/drirenderbuffer.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c \ +@@ -64,6 +64,7 @@ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) + DRIVER_DEFINES = -DRADEON_R300 + # -DRADEON_BO_TRACK \ + ++INCLUDES += $(RADEON_CFLAGS) + DRI_LIB_DEPS += $(RADEON_LDFLAGS) + + SUBDIRS = compiler +@@ -73,5 +74,5 @@ EXTRA_MODULES = compiler/libr300compiler.a + + ##### TARGETS ##### + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile +index 200bc20..bec0b5a 100644 +--- a/src/mesa/drivers/dri/r600/Makefile ++++ b/src/mesa/drivers/dri/r600/Makefile +@@ -3,17 +3,17 @@ + TOP = ../../../../.. + include $(TOP)/configs/current + +-CFLAGS += $(RADEON_CFLAGS) +- + LIBNAME = r600_dri.so + ++include ../Makefile.defines ++ + ifeq ($(RADEON_LDFLAGS),) + CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c + endif + + COMMON_SOURCES = \ + ../../common/driverfuncs.c \ +- ../common/mm.c \ ++ ../common/drirenderbuffer.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c \ +@@ -78,9 +78,10 @@ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) + DRIVER_DEFINES = -DRADEON_R600 + # -DRADEON_BO_TRACK \ + ++INCLUDES += $(RADEON_CFLAGS) + DRI_LIB_DEPS += $(RADEON_LDFLAGS) + + ##### TARGETS ##### + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile +index 93219e4..6b5d333 100644 +--- a/src/mesa/drivers/dri/radeon/Makefile ++++ b/src/mesa/drivers/dri/radeon/Makefile +@@ -4,10 +4,10 @@ + TOP = ../../../../.. + include $(TOP)/configs/current + +-CFLAGS += $(RADEON_CFLAGS) +- + LIBNAME = radeon_dri.so + ++include ../Makefile.defines ++ + ifeq ($(RADEON_LDFLAGS),) + CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c + endif +@@ -53,9 +53,10 @@ C_SOURCES = \ + + DRIVER_DEFINES = -DRADEON_R100 + ++INCLUDES += $(RADEON_CFLAGS) + DRI_LIB_DEPS += $(RADEON_LDFLAGS) + + X86_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile +index 5351155..03be346 100644 +--- a/src/mesa/drivers/dri/savage/Makefile ++++ b/src/mesa/drivers/dri/savage/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = savage_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + savage_xmesa.c \ + savagedd.c \ +@@ -22,5 +24,5 @@ C_SOURCES = \ + ASM_SOURCES = + + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile +index 6b4f938..0e0bf0d 100644 +--- a/src/mesa/drivers/dri/sis/Makefile ++++ b/src/mesa/drivers/dri/sis/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = sis_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + sis6326_state.c \ + sis6326_clear.c \ +@@ -28,5 +30,5 @@ C_SOURCES = \ + + ASM_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/swrast/Makefile b/src/mesa/drivers/dri/swrast/Makefile +index d2cf6db..4cb99fd 100644 +--- a/src/mesa/drivers/dri/swrast/Makefile ++++ b/src/mesa/drivers/dri/swrast/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = swrast_dri.so + ++include ../Makefile.defines ++ + DRIVER_DEFINES = -D__NOT_HAVE_DRM_H + + DRIVER_SOURCES = \ +@@ -22,5 +24,5 @@ SWRAST_COMMON_SOURCES = \ + ../common/utils.c \ + ../common/drisw_util.c + +-include ../Makefile.template ++include ../Makefile.targets + +diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile +index 96bd8f8..ed84df2 100644 +--- a/src/mesa/drivers/dri/tdfx/Makefile ++++ b/src/mesa/drivers/dri/tdfx/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = tdfx_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + tdfx_context.c \ + tdfx_dd.c \ +@@ -27,6 +29,6 @@ C_SOURCES = \ + + ASM_SOURCES = + +-include ../Makefile.template ++include ../Makefile.targets + + +diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile +index 14cf9f3..373da60 100644 +--- a/src/mesa/drivers/dri/unichrome/Makefile ++++ b/src/mesa/drivers/dri/unichrome/Makefile +@@ -5,6 +5,8 @@ include $(TOP)/configs/current + + LIBNAME = unichrome_dri.so + ++include ../Makefile.defines ++ + DRIVER_SOURCES = \ + via_context.c \ + via_fb.c \ +@@ -25,5 +27,5 @@ C_SOURCES = \ + ASM_SOURCES = + + +-include ../Makefile.template ++include ../Makefile.targets \ No newline at end of file diff --git a/lib32-util-linux-ng/PKGBUILD b/lib32-util-linux/PKGBUILD similarity index 100% rename from lib32-util-linux-ng/PKGBUILD rename to lib32-util-linux/PKGBUILD