wok-stable rev 5614

catalyst: fix compile with 2.6.33.4 and WGET_URL
author Rohit Joshi <jozee@slitaz.org>
date Thu May 20 10:43:52 2010 -0400 (2010-05-20)
parents 82243e902598
children c02e7935fe71
files catalyst/receipt catalyst/stuff/catalyst-2.6.33.4.patch
line diff
     1.1 --- a/catalyst/receipt	Wed May 19 18:36:37 2010 +0200
     1.2 +++ b/catalyst/receipt	Thu May 20 10:43:52 2010 -0400
     1.3 @@ -8,7 +8,8 @@
     1.4  WEB_SITE="http://www.ati.amd.com"
     1.5  DEPENDS="xorg-server mesa mesa-dri libdrm linux-drm fontconfig linux-agp xorg-libSM xorg-libXi xorg-libXcursor"
     1.6  BUILD_DEPENDS="linux xorg-server"
     1.7 -TARBALL="ati-driver-installer-$VERSION-x86.x86_64.run"
     1.8 +TARBALL="ati-driver-installer-${VERSION/./-}-x86.x86_64.run"
     1.9 +WGET_URL="http://www2.ati.com/drivers/linux/$TARBALL"
    1.10  TAGS="drivers graphic video"
    1.11  
    1.12  # Rules to configure and make the package.
    1.13 @@ -16,7 +17,7 @@
    1.14  compile_rules() {
    1.15  
    1.16  	KERNEL_VERSION=`grep  ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    1.17 -	WGET_URL="http://www2.ati.com/drivers/linux/$TARBALL"
    1.18 +	
    1.19  	
    1.20  	[ -d $WOK/linux/taz ] || tazwok cook linux
    1.21     
    1.22 @@ -33,6 +34,8 @@
    1.23  	for i in autoconf.h utsrelease.h ; do
    1.24  		grep -rl linux/$i * | xargs sed -i "s|linux/$i|generated/$i|"
    1.25  	done
    1.26 +	cd $src
    1.27 +	patch -Np1 -i ../stuff/$PACKAGE-${KERNEL_VERSION}.patch
    1.28  	cd $src/common/lib/modules/fglrx/build_mod
    1.29  	cp $src/arch/x86/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC4 . 
    1.30  	cp 2.6.x/Makefile .
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/catalyst/stuff/catalyst-2.6.33.4.patch	Thu May 20 10:43:52 2010 -0400
     2.3 @@ -0,0 +1,228 @@
     2.4 +Index: ati10.1/common/lib/modules/fglrx/build_mod/drmP.h
     2.5 +===================================================================
     2.6 +--- ati10.1/common/lib/modules/fglrx/build_mod/drmP.h
     2.7 ++++ ati10.1/common/lib/modules/fglrx/build_mod/drmP.h	2010-01-28 19:57:07.562644291 +0200
     2.8 +@@ -42,7 +42,12 @@
     2.9 +  * can build the DRM (part of PI DRI). 4/21/2000 S + B */
    2.10 + #include <asm/current.h>
    2.11 + #endif /* __alpha__ */
    2.12 ++#include <linux/version.h>
    2.13 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
    2.14 ++#include <generated/autoconf.h>
    2.15 ++#else
    2.16 + #include <generated/autoconf.h>
    2.17 ++#endif
    2.18 + #include <linux/module.h>
    2.19 + #include <linux/kernel.h>
    2.20 + #include <linux/miscdevice.h>
    2.21 +@@ -51,7 +56,6 @@
    2.22 + #include <linux/init.h>
    2.23 + #include <linux/file.h>
    2.24 + #include <linux/pci.h>
    2.25 +-#include <linux/version.h>
    2.26 + #include <linux/sched.h>
    2.27 + #include <linux/smp_lock.h>	/* For (un)lock_kernel */
    2.28 + #include <linux/mm.h>
    2.29 +Index: ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c
    2.30 +===================================================================
    2.31 +--- ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c
    2.32 ++++ ati10.1/common/lib/modules/fglrx/build_mod/firegl_public.c	2010-01-29 14:21:58.687999115 +0200
    2.33 +@@ -28,7 +28,11 @@
    2.34 + #error Kernel versions older than 2.6.0 are no longer supported by this module.
    2.35 + #endif 
    2.36 + 
    2.37 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
    2.38 ++#include <generated/autoconf.h>
    2.39 ++#else
    2.40 + #include <generated/autoconf.h>
    2.41 ++#endif
    2.42 + 
    2.43 + #if !defined(CONFIG_X86) 
    2.44 + #if !defined(CONFIG_X86_PC) 
    2.45 +@@ -163,8 +167,12 @@
    2.46 + 
    2.47 + //  For 2.6.18 or higher, the UTS_RELEASE is defined in the generated/utsrelease.h. 
    2.48 + #ifndef UTS_RELEASE 
    2.49 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
    2.50 ++#include <generated/utsrelease.h>
    2.51 ++#else
    2.52 + #include <generated/utsrelease.h>
    2.53 + #endif
    2.54 ++#endif
    2.55 + 
    2.56 + #if defined(__i386__)
    2.57 + #ifndef do_div
    2.58 +@@ -1472,7 +1472,16 @@
    2.59 + #ifndef __HAVE_ARCH_CMPXCHG
    2.60 +     return __fgl_cmpxchg(ptr,old,new,size);
    2.61 + #else
    2.62 +-    return __cmpxchg(ptr,old,new,size);
    2.63 ++    switch (size) {
    2.64 ++    case 1: { volatile u8 *_ptr = ptr; return cmpxchg(_ptr, old, new); }
    2.65 ++    case 2: { volatile u16 *_ptr = ptr; return cmpxchg(_ptr, old, new); }
    2.66 ++    case 4: { volatile u32 *_ptr = ptr; return cmpxchg(_ptr, old, new); }
    2.67 ++#ifdef __x86_64__
    2.68 ++    case 8: { volatile u64 *_ptr = ptr; return cmpxchg(_ptr, old, new); }
    2.69 ++#endif
    2.70 ++    default:
    2.71 ++        return old;
    2.72 ++    }
    2.73 + #endif
    2.74 + }
    2.75 +
    2.76 + 
    2.77 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c
    2.78 +===================================================================
    2.79 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c
    2.80 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2010-01-28 19:57:17.897225045 +0200
    2.81 +@@ -15,7 +15,11 @@
    2.82 +  ****************************************************************************/
    2.83 + 
    2.84 + #include <linux/version.h>
    2.85 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
    2.86 ++#include <generated/autoconf.h>
    2.87 ++#else
    2.88 + #include <generated/autoconf.h>
    2.89 ++#endif
    2.90 + #include <linux/acpi.h>
    2.91 + 
    2.92 + #include "kcl_config.h"
    2.93 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c
    2.94 +===================================================================
    2.95 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c
    2.96 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_agp.c	2010-01-28 19:57:26.104892082 +0200
    2.97 +@@ -31,7 +31,11 @@
    2.98 +  */
    2.99 + 
   2.100 + #include <linux/version.h>
   2.101 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.102 ++#include <generated/autoconf.h>
   2.103 ++#else
   2.104 + #include <generated/autoconf.h>
   2.105 ++#endif
   2.106 + #include <linux/pci.h>
   2.107 + #include <linux/agp_backend.h>
   2.108 + #include <linux/string.h>
   2.109 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c
   2.110 +===================================================================
   2.111 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c
   2.112 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_io.c	2010-01-28 19:57:34.337558105 +0200
   2.113 +@@ -37,7 +37,11 @@
   2.114 +  */
   2.115 + 
   2.116 + #include <linux/version.h>
   2.117 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.118 ++#include <generated/autoconf.h>
   2.119 ++#else
   2.120 + #include <generated/autoconf.h>
   2.121 ++#endif
   2.122 + #include <linux/poll.h>
   2.123 + #include <linux/signal.h>
   2.124 + #include <asm/io.h>
   2.125 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h
   2.126 +===================================================================
   2.127 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h
   2.128 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_osconfig.h	2010-01-28 19:57:43.599182385 +0200
   2.129 +@@ -20,7 +20,11 @@
   2.130 + #define KCL_OSCONFIG_H
   2.131 + 
   2.132 + #include <linux/version.h>
   2.133 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.134 ++#include <generated/autoconf.h>
   2.135 ++#else
   2.136 + #include <generated/autoconf.h>
   2.137 ++#endif
   2.138 + 
   2.139 + // Choose modern way to call 32-on-64 IOCTLs if configured in the kernel
   2.140 + #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
   2.141 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c
   2.142 +===================================================================
   2.143 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c
   2.144 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_pci.c	2010-01-28 19:57:51.295870149 +0200
   2.145 +@@ -31,7 +31,11 @@
   2.146 +  */
   2.147 + 
   2.148 + #include <linux/version.h>
   2.149 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.150 ++#include <generated/autoconf.h>
   2.151 ++#else
   2.152 + #include <generated/autoconf.h>
   2.153 ++#endif
   2.154 + #include <linux/pci.h>
   2.155 + 
   2.156 + #include "kcl_config.h"
   2.157 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c
   2.158 +===================================================================
   2.159 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c
   2.160 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_str.c	2010-01-28 19:57:59.728528058 +0200
   2.161 +@@ -30,7 +30,12 @@
   2.162 +  *
   2.163 +  */
   2.164 + 
   2.165 ++#include <linux/version.h>
   2.166 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.167 ++#include <generated/autoconf.h>
   2.168 ++#else
   2.169 + #include <generated/autoconf.h>
   2.170 ++#endif
   2.171 + #include <linux/string.h>
   2.172 + #include <linux/module.h>
   2.173 + 
   2.174 +Index: ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c
   2.175 +===================================================================
   2.176 +--- ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c
   2.177 ++++ ati10.1/common/lib/modules/fglrx/build_mod/kcl_wait.c	2010-01-28 19:58:08.936154527 +0200
   2.178 +@@ -31,7 +31,11 @@
   2.179 +  */
   2.180 + 
   2.181 + #include <linux/version.h>
   2.182 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
   2.183 ++#include <generated/autoconf.h>
   2.184 ++#else
   2.185 + #include <generated/autoconf.h>
   2.186 ++#endif
   2.187 + #include <linux/wait.h>
   2.188 + #include <linux/highmem.h>
   2.189 + #include <linux/sched.h>
   2.190 +Index: ati10.1/common/lib/modules/fglrx/build_mod/make.sh
   2.191 +===================================================================
   2.192 +--- ati10.1/common/lib/modules/fglrx/build_mod/make.sh
   2.193 ++++ ati10.1/common/lib/modules/fglrx/build_mod/make.sh	2010-01-28 19:55:10.849378991 +0200
   2.194 +@@ -218,8 +218,15 @@
   2.195 +         # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw
   2.196 +         kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` 
   2.197 +     else
   2.198 +-        # For 2.6.18 or higher, UTS-define is defined in utsrelease.h.
   2.199 +-        kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` 
   2.200 ++        UTS_REL_COUNT=`cat $linuxincludes/generated/utsrelease.h 2>/dev/null | grep UTS_RELEASE -c`
   2.201 ++
   2.202 ++	if [ $UTS_REL_COUNT -gt 0 ]; then
   2.203 ++	    # 2.6.33+
   2.204 ++	    kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
   2.205 ++	else
   2.206 ++            # For 2.6.18 to 2.6.32, UTS-define is defined in utsrelease.h.
   2.207 ++            kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
   2.208 ++	fi
   2.209 +     fi
   2.210 +   fi
   2.211 + fi
   2.212 +@@ -302,7 +309,8 @@
   2.213 + # 3
   2.214 + # generated/autoconf.h may contain this: #define CONFIG_SMP 1
   2.215 + 
   2.216 +-src_file=$linuxincludes/generated/autoconf.h
   2.217 ++src_file=$linuxincludes/generated/autoconf.h
   2.218 ++[ -e $src_file ] || src_file=$linuxincludes/generated/autoconf.h
   2.219 + 
   2.220 + if [ ! -e $src_file ]; then
   2.221 +   echo "Warning:"                                                  >> $logfile
   2.222 +@@ -355,7 +363,8 @@
   2.223 + MODVERSIONS=0
   2.224 + 
   2.225 + # generated/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
   2.226 +-src_file=$linuxincludes/generated/autoconf.h
   2.227 ++src_file=$linuxincludes/generated/autoconf.h
   2.228 ++[ -e $src_file ] || src_file=$linuxincludes/generated/autoconf.h
   2.229 + if [ ! -e $src_file ];
   2.230 + then
   2.231 +   echo "Warning:"                                                  >> $logfile